Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update all dependencies to the latest major #176

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

70 changes: 0 additions & 70 deletions .eslintrc.cjs

This file was deleted.

33 changes: 17 additions & 16 deletions .figmaexportrc-native.example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,47 @@
* $ npm install --save-dev @svgr/plugin-svgo @svgr/plugin-jsx @svgr/plugin-prettier
* */

import { FigmaExportRC, ComponentsCommandOptions } from "@figma-export/types";
import type {
ComponentsCommandOptions,
FigmaExportRC,
} from '@figma-export/types';

import transformSvgWithSvgo from "@figma-export/transform-svg-with-svgo";
import transformSvgWithSvgr from "@figma-export/output-components-as-svgr";
import transformSvgWithSvgr from '@figma-export/output-components-as-svgr';
import transformSvgWithSvgo from '@figma-export/transform-svg-with-svgo';

const componentOptions: ComponentsCommandOptions = {
fileId: "fzYhvQpqwhZDUImRz431Qo",
fileId: 'fzYhvQpqwhZDUImRz431Qo',
// version: 'xxx123456', // optional - file's version history is only supported on paid Figma plans
onlyFromPages: ["icons"],
onlyFromPages: ['icons'],
transformers: [
transformSvgWithSvgo({
plugins: [
{
name: "preset-default",
name: 'preset-default',
params: {
overrides: {
removeViewBox: false,
},
},
},
{
name: "removeXMLNS",
name: 'removeXMLNS',
},
],
}),
],
outputters: [
transformSvgWithSvgr({
output: "./output",
getFileExtension: () => ".tsx",
output: './output',
getFileExtension: () => '.tsx',
getSvgrConfig: () => ({
expandProps: "end",
expandProps: 'end',
icon: true,
native: true,
plugins: [
"@svgr/plugin-svgo",
"@svgr/plugin-jsx",
"@svgr/plugin-prettier",
'@svgr/plugin-svgo',
'@svgr/plugin-jsx',
'@svgr/plugin-prettier',
],
template: ({ componentName, props, jsx, exports }, { tpl }) => tpl`
const ${componentName} = (${props}) => (${jsx});
Expand All @@ -55,7 +58,5 @@ const componentOptions: ComponentsCommandOptions = {
};

export default {
commands: [
["components", componentOptions]
],
commands: [['components', componentOptions]],
} satisfies FigmaExportRC;
40 changes: 20 additions & 20 deletions .figmaexportrc.example.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// @ts-check

import outputComponentsAsSvg from '@figma-export/output-components-as-svg'
import outputStylesAsSass from '@figma-export/output-styles-as-sass'
import transformSvgWithSvgo from '@figma-export/transform-svg-with-svgo'
import outputComponentsAsSvg from '@figma-export/output-components-as-svg';
import outputStylesAsSass from '@figma-export/output-styles-as-sass';
import transformSvgWithSvgo from '@figma-export/transform-svg-with-svgo';

/** @type { import('@figma-export/types').StylesCommandOptions } */
const styleOptions = {
Expand All @@ -12,10 +12,10 @@ const styleOptions = {
// onlyFromPages: ['icons'], // optional - Figma page names or IDs (all pages when not specified)
outputters: [
outputStylesAsSass({
output: './output'
})
]
}
output: './output',
}),
],
};

/** @type { import('@figma-export/types').ComponentsCommandOptions } */
const componentOptions = {
Expand All @@ -31,26 +31,26 @@ const componentOptions = {
params: {
overrides: {
removeViewBox: false,
}
}
},
},
},
{
name: 'removeDimensions'
}
]
})
name: 'removeDimensions',
},
],
}),
],
outputters: [
outputComponentsAsSvg({
output: './output'
})
]
}
output: './output',
}),
],
};

/** @type { import('@figma-export/types').FigmaExportRC } */
export default {
commands: [
['styles', styleOptions],
['components', componentOptions]
]
}
['components', componentOptions],
],
};
140 changes: 70 additions & 70 deletions .figmaexportrc.example.local.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,94 +7,94 @@
* $ node ./packages/cli/bin/run.js use-config .figmaexportrc.example.local.js
*/

import path from 'path';
import path from 'node:path';

import outputComponentsAsEs6 from './packages/output-components-as-es6/dist/index.js';
import outputComponentsAsSvg from './packages/output-components-as-svg/dist/index.js';
import outputComponentsAsSvgr from './packages/output-components-as-svgr/dist/index.js';
import outputComponentsAsSvgstore from './packages/output-components-as-svgstore/dist/index.js';
import outputStylesAsCss from './packages/output-styles-as-css/dist/index.js';
import outputStylesAsLess from './packages/output-styles-as-less/dist/index.js';
import outputStylesAsSass from './packages/output-styles-as-sass/dist/index.js';
import outputStylesAsStyleDictionary from './packages/output-styles-as-style-dictionary/dist/index.js';
import transformSvgWithSvgo from './packages/transform-svg-with-svgo/dist/index.js';
import outputComponentsAsEs6 from './packages/output-components-as-es6/dist/index.js';
import outputComponentsAsSvg from './packages/output-components-as-svg/dist/index.js';
import outputComponentsAsSvgr from './packages/output-components-as-svgr/dist/index.js';
import outputComponentsAsSvgstore from './packages/output-components-as-svgstore/dist/index.js';

/** @type {import('./packages/types').StylesCommandOptions} */
const styleOptions = {
fileId: 'fzYhvQpqwhZDUImRz431Qo',
// onlyFromPages: ['icons'], // optional - Figma page names or IDs (all pages when not specified)
outputters: [
outputStylesAsCss({
output: './output/styles/css'
}),
outputStylesAsLess({
output: './output/styles/less'
}),
outputStylesAsSass({
output: './output/styles/sass'
}),
outputStylesAsStyleDictionary({
output: './output/styles/style-dictionary'
})
]
fileId: 'fzYhvQpqwhZDUImRz431Qo',
// onlyFromPages: ['icons'], // optional - Figma page names or IDs (all pages when not specified)
outputters: [
outputStylesAsCss({
output: './output/styles/css',
}),
outputStylesAsLess({
output: './output/styles/less',
}),
outputStylesAsSass({
output: './output/styles/sass',
}),
outputStylesAsStyleDictionary({
output: './output/styles/style-dictionary',
}),
],
};

/** @type {import('./packages/types').ComponentsCommandOptions} */
const componentOptions = {
fileId: 'fzYhvQpqwhZDUImRz431Qo',
onlyFromPages: ['icons', 'unit-test', 'icons/octicons-by-github'],
// concurrency: 30,
transformers: [
transformSvgWithSvgo({
plugins: [
{
name: 'preset-default',
params: {
overrides: {
removeViewBox: false,
}
}
},
{
name: 'removeDimensions'
}
]
})
],
outputters: [
outputComponentsAsEs6({
output: './output/components/es6',
useBase64: true,
}),
outputComponentsAsSvg({
output: './output/components/svg',
getDirname: (options) => {
const pathToComponent = options.pathToComponent.map(p => p.name).join(path.sep)
return `${options.pageName}${path.sep}${options.dirname}${path.sep}${pathToComponent}`
fileId: 'fzYhvQpqwhZDUImRz431Qo',
onlyFromPages: ['icons', 'unit-test', 'icons/octicons-by-github'],
// concurrency: 30,
transformers: [
transformSvgWithSvgo({
plugins: [
{
name: 'preset-default',
params: {
overrides: {
removeViewBox: false,
},
}),
outputComponentsAsSvgr({
output: './output/components/svgr',
getSvgrConfig: () => ({
template: ({ componentName, props, jsx, exports }, { tpl }) => tpl`
},
},
{
name: 'removeDimensions',
},
],
}),
],
outputters: [
outputComponentsAsEs6({
output: './output/components/es6',
useBase64: true,
}),
outputComponentsAsSvg({
output: './output/components/svg',
getDirname: (options) => {
const pathToComponent = options.pathToComponent
.map((p) => p.name)
.join(path.sep);
return `${options.pageName}${path.sep}${options.dirname}${path.sep}${pathToComponent}`;
},
}),
outputComponentsAsSvgr({
output: './output/components/svgr',
getSvgrConfig: () => ({
template: ({ componentName, props, jsx, exports }, { tpl }) => tpl`
const ${componentName} = (${props}) => (${jsx});
${exports}
`
})
}),
outputComponentsAsSvgstore({
output: './output/components/svgstore',
svgstoreConfig: {

}
})
]
`,
}),
}),
outputComponentsAsSvgstore({
output: './output/components/svgstore',
svgstoreConfig: {},
}),
],
};

/** @type {import('./packages/types').FigmaExportRC} */
export default {
commands: [
['styles', styleOptions],
['components', componentOptions]
]
commands: [
['styles', styleOptions],
['components', componentOptions],
],
};
Loading