forked from digdir/designsystemet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add the @digir/create-tokens CLI tool
- Loading branch information
Showing
27 changed files
with
4,599 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
root: false, | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env node | ||
|
||
import { require } from 'tsx/cjs/api'; | ||
|
||
require('./src/bin/create-tokens.ts', import.meta.url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"name": "@digdir/create-tokens", | ||
"version": "0.1.0-alpha.7", | ||
"description": "CLI tool to create an initial token structure for Designsystemet", | ||
"author": "Designsystemet team", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/digdir/designsystemet.git" | ||
}, | ||
"homepage": "https://github.com/digdir/designsystemet/tree/main/packages/create-tokens", | ||
"license": "MIT", | ||
"type": "module", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"main": "index.js", | ||
"bin": "index.js", | ||
"scripts": { | ||
"start": "node index.js" | ||
}, | ||
"dependencies": { | ||
"@commander-js/extra-typings": "^12.0.1", | ||
"change-case": "^5.3.0", | ||
"commander": "^12.0.0", | ||
"kleur": "^3.0.3", | ||
"prompts": "^2.4.0", | ||
"tsx": "^4.11.2" | ||
}, | ||
"devDependencies": { | ||
"@tokens-studio/types": "^0.4.0", | ||
"@types/prompts": "^2.4.9" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Argument, program } from '@commander-js/extra-typings'; | ||
|
||
import { createTokensPackage } from '../createTokensPackage'; | ||
|
||
program | ||
.name('npm create @digdir/tokens') | ||
.description( | ||
'CLI tool to create an initial token structure for Designsystemet', | ||
); | ||
|
||
program | ||
.addArgument( | ||
new Argument('<targetDir>', 'Target directory for the generated code'), | ||
) | ||
.action(async (targetDir) => { | ||
await createTokensPackage(targetDir); | ||
}); | ||
|
||
program.showHelpAfterError(); | ||
|
||
void program.parseAsync(process.argv); |
Oops, something went wrong.