@design-token-kit/cli 0.1.2 → 0.2.1

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/LICENSE CHANGED
File without changes
package/README.md CHANGED
File without changes
package/bin/index.mjs CHANGED
@@ -89,7 +89,7 @@ function toOutputFormat(format, fallback = "css" /* CSS */) {
89
89
  }
90
90
 
91
91
  // src/commands/convert.ts
92
- var convertCommand = new Command2("convert").description("Convert a token file to DTCG JSON, HRDT YAML, or CSS.").argument("<file>", "Path to a token JSON or HRDT file").option("-i, --inform <format>", "Input format override: dtcg, hrdt").option("-f, --outform <format>", "Output format: dtcg, hrdt, css (default: css)").option("-o, --out <file>", "Output file").action(async (file, options) => {
92
+ var convertCommand = new Command2("convert").description("Convert a token file to DTCG JSON, HRDT YAML, or CSS.").argument("<file>", "Path to a token file").option("-i, --inform [format]", "Input format: dtcg, hrdt (default: auto-detect)").option("-f, --outform [format]", "Output format: dtcg, hrdt, css (default: css)").option("-o, --out [file]", "Output file (default: stdout)").action(async (file, options) => {
93
93
  try {
94
94
  const reader = getReader(options.inform);
95
95
  const content = await new Source(file).getContent();
@@ -158,12 +158,9 @@ var showcaseCommand = new Command3("showcase").description("Create HTML showcase
158
158
  // src/index.ts
159
159
  var packageJsonPath = path2.resolve(path2.dirname(fileURLToPath(import.meta.url)), "../package.json");
160
160
  var packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
161
- var versionArgs = /* @__PURE__ */ new Set(["-v", "--version"]);
162
- if (process.argv.length === 3 && versionArgs.has(process.argv[2])) {
163
- console.log(packageJson.version);
164
- process.exit(0);
165
- }
166
- var program = new Command4().name("dtokens").description("CLI for DTCG JSON and HRDT YAML: validate, convert, showcase.").helpCommand(false).option("-v, --version", "display version").addCommand(validateCommand).addCommand(convertCommand).addCommand(showcaseCommand).addHelpText("after", ({ command }) => command.name() === "dtokens" ? `
161
+ var program = new Command4().name("dtokens").description("CLI for DTCG JSON and HRDT YAML: validate, convert, showcase.").version(packageJson.version, "-v, --version", "display version").addCommand(validateCommand).addCommand(convertCommand).addCommand(showcaseCommand).action(() => {
162
+ program.outputHelp();
163
+ }).addHelpText("after", ({ command }) => command.name() === "dtokens" ? `
167
164
  Examples:
168
165
  $ dtokens validate tokens.json
169
166
  $ dtokens validate tokens.yaml
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@design-token-kit/cli",
3
- "version": "0.1.2",
3
+ "version": "0.2.1",
4
4
  "description": "CLI for Design Token Kit: validate, convert, showcase.",
5
5
  "keywords": [
6
6
  "design-tokens",
@@ -38,10 +38,11 @@
38
38
  },
39
39
  "scripts": {
40
40
  "build": "tsc --noEmit && tsup",
41
- "dist": "node ../scripts/stage-package.mjs cli"
41
+ "dist": "node ../scripts/stage-package.mjs cli",
42
+ "test": "exit 0"
42
43
  },
43
44
  "dependencies": {
44
- "@design-token-kit/core": "0.1.2",
45
+ "@design-token-kit/core": "0.2.1",
45
46
  "commander": "14.0.1"
46
47
  },
47
48
  "devDependencies": {