sprint-es 0.0.97 ā 0.0.98
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/dist/cjs/cli.cjs +5 -1
- package/dist/esm/cli.js +5 -1
- package/package.json +1 -1
package/dist/cjs/cli.cjs
CHANGED
|
@@ -39,6 +39,10 @@ const logger = {
|
|
|
39
39
|
dim: (...args2) => console.log(pc.dim(args2.join(" "))),
|
|
40
40
|
break: () => console.log("")
|
|
41
41
|
};
|
|
42
|
+
function parseJsonc(content) {
|
|
43
|
+
const stripped = content.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/[^\n]*/g, "").replace(/,\s*([}\]])/g, "$1");
|
|
44
|
+
return JSON.parse(stripped);
|
|
45
|
+
}
|
|
42
46
|
if (!command) {
|
|
43
47
|
console.log("\nš Sprint CLI\n");
|
|
44
48
|
console.log("Usage: sprint-es <command>");
|
|
@@ -309,7 +313,7 @@ switch (command) {
|
|
|
309
313
|
const isTS = fs.existsSync(path.join(projectRoot, "sprint.config.ts"));
|
|
310
314
|
if (isTS) {
|
|
311
315
|
const tsconfigPath = path.join(projectRoot, "tsconfig.json");
|
|
312
|
-
const tsconfig =
|
|
316
|
+
const tsconfig = parseJsonc(fs.readFileSync(tsconfigPath, "utf-8"));
|
|
313
317
|
const originalInclude = tsconfig.include ?? [];
|
|
314
318
|
const patched = originalInclude.filter((p) => !p.includes("sprint.config"));
|
|
315
319
|
if (patched.length !== originalInclude.length) {
|
package/dist/esm/cli.js
CHANGED
|
@@ -21,6 +21,10 @@ const logger = {
|
|
|
21
21
|
dim: (...args2) => console.log(pc.dim(args2.join(" "))),
|
|
22
22
|
break: () => console.log("")
|
|
23
23
|
};
|
|
24
|
+
function parseJsonc(content) {
|
|
25
|
+
const stripped = content.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/[^\n]*/g, "").replace(/,\s*([}\]])/g, "$1");
|
|
26
|
+
return JSON.parse(stripped);
|
|
27
|
+
}
|
|
24
28
|
if (!command) {
|
|
25
29
|
console.log("\nš Sprint CLI\n");
|
|
26
30
|
console.log("Usage: sprint-es <command>");
|
|
@@ -291,7 +295,7 @@ switch (command) {
|
|
|
291
295
|
const isTS = existsSync(join(projectRoot, "sprint.config.ts"));
|
|
292
296
|
if (isTS) {
|
|
293
297
|
const tsconfigPath = join(projectRoot, "tsconfig.json");
|
|
294
|
-
const tsconfig =
|
|
298
|
+
const tsconfig = parseJsonc(readFileSync(tsconfigPath, "utf-8"));
|
|
295
299
|
const originalInclude = tsconfig.include ?? [];
|
|
296
300
|
const patched = originalInclude.filter((p) => !p.includes("sprint.config"));
|
|
297
301
|
if (patched.length !== originalInclude.length) {
|