@lark-apaas/fullstack-cli 1.1.63-alpha.20260826175639 → 1.1.63-alpha.20260826182714

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": "@lark-apaas/fullstack-cli",
3
- "version": "1.1.63-alpha.20260826175639",
3
+ "version": "1.1.63-alpha.20260826182714",
4
4
  "description": "CLI tool for fullstack template management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -89,9 +89,13 @@ function cleanStaleSwcOutputs(projectRoot) {
89
89
  );
90
90
  const outDir = resolveInsideProject(projectRoot, outDirName);
91
91
  const rootDir = resolveInsideProject(projectRoot, rootDirName);
92
- if (!outDir || !rootDir) {
92
+ if (!outDir) {
93
93
  return 0;
94
94
  }
95
+ const emitRoots = [sourceRoot];
96
+ if (rootDir && rootDir !== sourceRoot) {
97
+ emitRoots.push(rootDir);
98
+ }
95
99
 
96
100
  let removed = 0;
97
101
  const pendingDirectories = [sourceRoot];
@@ -115,35 +119,37 @@ function cleanStaleSwcOutputs(projectRoot) {
115
119
  if (!sourceExtension) {
116
120
  continue;
117
121
  }
118
- const relativeSourcePath = path.relative(rootDir, sourcePath);
119
- if (
120
- relativeSourcePath === '..' ||
121
- relativeSourcePath.startsWith(`..${path.sep}`) ||
122
- path.isAbsolute(relativeSourcePath)
123
- ) {
124
- continue;
125
- }
126
-
127
122
  const outputExtension =
128
123
  sourceExtension === '.mts'
129
124
  ? '.mjs'
130
125
  : sourceExtension === '.cts'
131
126
  ? '.cjs'
132
127
  : '.js';
133
- const outputBasePath = path.join(
134
- outDir,
135
- relativeSourcePath.slice(0, -sourceExtension.length)
136
- );
137
- for (const suffix of [
138
- outputExtension,
139
- `${outputExtension}.map`,
140
- '.d.ts',
141
- '.d.ts.map',
142
- ]) {
143
- const outputPath = `${outputBasePath}${suffix}`;
144
- if (fs.existsSync(outputPath)) {
145
- fs.rmSync(outputPath, { force: true });
146
- removed += 1;
128
+ for (const emitRoot of emitRoots) {
129
+ const relativeSourcePath = path.relative(emitRoot, sourcePath);
130
+ if (
131
+ relativeSourcePath === '..' ||
132
+ relativeSourcePath.startsWith(`..${path.sep}`) ||
133
+ path.isAbsolute(relativeSourcePath)
134
+ ) {
135
+ continue;
136
+ }
137
+
138
+ const outputBasePath = path.join(
139
+ outDir,
140
+ relativeSourcePath.slice(0, -sourceExtension.length)
141
+ );
142
+ for (const suffix of [
143
+ outputExtension,
144
+ `${outputExtension}.map`,
145
+ '.d.ts',
146
+ '.d.ts.map',
147
+ ]) {
148
+ const outputPath = `${outputBasePath}${suffix}`;
149
+ if (fs.existsSync(outputPath)) {
150
+ fs.rmSync(outputPath, { force: true });
151
+ removed += 1;
152
+ }
147
153
  }
148
154
  }
149
155
  }