@ledgerhq/lumen-design-core 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/lib/presets/allBrands.d.ts.map +1 -0
- package/dist/{presets → lib/presets}/allBrands.js +1 -3
- package/dist/lib/presets/enterprise.d.ts.map +1 -0
- package/dist/{presets → lib/presets}/enterprise.js +1 -3
- package/dist/lib/presets/index.d.ts.map +1 -0
- package/dist/lib/presets/ledger-live.d.ts.map +1 -0
- package/dist/{presets → lib/presets}/ledger-live.js +1 -1
- package/dist/lib/presets/websites.d.ts.map +1 -0
- package/dist/{presets → lib/presets}/websites.js +1 -3
- package/dist/lib/themes/css/enterprise/theme.dark-css.d.ts.map +1 -0
- package/dist/lib/themes/css/enterprise/theme.light-css.d.ts.map +1 -0
- package/dist/lib/themes/css/index.d.ts.map +1 -0
- package/dist/lib/themes/css/ledger-live/theme.dark-css.d.ts.map +1 -0
- package/dist/lib/themes/css/ledger-live/theme.light-css.d.ts.map +1 -0
- package/dist/lib/themes/css/primitives-css.d.ts.map +1 -0
- package/dist/lib/themes/css/typographies/typography.lg-css.d.ts.map +1 -0
- package/dist/lib/themes/css/typographies/typography.md-css.d.ts.map +1 -0
- package/dist/lib/themes/css/typographies/typography.sm-css.d.ts.map +1 -0
- package/dist/lib/themes/css/typographies/typography.xl-css.d.ts.map +1 -0
- package/dist/lib/themes/css/typographies/typography.xs-css.d.ts.map +1 -0
- package/dist/lib/themes/css/websites/theme.dark-css.d.ts.map +1 -0
- package/dist/lib/themes/css/websites/theme.light-css.d.ts.map +1 -0
- package/dist/{themes → lib/themes}/js/enterprise/theme.d.ts.map +1 -1
- package/dist/{themes/js/websites → lib/themes/js/enterprise}/theme.dark.d.ts.map +1 -1
- package/dist/{themes → lib/themes}/js/enterprise/theme.light.d.ts.map +1 -1
- package/dist/lib/themes/js/index.d.ts.map +1 -0
- package/dist/{themes/js/websites → lib/themes/js/ledger-live}/theme.d.ts.map +1 -1
- package/dist/{themes → lib/themes}/js/ledger-live/theme.dark.d.ts.map +1 -1
- package/dist/{themes → lib/themes}/js/ledger-live/theme.light.d.ts.map +1 -1
- package/dist/{themes → lib/themes}/js/primitives/primitive.colors.d.ts.map +1 -1
- package/dist/{themes → lib/themes}/js/primitives/primitive.gradients.d.ts.map +1 -1
- package/dist/lib/themes/js/primitives/primitive.typographies.d.ts.map +1 -0
- package/dist/lib/themes/js/primitives/primitives.motion.d.ts.map +1 -0
- package/dist/{themes → lib/themes}/js/primitives/primitives.others.d.ts.map +1 -1
- package/dist/lib/themes/js/primitives/primitives.shadows.d.ts.map +1 -0
- package/dist/lib/themes/js/types.d.ts.map +1 -0
- package/dist/{themes → lib/themes}/js/typographies/index.d.ts.map +1 -1
- package/dist/{themes → lib/themes}/js/typographies/typography.lg.d.ts.map +1 -1
- package/dist/lib/themes/js/typographies/typography.md.d.ts.map +1 -0
- package/dist/lib/themes/js/typographies/typography.sm.d.ts.map +1 -0
- package/dist/{themes → lib/themes}/js/typographies/typography.xl.d.ts.map +1 -1
- package/dist/lib/themes/js/typographies/typography.xs.d.ts.map +1 -0
- package/dist/lib/themes/js/utils/extractCryptoGradients.d.ts.map +1 -0
- package/dist/{themes/js/ledger-live → lib/themes/js/websites}/theme.d.ts.map +1 -1
- package/dist/{themes/js/enterprise → lib/themes/js/websites}/theme.dark.d.ts.map +1 -1
- package/dist/{themes → lib/themes}/js/websites/theme.light.d.ts.map +1 -1
- package/dist/lib/utils/createAnimationsPlugin.d.ts.map +1 -0
- package/dist/lib/utils/createCustomPlugin.d.ts.map +1 -0
- package/dist/lib/utils/createIconUtilities.d.ts.map +1 -0
- package/dist/lib/utils/createMaskPlugin.d.ts.map +1 -0
- package/dist/lib/utils/createPrimitivesPlugin.d.ts.map +1 -0
- package/dist/{utils → lib/utils}/createPrimitivesPlugin.js +1 -1
- package/dist/lib/utils/createScreensPlugin.d.ts.map +1 -0
- package/dist/lib/utils/createSpotUtilities.d.ts.map +1 -0
- package/dist/lib/utils/getThemeUtilsByPrefix.d.ts.map +1 -0
- package/dist/lib/utils/getThemeUtilsByPrefix.test.d.ts.map +1 -0
- package/dist/lib/utils/index.d.ts +6 -0
- package/dist/lib/utils/index.d.ts.map +1 -0
- package/dist/{utils → lib/utils}/index.js +2 -0
- package/package.json +1 -1
- package/dist/presets/allBrands.d.ts.map +0 -1
- package/dist/presets/enterprise.d.ts.map +0 -1
- package/dist/presets/index.d.ts.map +0 -1
- package/dist/presets/ledger-live.d.ts.map +0 -1
- package/dist/presets/websites.d.ts.map +0 -1
- package/dist/themes/css/enterprise/theme.dark-css.d.ts.map +0 -1
- package/dist/themes/css/enterprise/theme.light-css.d.ts.map +0 -1
- package/dist/themes/css/index.d.ts.map +0 -1
- package/dist/themes/css/ledger-live/theme.dark-css.d.ts.map +0 -1
- package/dist/themes/css/ledger-live/theme.light-css.d.ts.map +0 -1
- package/dist/themes/css/primitives-css.d.ts.map +0 -1
- package/dist/themes/css/typographies/typography.lg-css.d.ts.map +0 -1
- package/dist/themes/css/typographies/typography.md-css.d.ts.map +0 -1
- package/dist/themes/css/typographies/typography.sm-css.d.ts.map +0 -1
- package/dist/themes/css/typographies/typography.xl-css.d.ts.map +0 -1
- package/dist/themes/css/typographies/typography.xs-css.d.ts.map +0 -1
- package/dist/themes/css/websites/theme.dark-css.d.ts.map +0 -1
- package/dist/themes/css/websites/theme.light-css.d.ts.map +0 -1
- package/dist/themes/js/index.d.ts.map +0 -1
- package/dist/themes/js/primitives/primitive.typographies.d.ts.map +0 -1
- package/dist/themes/js/primitives/primitives.motion.d.ts.map +0 -1
- package/dist/themes/js/primitives/primitives.shadows.d.ts.map +0 -1
- package/dist/themes/js/types.d.ts.map +0 -1
- package/dist/themes/js/typographies/typography.md.d.ts.map +0 -1
- package/dist/themes/js/typographies/typography.sm.d.ts.map +0 -1
- package/dist/themes/js/typographies/typography.xs.d.ts.map +0 -1
- package/dist/themes/js/utils/extractCryptoGradients.d.ts.map +0 -1
- package/dist/utils/createAnimationsPlugin.d.ts.map +0 -1
- package/dist/utils/createCustomPlugin.d.ts.map +0 -1
- package/dist/utils/createIconUtilities.d.ts.map +0 -1
- package/dist/utils/createMaskPlugin.d.ts.map +0 -1
- package/dist/utils/createPrimitivesPlugin.d.ts.map +0 -1
- package/dist/utils/createScreensPlugin.d.ts.map +0 -1
- package/dist/utils/createSpotUtilities.d.ts.map +0 -1
- package/dist/utils/fsUtils.d.ts +0 -8
- package/dist/utils/fsUtils.d.ts.map +0 -1
- package/dist/utils/fsUtils.js +0 -27
- package/dist/utils/getThemeUtilsByPrefix.d.ts.map +0 -1
- package/dist/utils/getThemeUtilsByPrefix.test.d.ts.map +0 -1
- package/dist/utils/index.d.ts +0 -4
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/parseCliArgs.d.ts +0 -2
- package/dist/utils/parseCliArgs.d.ts.map +0 -1
- package/dist/utils/parseCliArgs.js +0 -14
- package/dist/utils/parseCliArgs.test.d.ts +0 -2
- package/dist/utils/parseCliArgs.test.d.ts.map +0 -1
- package/dist/utils/parseCliArgs.test.js +0 -103
- /package/dist/{presets → lib/presets}/allBrands.d.ts +0 -0
- /package/dist/{presets → lib/presets}/enterprise.d.ts +0 -0
- /package/dist/{presets → lib/presets}/index.d.ts +0 -0
- /package/dist/{presets → lib/presets}/index.js +0 -0
- /package/dist/{presets → lib/presets}/ledger-live.d.ts +0 -0
- /package/dist/{presets → lib/presets}/websites.d.ts +0 -0
- /package/dist/{themes → lib/themes}/css/enterprise/theme.dark-css.d.ts +0 -0
- /package/dist/{themes → lib/themes}/css/enterprise/theme.dark-css.js +0 -0
- /package/dist/{themes → lib/themes}/css/enterprise/theme.light-css.d.ts +0 -0
- /package/dist/{themes → lib/themes}/css/enterprise/theme.light-css.js +0 -0
- /package/dist/{themes → lib/themes}/css/index.d.ts +0 -0
- /package/dist/{themes → lib/themes}/css/index.js +0 -0
- /package/dist/{themes → lib/themes}/css/ledger-live/theme.dark-css.d.ts +0 -0
- /package/dist/{themes → lib/themes}/css/ledger-live/theme.dark-css.js +0 -0
- /package/dist/{themes → lib/themes}/css/ledger-live/theme.light-css.d.ts +0 -0
- /package/dist/{themes → lib/themes}/css/ledger-live/theme.light-css.js +0 -0
- /package/dist/{themes → lib/themes}/css/primitives-css.d.ts +0 -0
- /package/dist/{themes → lib/themes}/css/primitives-css.js +0 -0
- /package/dist/{themes → lib/themes}/css/typographies/typography.lg-css.d.ts +0 -0
- /package/dist/{themes → lib/themes}/css/typographies/typography.lg-css.js +0 -0
- /package/dist/{themes → lib/themes}/css/typographies/typography.md-css.d.ts +0 -0
- /package/dist/{themes → lib/themes}/css/typographies/typography.md-css.js +0 -0
- /package/dist/{themes → lib/themes}/css/typographies/typography.sm-css.d.ts +0 -0
- /package/dist/{themes → lib/themes}/css/typographies/typography.sm-css.js +0 -0
- /package/dist/{themes → lib/themes}/css/typographies/typography.xl-css.d.ts +0 -0
- /package/dist/{themes → lib/themes}/css/typographies/typography.xl-css.js +0 -0
- /package/dist/{themes → lib/themes}/css/typographies/typography.xs-css.d.ts +0 -0
- /package/dist/{themes → lib/themes}/css/typographies/typography.xs-css.js +0 -0
- /package/dist/{themes → lib/themes}/css/websites/theme.dark-css.d.ts +0 -0
- /package/dist/{themes → lib/themes}/css/websites/theme.dark-css.js +0 -0
- /package/dist/{themes → lib/themes}/css/websites/theme.light-css.d.ts +0 -0
- /package/dist/{themes → lib/themes}/css/websites/theme.light-css.js +0 -0
- /package/dist/{themes → lib/themes}/js/enterprise/theme.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/enterprise/theme.dark.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/enterprise/theme.dark.js +0 -0
- /package/dist/{themes → lib/themes}/js/enterprise/theme.js +0 -0
- /package/dist/{themes → lib/themes}/js/enterprise/theme.light.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/enterprise/theme.light.js +0 -0
- /package/dist/{themes → lib/themes}/js/index.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/index.js +0 -0
- /package/dist/{themes → lib/themes}/js/ledger-live/theme.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/ledger-live/theme.dark.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/ledger-live/theme.dark.js +0 -0
- /package/dist/{themes → lib/themes}/js/ledger-live/theme.js +0 -0
- /package/dist/{themes → lib/themes}/js/ledger-live/theme.light.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/ledger-live/theme.light.js +0 -0
- /package/dist/{themes → lib/themes}/js/primitives/primitive.colors.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/primitives/primitive.colors.js +0 -0
- /package/dist/{themes → lib/themes}/js/primitives/primitive.gradients.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/primitives/primitive.gradients.js +0 -0
- /package/dist/{themes → lib/themes}/js/primitives/primitive.typographies.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/primitives/primitive.typographies.js +0 -0
- /package/dist/{themes → lib/themes}/js/primitives/primitives.motion.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/primitives/primitives.motion.js +0 -0
- /package/dist/{themes → lib/themes}/js/primitives/primitives.others.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/primitives/primitives.others.js +0 -0
- /package/dist/{themes → lib/themes}/js/primitives/primitives.shadows.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/primitives/primitives.shadows.js +0 -0
- /package/dist/{themes → lib/themes}/js/types.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/types.js +0 -0
- /package/dist/{themes → lib/themes}/js/typographies/index.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/typographies/index.js +0 -0
- /package/dist/{themes → lib/themes}/js/typographies/typography.lg.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/typographies/typography.lg.js +0 -0
- /package/dist/{themes → lib/themes}/js/typographies/typography.md.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/typographies/typography.md.js +0 -0
- /package/dist/{themes → lib/themes}/js/typographies/typography.sm.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/typographies/typography.sm.js +0 -0
- /package/dist/{themes → lib/themes}/js/typographies/typography.xl.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/typographies/typography.xl.js +0 -0
- /package/dist/{themes → lib/themes}/js/typographies/typography.xs.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/typographies/typography.xs.js +0 -0
- /package/dist/{themes → lib/themes}/js/utils/extractCryptoGradients.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/utils/extractCryptoGradients.js +0 -0
- /package/dist/{themes → lib/themes}/js/websites/theme.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/websites/theme.dark.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/websites/theme.dark.js +0 -0
- /package/dist/{themes → lib/themes}/js/websites/theme.js +0 -0
- /package/dist/{themes → lib/themes}/js/websites/theme.light.d.ts +0 -0
- /package/dist/{themes → lib/themes}/js/websites/theme.light.js +0 -0
- /package/dist/{utils → lib/utils}/createAnimationsPlugin.d.ts +0 -0
- /package/dist/{utils → lib/utils}/createAnimationsPlugin.js +0 -0
- /package/dist/{utils → lib/utils}/createCustomPlugin.d.ts +0 -0
- /package/dist/{utils → lib/utils}/createCustomPlugin.js +0 -0
- /package/dist/{utils → lib/utils}/createIconUtilities.d.ts +0 -0
- /package/dist/{utils → lib/utils}/createIconUtilities.js +0 -0
- /package/dist/{utils → lib/utils}/createMaskPlugin.d.ts +0 -0
- /package/dist/{utils → lib/utils}/createMaskPlugin.js +0 -0
- /package/dist/{utils → lib/utils}/createPrimitivesPlugin.d.ts +0 -0
- /package/dist/{utils → lib/utils}/createScreensPlugin.d.ts +0 -0
- /package/dist/{utils → lib/utils}/createScreensPlugin.js +0 -0
- /package/dist/{utils → lib/utils}/createSpotUtilities.d.ts +0 -0
- /package/dist/{utils → lib/utils}/createSpotUtilities.js +0 -0
- /package/dist/{utils → lib/utils}/getThemeUtilsByPrefix.d.ts +0 -0
- /package/dist/{utils → lib/utils}/getThemeUtilsByPrefix.js +0 -0
- /package/dist/{utils → lib/utils}/getThemeUtilsByPrefix.test.d.ts +0 -0
- /package/dist/{utils → lib/utils}/getThemeUtilsByPrefix.test.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createPrimitivesPlugin.d.ts","sourceRoot":"","sources":["../../src/utils/createPrimitivesPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAM3C,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AAEhD,wBAAgB,sBAAsB,IAAI,cAAc,CA2DvD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createScreensPlugin.d.ts","sourceRoot":"","sources":["../../src/utils/createScreensPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAE3C,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AAEhD,wBAAgB,mBAAmB,IAAI,cAAc,CAkBpD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createSpotUtilities.d.ts","sourceRoot":"","sources":["../../src/utils/createSpotUtilities.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAE3C,eAAO,MAAM,mBAAmB,GAC9B,OAAO,UAAU,CAAC,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,2CAoB5D,CAAC"}
|
package/dist/utils/fsUtils.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Recursively finds all files with a specific extension in a directory.
|
|
3
|
-
* @param dir The directory to search.
|
|
4
|
-
* @param ext The file extension to find (e.g. '.svg').
|
|
5
|
-
* @returns A promise that resolves to an array of file paths.
|
|
6
|
-
*/
|
|
7
|
-
export declare function findFilesByExtension(dir: string, ext: string): Promise<string[]>;
|
|
8
|
-
//# sourceMappingURL=fsUtils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fsUtils.d.ts","sourceRoot":"","sources":["../../src/utils/fsUtils.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,EAAE,CAAC,CAmBnB"}
|
package/dist/utils/fsUtils.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { promises as fs } from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
/**
|
|
4
|
-
* Recursively finds all files with a specific extension in a directory.
|
|
5
|
-
* @param dir The directory to search.
|
|
6
|
-
* @param ext The file extension to find (e.g. '.svg').
|
|
7
|
-
* @returns A promise that resolves to an array of file paths.
|
|
8
|
-
*/
|
|
9
|
-
export async function findFilesByExtension(dir, ext) {
|
|
10
|
-
try {
|
|
11
|
-
const directoryEntries = await fs.readdir(dir, { withFileTypes: true });
|
|
12
|
-
const files = await Promise.all(directoryEntries.map((directoryEntry) => {
|
|
13
|
-
const resolvedPath = path.resolve(dir, directoryEntry.name);
|
|
14
|
-
if (directoryEntry.isDirectory()) {
|
|
15
|
-
return findFilesByExtension(resolvedPath, ext);
|
|
16
|
-
}
|
|
17
|
-
return resolvedPath.endsWith(ext) ? [resolvedPath] : [];
|
|
18
|
-
}));
|
|
19
|
-
return files.flat();
|
|
20
|
-
}
|
|
21
|
-
catch (error) {
|
|
22
|
-
if (error instanceof Error && 'code' in error && error.code === 'ENOENT') {
|
|
23
|
-
return [];
|
|
24
|
-
}
|
|
25
|
-
throw error;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getThemeUtilsByPrefix.d.ts","sourceRoot":"","sources":["../../src/utils/getThemeUtilsByPrefix.ts"],"names":[],"mappings":"AAAA,KAAK,iBAAiB,GAAG;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,aAAa,MAAM,CACjB,MAAM,EACN,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,CAClE,EACD,QAAQ,MAAM,EACd,UAAS,iBAAsB,2BA2BhC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getThemeUtilsByPrefix.test.d.ts","sourceRoot":"","sources":["../../src/utils/getThemeUtilsByPrefix.test.ts"],"names":[],"mappings":""}
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parseCliArgs.d.ts","sourceRoot":"","sources":["../../src/utils/parseCliArgs.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,EAAE,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAalE,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export const parseCliArgs = (args) => {
|
|
2
|
-
const params = {};
|
|
3
|
-
for (let i = 0; i < args.length; i++) {
|
|
4
|
-
if (args[i].startsWith('--')) {
|
|
5
|
-
const key = args[i].substring(2);
|
|
6
|
-
const value = args[i + 1];
|
|
7
|
-
if (value && !value.startsWith('--')) {
|
|
8
|
-
params[key] = value;
|
|
9
|
-
i++;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return params;
|
|
14
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parseCliArgs.test.d.ts","sourceRoot":"","sources":["../../src/utils/parseCliArgs.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { parseCliArgs } from './parseCliArgs.js';
|
|
3
|
-
describe('parseCliArgs', () => {
|
|
4
|
-
it('should parse a single key-value pair', () => {
|
|
5
|
-
const args = ['--name', 'value'];
|
|
6
|
-
const result = parseCliArgs(args);
|
|
7
|
-
expect(result).toEqual({
|
|
8
|
-
name: 'value',
|
|
9
|
-
});
|
|
10
|
-
});
|
|
11
|
-
it('should parse multiple key-value pairs', () => {
|
|
12
|
-
const args = ['--name', 'John', '--age', '25', '--city', 'Paris'];
|
|
13
|
-
const result = parseCliArgs(args);
|
|
14
|
-
expect(result).toEqual({
|
|
15
|
-
name: 'John',
|
|
16
|
-
age: '25',
|
|
17
|
-
city: 'Paris',
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
it('should return empty object for empty args array', () => {
|
|
21
|
-
const args = [];
|
|
22
|
-
const result = parseCliArgs(args);
|
|
23
|
-
expect(result).toEqual({});
|
|
24
|
-
});
|
|
25
|
-
it('should ignore arguments that do not start with --', () => {
|
|
26
|
-
const args = ['command', '--name', 'value', 'other'];
|
|
27
|
-
const result = parseCliArgs(args);
|
|
28
|
-
expect(result).toEqual({
|
|
29
|
-
name: 'value',
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
it('should ignore flags without values', () => {
|
|
33
|
-
const args = ['--flag', '--name', 'value'];
|
|
34
|
-
const result = parseCliArgs(args);
|
|
35
|
-
expect(result).toEqual({
|
|
36
|
-
name: 'value',
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
it('should ignore flags at the end without values', () => {
|
|
40
|
-
const args = ['--name', 'value', '--flag'];
|
|
41
|
-
const result = parseCliArgs(args);
|
|
42
|
-
expect(result).toEqual({
|
|
43
|
-
name: 'value',
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
it('should not use a value that starts with -- as a parameter value', () => {
|
|
47
|
-
const args = ['--flag1', '--flag2', 'value'];
|
|
48
|
-
const result = parseCliArgs(args);
|
|
49
|
-
expect(result).toEqual({
|
|
50
|
-
flag2: 'value',
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
it('should handle values with spaces when passed as single arguments', () => {
|
|
54
|
-
const args = ['--message', 'hello world', '--count', '5'];
|
|
55
|
-
const result = parseCliArgs(args);
|
|
56
|
-
expect(result).toEqual({
|
|
57
|
-
message: 'hello world',
|
|
58
|
-
count: '5',
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
it('should handle numeric values as strings', () => {
|
|
62
|
-
const args = ['--port', '8080', '--timeout', '30'];
|
|
63
|
-
const result = parseCliArgs(args);
|
|
64
|
-
expect(result).toEqual({
|
|
65
|
-
port: '8080',
|
|
66
|
-
timeout: '30',
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
it('should handle boolean-like values as strings', () => {
|
|
70
|
-
const args = ['--enabled', 'true', '--debug', 'false'];
|
|
71
|
-
const result = parseCliArgs(args);
|
|
72
|
-
expect(result).toEqual({
|
|
73
|
-
enabled: 'true',
|
|
74
|
-
debug: 'false',
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
it('should handle empty string values', () => {
|
|
78
|
-
const args = ['--name', '', '--other', 'value'];
|
|
79
|
-
const result = parseCliArgs(args);
|
|
80
|
-
expect(result).toEqual({
|
|
81
|
-
other: 'value',
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
it('should handle complex real-world example', () => {
|
|
85
|
-
const args = [
|
|
86
|
-
'node',
|
|
87
|
-
'script.js',
|
|
88
|
-
'--input',
|
|
89
|
-
'src/tokens',
|
|
90
|
-
'--output',
|
|
91
|
-
'dist/css',
|
|
92
|
-
'--format',
|
|
93
|
-
'css',
|
|
94
|
-
'--verbose',
|
|
95
|
-
];
|
|
96
|
-
const result = parseCliArgs(args);
|
|
97
|
-
expect(result).toEqual({
|
|
98
|
-
input: 'src/tokens',
|
|
99
|
-
output: 'dist/css',
|
|
100
|
-
format: 'css',
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|