@astryxdesign/cli 0.1.4-canary.032e639 → 0.1.4-canary.088ca43
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.1.4-canary.
|
|
3
|
+
"version": "0.1.4-canary.088ca43",
|
|
4
4
|
"displayName": "CLI",
|
|
5
5
|
"description": "Scaffold projects, browse templates, generate themes, and get agent-ready docs from the command line.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -75,10 +75,10 @@
|
|
|
75
75
|
"zod": "^4.4.3"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
|
-
"@astryxdesign/charts": "0.1.4-canary.
|
|
79
|
-
"@astryxdesign/core": "0.1.4-canary.
|
|
80
|
-
"@astryxdesign/lab": "0.1.4-canary.
|
|
81
|
-
"@astryxdesign/theme-neutral": "0.1.4-canary.
|
|
78
|
+
"@astryxdesign/charts": "0.1.4-canary.088ca43",
|
|
79
|
+
"@astryxdesign/core": "0.1.4-canary.088ca43",
|
|
80
|
+
"@astryxdesign/lab": "0.1.4-canary.088ca43",
|
|
81
|
+
"@astryxdesign/theme-neutral": "0.1.4-canary.088ca43",
|
|
82
82
|
"gpt-tokenizer": "^3.4.0"
|
|
83
83
|
},
|
|
84
84
|
"peerDependenciesMeta": {
|
|
@@ -96,10 +96,10 @@
|
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
|
-
"@astryxdesign/charts": "0.1.4-canary.
|
|
100
|
-
"@astryxdesign/core": "0.1.4-canary.
|
|
101
|
-
"@astryxdesign/lab": "0.1.4-canary.
|
|
102
|
-
"@astryxdesign/theme-neutral": "0.1.4-canary.
|
|
99
|
+
"@astryxdesign/charts": "0.1.4-canary.088ca43",
|
|
100
|
+
"@astryxdesign/core": "0.1.4-canary.088ca43",
|
|
101
|
+
"@astryxdesign/lab": "0.1.4-canary.088ca43",
|
|
102
|
+
"@astryxdesign/theme-neutral": "0.1.4-canary.088ca43",
|
|
103
103
|
"gpt-tokenizer": "^3.4.0"
|
|
104
104
|
},
|
|
105
105
|
"scripts": {
|
|
@@ -99,5 +99,43 @@ describe('runCodemods — unified config codemod path', () => {
|
|
|
99
99
|
expect(fs.readFileSync(path.join(srcDir, 'a.ts'), 'utf-8')).toContain(
|
|
100
100
|
'const bar = 1',
|
|
101
101
|
);
|
|
102
|
+
// writtenFiles must be returned (consumed by upgrade.mjs to run the
|
|
103
|
+
// post-codemod formatting/lint hooks). Regression guard: it was previously
|
|
104
|
+
// built internally but omitted from the return object, so hooks received an
|
|
105
|
+
// empty file list and silently skipped, leaving codemod output unformatted.
|
|
106
|
+
expect(result.writtenFiles).toEqual([path.join(srcDir, 'a.ts')]);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it('returns writtenFiles for every changed file (post-codemod hook input)', async () => {
|
|
110
|
+
const srcDir = path.join(tmpDir, 'src');
|
|
111
|
+
fs.mkdirSync(srcDir);
|
|
112
|
+
fs.writeFileSync(path.join(srcDir, 'a.ts'), 'const foo = 1;\n');
|
|
113
|
+
fs.writeFileSync(path.join(srcDir, 'b.ts'), 'const foo = 2;\n');
|
|
114
|
+
fs.writeFileSync(path.join(srcDir, 'c.ts'), 'const untouched = 3;\n');
|
|
115
|
+
|
|
116
|
+
const versionManifests = [
|
|
117
|
+
{
|
|
118
|
+
version: '0.1.3',
|
|
119
|
+
transforms: [
|
|
120
|
+
{
|
|
121
|
+
name: 'synthetic-code-codemod',
|
|
122
|
+
meta: {title: 'Synthetic code codemod'},
|
|
123
|
+
transform: file => file.source.replace(/foo/g, 'bar'),
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
];
|
|
128
|
+
|
|
129
|
+
const result = await runCodemods(versionManifests, {
|
|
130
|
+
apply: true,
|
|
131
|
+
path: './src',
|
|
132
|
+
silent: true,
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
expect(result.totalFilesChanged).toBe(2);
|
|
136
|
+
// Only the two files that actually changed are reported (not c.ts).
|
|
137
|
+
expect([...result.writtenFiles].sort()).toEqual(
|
|
138
|
+
[path.join(srcDir, 'a.ts'), path.join(srcDir, 'b.ts')].sort(),
|
|
139
|
+
);
|
|
102
140
|
});
|
|
103
141
|
});
|
package/src/codemods/runner.mjs
CHANGED
|
@@ -178,6 +178,7 @@ function toUnifiedEntry(transformEntry, version) {
|
|
|
178
178
|
* @param {string|undefined} options.codemod - Run only this specific transform
|
|
179
179
|
* @param {Set<string>} [options.skipCodemods] - Transform names to exclude
|
|
180
180
|
* @param {boolean} [options.silent] - Suppress all human-facing output (for --json)
|
|
181
|
+
* @returns {{totalFilesChanged: number, totalTransformsApplied: number, totalValidationBlocked: number, writtenFiles: string[], errors: Array, skippedOptional: Array}}
|
|
181
182
|
*/
|
|
182
183
|
export async function runCodemods(
|
|
183
184
|
versionManifests,
|
|
@@ -405,6 +406,7 @@ export async function runCodemods(
|
|
|
405
406
|
totalFilesChanged,
|
|
406
407
|
totalTransformsApplied,
|
|
407
408
|
totalValidationBlocked,
|
|
409
|
+
writtenFiles,
|
|
408
410
|
errors,
|
|
409
411
|
skippedOptional,
|
|
410
412
|
};
|