create-jant 0.1.17 → 0.1.19
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/index.js +1 -23
- package/package.json +2 -1
- package/template/tsconfig.json +33 -5
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import path from "path";
|
|
|
8
8
|
import { fileURLToPath } from "url";
|
|
9
9
|
var __filename = fileURLToPath(import.meta.url);
|
|
10
10
|
var __dirname = path.dirname(__filename);
|
|
11
|
-
var CORE_VERSION = "0.2.
|
|
11
|
+
var CORE_VERSION = "0.2.16";
|
|
12
12
|
var TEMPLATE_DIR = fs.existsSync(path.resolve(__dirname, "../template")) ? path.resolve(__dirname, "../template") : path.resolve(__dirname, "../../../templates/jant-site");
|
|
13
13
|
function isValidProjectName(name) {
|
|
14
14
|
return /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(name);
|
|
@@ -93,28 +93,6 @@ AUTH_SECRET=${authSecret}
|
|
|
93
93
|
);
|
|
94
94
|
await fs.writeFile(viteConfigPath, content, "utf-8");
|
|
95
95
|
}
|
|
96
|
-
const tsconfigPath = path.join(targetDir, "tsconfig.json");
|
|
97
|
-
if (await fs.pathExists(tsconfigPath)) {
|
|
98
|
-
const tsconfig = await fs.readJson(tsconfigPath);
|
|
99
|
-
if (tsconfig.extends) {
|
|
100
|
-
const rootTsconfigPath = path.resolve(
|
|
101
|
-
TEMPLATE_DIR,
|
|
102
|
-
"../../tsconfig.json"
|
|
103
|
-
);
|
|
104
|
-
if (await fs.pathExists(rootTsconfigPath)) {
|
|
105
|
-
const rootTsconfig = await fs.readJson(rootTsconfigPath);
|
|
106
|
-
const merged = {
|
|
107
|
-
compilerOptions: {
|
|
108
|
-
...rootTsconfig.compilerOptions,
|
|
109
|
-
...tsconfig.compilerOptions
|
|
110
|
-
},
|
|
111
|
-
include: tsconfig.include,
|
|
112
|
-
exclude: tsconfig.exclude
|
|
113
|
-
};
|
|
114
|
-
await fs.writeJson(tsconfigPath, merged, { spaces: 2 });
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
96
|
}
|
|
119
97
|
async function main() {
|
|
120
98
|
console.log();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-jant",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
4
|
"description": "Create a new Jant project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"dev": "tsup src/index.ts --format esm --watch",
|
|
55
55
|
"typecheck": "tsc --noEmit",
|
|
56
56
|
"copy-template": "rm -rf template && cp -r ../../templates/jant-site template",
|
|
57
|
+
"prepare-template": "node scripts/prepare-template.js",
|
|
57
58
|
"inject-version": "node -e \"const fs=require('fs');const v=require('../core/package.json').version;const f='dist/index.js';fs.writeFileSync(f,fs.readFileSync(f,'utf8').replace('__JANT_CORE_VERSION__',v))\""
|
|
58
59
|
}
|
|
59
60
|
}
|
package/template/tsconfig.json
CHANGED
|
@@ -1,11 +1,39 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": "../../tsconfig.json",
|
|
3
2
|
"compilerOptions": {
|
|
4
|
-
"
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"lib": [
|
|
7
|
+
"ES2022"
|
|
8
|
+
],
|
|
9
|
+
"strict": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"noEmit": true,
|
|
12
|
+
"esModuleInterop": true,
|
|
13
|
+
"resolveJsonModule": true,
|
|
14
|
+
"isolatedModules": true,
|
|
15
|
+
"verbatimModuleSyntax": true,
|
|
16
|
+
"noUncheckedIndexedAccess": true,
|
|
17
|
+
"noImplicitOverride": true,
|
|
18
|
+
"forceConsistentCasingInFileNames": true,
|
|
19
|
+
"jsx": "react-jsx",
|
|
20
|
+
"jsxImportSource": "hono/jsx",
|
|
21
|
+
"types": [
|
|
22
|
+
"@cloudflare/workers-types",
|
|
23
|
+
"vite/client"
|
|
24
|
+
],
|
|
5
25
|
"paths": {
|
|
6
|
-
"@/*": [
|
|
26
|
+
"@/*": [
|
|
27
|
+
"./src/*"
|
|
28
|
+
]
|
|
7
29
|
}
|
|
8
30
|
},
|
|
9
|
-
"include": [
|
|
10
|
-
|
|
31
|
+
"include": [
|
|
32
|
+
"src/**/*",
|
|
33
|
+
"vite.config.ts"
|
|
34
|
+
],
|
|
35
|
+
"exclude": [
|
|
36
|
+
"node_modules",
|
|
37
|
+
"dist"
|
|
38
|
+
]
|
|
11
39
|
}
|