@nooeh/cli 0.2.4 → 0.2.5

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/dist/init.js +10 -5
  2. package/package.json +2 -2
package/dist/init.js CHANGED
@@ -91,16 +91,21 @@ async function writeViteFiles(projectDirectory, tokenDirectory, stylesAlias, ref
91
91
  async function writeNooehFiles(projectDirectory, tokenDirectory, refreshLegacyTokens = false) {
92
92
  await mkdir(tokenDirectory, { recursive: true });
93
93
  for (const file of await getTokenFiles()) {
94
- await writeTokenFile(join(tokenDirectory, file.name), file.content, refreshLegacyTokens && file.name === "semantic.stylex.ts");
94
+ await writeTokenFile(join(tokenDirectory, file.name), file.content, refreshLegacyTokens, file.name);
95
95
  }
96
96
  }
97
- function isLegacySemanticSource(source) {
98
- return source.includes('bgCanvas: "initial"') && source.includes('overlay: "initial"');
97
+ function isLegacyNooehSource(fileName, source) {
98
+ if (fileName === "semantic.stylex.ts") {
99
+ return source.includes('bgCanvas: "initial"') && source.includes('overlay: "initial"');
100
+ }
101
+ return (fileName === "theme-provider.tsx" &&
102
+ source.includes("const styles = stylex.create({") &&
103
+ source.includes("data-theme={resolvedTheme}"));
99
104
  }
100
- async function writeTokenFile(path, source, shouldRefreshLegacyToken) {
105
+ async function writeTokenFile(path, source, shouldRefreshLegacySources, fileName) {
101
106
  try {
102
107
  const currentSource = await readFile(path, "utf8");
103
- if (shouldRefreshLegacyToken && isLegacySemanticSource(currentSource)) {
108
+ if (shouldRefreshLegacySources && isLegacyNooehSource(fileName, currentSource)) {
104
109
  await writeFile(path, source, "utf8");
105
110
  }
106
111
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nooeh/cli",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "nooeh": "./dist/cli.js"
@@ -19,7 +19,7 @@
19
19
  "access": "public"
20
20
  },
21
21
  "dependencies": {
22
- "@nooeh/registry": "0.1.2"
22
+ "@nooeh/registry": "0.1.3"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/node": "^22.20.1",