Skip to content

Commit 3edf28b

Browse files
fix(plugin): coverage and token publisher minor fixes (#2554)
1 parent 863680c commit 3edf28b

File tree

5 files changed

+507
-1970
lines changed

5 files changed

+507
-1970
lines changed

packages/plugin-figma-blade-coverage/src/main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ const calculateCoverage = (node: SceneNode): CoverageMetrics | null => {
507507
nonBladeComponents++;
508508
highlightNonBladeNode(
509509
traversedNode,
510-
`Use relevant Blade component. You're using a Frame with fill/strokes/effects`,
510+
`You might want to use Card with Slot. You're using a Frame with fill/strokes/effects.`,
511511
);
512512
} else {
513513
NODES_SKIP_FROM_COVERAGE.push('FRAME');

packages/plugin-figma-token-publisher/package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@
1818
"@types/react-dom": "17.0.0",
1919
"@types/react": "17.0.0",
2020
"@types/set-value": "4.0.1",
21-
"css-loader": "5.0.1",
21+
"css-loader": "6.7.1",
2222
"figma-plugin-ds": "0.1.8",
23-
"html-webpack-inline-source-plugin": "0.0.10",
24-
"html-webpack-plugin": "3.2.0",
23+
"html-webpack-inline-source-plugin": "1.0.3",
24+
"html-webpack-plugin": "^5.6.3",
2525
"is-plain-object": "5.0.0",
2626
"is-primitive": "3.0.1",
2727
"js-string-compression": "1.0.1",
2828
"set-value": "4.1.0",
29-
"style-loader": "2.0.0",
30-
"ts-loader": "8.0.11",
31-
"typescript": "4.1.2",
29+
"style-loader": "3.3.1",
30+
"ts-loader": "9.4.2",
31+
"typescript": "4.9.5",
3232
"url-loader": "4.1.1",
33-
"webpack-cli": "3.3.6",
33+
"webpack-cli": "5.1.4",
3434
"webpack": "5.97.1"
3535
}
3636
}

packages/plugin-figma-token-publisher/src/plugin/makeDevTokenNames.ts

+14-12
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,22 @@ const makeDevTokenNames = (): void => {
3636
// @ts-expect-error because valuesByMode can be undefined and bunch of other things that is not worthy to put conditions for hence ignoring because for our dataset it will always be true
3737
variable.valuesByMode[Object.keys(variable.valuesByMode)[0]].id,
3838
);
39-
// console.log(variableModeValue);
4039

4140
let tokenName = '';
42-
if (variableModeValue.name.includes('Radius')) {
43-
tokenName = `border.radius.${variableModeValue.name.split('/').pop()}`;
44-
// set the syntax for border radius
45-
} else if (variableModeValue.name.includes('Width')) {
46-
// set the syntax for border width
47-
tokenName = `border.width.${variableModeValue.name.split('/').pop()}`;
48-
} else if (variableModeValue.name.includes('spacing')) {
49-
// set the syntax for spacing
50-
tokenName = variableModeValue.name
51-
.replace(/\//g, '.')
52-
.replace(/\.[0-9]+/, (matchedString) => `[${matchedString.replace('.', '')}]`);
41+
42+
if (variableModeValue) {
43+
if (variableModeValue.name.includes('Radius')) {
44+
tokenName = `border.radius.${variableModeValue.name.split('/').pop()}`;
45+
// set the syntax for border radius
46+
} else if (variableModeValue.name.includes('Width')) {
47+
// set the syntax for border width
48+
tokenName = `border.width.${variableModeValue.name.split('/').pop()}`;
49+
} else if (variableModeValue.name.includes('spacing')) {
50+
// set the syntax for spacing
51+
tokenName = variableModeValue.name
52+
.replace(/\//g, '.')
53+
.replace(/\.[0-9]+/, (matchedString) => `[${matchedString.replace('.', '')}]`);
54+
}
5355
}
5456

5557
if (tokenName) {

packages/plugin-figma-token-publisher/webpack.config.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,17 @@ module.exports = (env, argv) => ({
3232
output: {
3333
filename: '[name].js',
3434
path: path.resolve(__dirname, 'dist'), // Compile into a folder called "dist"
35+
publicPath: '/',
3536
},
3637

3738
// Tells Webpack to generate "ui.html" and to inline "ui.ts" into it
3839
plugins: [
3940
new HtmlWebpackPlugin({
40-
template: './src/app/index.html',
41+
template: 'src/app/index.html',
4142
filename: 'ui.html',
4243
inlineSource: '.(js)$',
4344
chunks: ['ui'],
4445
}),
45-
new HtmlWebpackInlineSourcePlugin(),
46+
new HtmlWebpackInlineSourcePlugin(HtmlWebpackPlugin),
4647
],
4748
});

0 commit comments

Comments
 (0)