From 6b089f0804055b2f68d92ede041fad7e4eacfae4 Mon Sep 17 00:00:00 2001 From: Brad Mering Date: Tue, 21 Mar 2023 10:41:48 -0600 Subject: [PATCH 1/2] Fixes undefined bug in button token opacity --- figma-exporter/src/transformers/scss/components/button.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/figma-exporter/src/transformers/scss/components/button.ts b/figma-exporter/src/transformers/scss/components/button.ts index 98ce8df0..e12f2b52 100644 --- a/figma-exporter/src/transformers/scss/components/button.ts +++ b/figma-exporter/src/transformers/scss/components/button.ts @@ -118,6 +118,7 @@ export const transformButtonComponentTokensToScssVariables = (tokens: ButtonComp [getScssVariableName({ component: 'button', part: '', property: 'opacity', theme, type, state })]: { value: `${tokens.opacity}`, property: 'opacity', + group: Part.Button, }, }; }; From 1d2c9f9a12d845b680da6e050d00406a637b0b3b Mon Sep 17 00:00:00 2001 From: Brad Mering Date: Tue, 21 Mar 2023 19:52:37 -0600 Subject: [PATCH 2/2] Improving Node Version checking and adding better interface for questions --- installer/create.js | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/installer/create.js b/installer/create.js index c9b3e636..ec1f8f2d 100644 --- a/installer/create.js +++ b/installer/create.js @@ -36,12 +36,26 @@ const maskPrompt = (query) => */ (async () => { try { + let requirements = false; + const result = process.versions; + if (result && result.node) { + if (parseInt(result.node) >= 16) { + requirements = true; + } + } else { + // couldn't find the right version, but ... + } + if (!requirements) { + console.log(chalk.redBright('Handoff Installation failed')); + console.log(chalk.yellow('- Please update node to at least Node 16 https://nodejs.org/en/download. \n- You can read more about installing handoff at https://www.handoff.com/docs/')); + process.exit(0); + } // Get a folder name - const welcome = `The Handoff App installer will ask a couple of questions to set up the project. -Only the project name is required. The rest can be supplied via a .env file or env vars.\n`; + const welcome = `\n==============================\nThe Handoff App installer will ask a couple of questions to set up the project. +Only the project name is required. The rest can be supplied via a .env file or env vars.\n==============================\n`; console.log(welcome); // Ask the user for a project name - const project = await prompt('Project name: (lower case, no spaces) '); + const project = await prompt(chalk.green('Project name: (lower case, no spaces) ')); if (project === '') { // You've got to give us a project name console.log('Sorry, Project name is required.'); @@ -54,9 +68,12 @@ Only the project name is required. The rest can be supplied via a .env file or e } // Fetch figma file id - const figmaIdSupplied = await prompt('Figma File Id (optional): '); + console.log(`\n==============================\nNext we need the Figma file id. You can find this by looking at the url of your Figma file. \nIf the url is ${chalk.blue(`https://www.figma.com/file/IGYfyraLDa0BpVXkxHY2tE/Starter-%5BV2%5D`)}\nyour id would be IGYfyraLDa0BpVXkxHY2tE\n==============================\n`) + const figmaIdSupplied = await prompt(chalk.green('Figma File Id (optional): ')); // Fetch a masked developer key - const developerKeySupplied = await maskPrompt('Figma Developer Key (optional): '); + console.log(`\n==============================\nFinally we need a developer token so we can access Figma on your behalf. \n Use these instructions to generate them ${chalk.blue(`https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens`)} \n==============================\n`) + + const developerKeySupplied = await maskPrompt(chalk.green('Figma Developer Key (optional): ')); // Get the current directory const currentDir = process.cwd(); @@ -94,6 +111,7 @@ Only the project name is required. The rest can be supplied via a .env file or e rl.close(); } catch (e) { console.error(chalk.red('Installation Failed'), e); + process.exit(0); } })();