@lucaismyname/create-l1-stack 0.1.5 → 0.1.7
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 +1 -1
- package/src/index.js +21 -8
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -863,14 +863,27 @@ async function applyTesting(targetDir) {
|
|
|
863
863
|
|
|
864
864
|
const tsconfigAppPath = path.join(targetDir, 'tsconfig.app.json')
|
|
865
865
|
try {
|
|
866
|
-
const
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
if (!
|
|
872
|
-
|
|
873
|
-
|
|
866
|
+
const src = await fs.readFile(tsconfigAppPath, 'utf8')
|
|
867
|
+
let next = src
|
|
868
|
+
|
|
869
|
+
// tsconfig.app.json is JSONC (comments), so patch it as text.
|
|
870
|
+
// Ensure vitest globals are available for test/expect typing.
|
|
871
|
+
if (!next.includes('vitest/globals')) {
|
|
872
|
+
next = next.replace(
|
|
873
|
+
/"types"\s*:\s*\[\s*"vite\/client"\s*\]/m,
|
|
874
|
+
'"types": ["vite/client", "vitest/globals"]'
|
|
875
|
+
)
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
// Ensure tests are not part of the build typecheck.
|
|
879
|
+
if (!/\"exclude\"\s*:/m.test(next)) {
|
|
880
|
+
next = next.replace(
|
|
881
|
+
/\n\}\s*\n?$/m,
|
|
882
|
+
`,\n "exclude": [\n "src/**/*.{test,spec}.ts",\n "src/**/*.{test,spec}.tsx",\n "src/test/**"\n ]\n}\n`
|
|
883
|
+
)
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
if (next !== src) await fs.writeFile(tsconfigAppPath, next, 'utf8')
|
|
874
887
|
} catch {
|
|
875
888
|
// ignore
|
|
876
889
|
}
|