@motion-proto/live-tokens 0.21.1 → 0.21.2

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.
Files changed (2) hide show
  1. package/bin/create.mjs +10 -0
  2. package/package.json +2 -1
package/bin/create.mjs CHANGED
@@ -11,6 +11,7 @@ import {
11
11
  writeFileSync,
12
12
  } from 'node:fs';
13
13
  import { dirname, join, resolve } from 'node:path';
14
+ import { fileURLToPath } from 'node:url';
14
15
 
15
16
  // npm strips dotfiles from published tarballs, so the template ships them
16
17
  // renamed; `create` restores the leading dot on scaffold.
@@ -87,3 +88,12 @@ export function formatCreateResult({ appName, targetDir }, targetArg) {
87
88
  `Then open http://localhost:5173 and edit src/pages/Home.svelte.`,
88
89
  ].join('\n');
89
90
  }
91
+
92
+ // Entry point for the `@motion-proto/create-live-tokens` initializer: it
93
+ // derives pkgRoot from this module's own location (i.e. wherever this package
94
+ // is installed), so the template + seed CSS always come from this exact
95
+ // version. The initializer stays a thin shim with no template of its own.
96
+ export function createApp({ targetDir, force = false } = {}) {
97
+ const pkgRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
98
+ return runCreate({ targetDir, pkgRoot, force });
99
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motion-proto/live-tokens",
3
- "version": "0.21.1",
3
+ "version": "0.21.2",
4
4
  "type": "module",
5
5
  "description": "Design token editor with live CSS variable editing. Svelte 5 + Vite 8.",
6
6
  "keywords": [
@@ -42,6 +42,7 @@
42
42
  "types": "./src/editor/index.ts",
43
43
  "default": "./src/editor/index.ts"
44
44
  },
45
+ "./create": "./bin/create.mjs",
45
46
  "./component-editor": {
46
47
  "svelte": "./src/editor/component-editor/index.ts",
47
48
  "types": "./src/editor/component-editor/index.ts",