create-jant 0.1.18 → 0.1.20
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/src/index.ts +8 -13
- package/template/tsconfig.json +33 -5
- package/template/vite.config.ts +9 -0
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.17";
|
|
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.20",
|
|
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/src/index.ts
CHANGED
|
@@ -2,29 +2,24 @@
|
|
|
2
2
|
* Jant Site Entry Point
|
|
3
3
|
*
|
|
4
4
|
* This is the main entry point for your Jant site.
|
|
5
|
-
*
|
|
5
|
+
*
|
|
6
|
+
* Configuration:
|
|
7
|
+
* - Site settings (name, description, language) should be configured via
|
|
8
|
+
* environment variables in wrangler.toml or .dev.vars:
|
|
9
|
+
* SITE_NAME, SITE_DESCRIPTION, SITE_LANGUAGE
|
|
10
|
+
* - Alternatively, you can set them in the dashboard (they will be stored in DB)
|
|
11
|
+
* - Priority: Environment Variables > Database > Defaults
|
|
6
12
|
*/
|
|
7
13
|
|
|
8
14
|
import { createApp } from "@jant/core";
|
|
9
15
|
|
|
10
16
|
export default createApp({
|
|
11
|
-
// Site configuration (optional - can also be set in dashboard)
|
|
12
|
-
// site: {
|
|
13
|
-
// name: "My Blog",
|
|
14
|
-
// description: "A personal blog powered by Jant",
|
|
15
|
-
// language: "en",
|
|
16
|
-
// },
|
|
17
17
|
// Theme customization (optional)
|
|
18
|
+
// Use this for UI/component overrides that need to be compiled into your build
|
|
18
19
|
// theme: {
|
|
19
20
|
// components: {
|
|
20
21
|
// // Override components here
|
|
21
22
|
// // PostCard: MyPostCard,
|
|
22
23
|
// },
|
|
23
24
|
// },
|
|
24
|
-
// Feature toggles (optional)
|
|
25
|
-
// features: {
|
|
26
|
-
// search: true,
|
|
27
|
-
// rss: true,
|
|
28
|
-
// sitemap: true,
|
|
29
|
-
// },
|
|
30
25
|
});
|
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
|
}
|
package/template/vite.config.ts
CHANGED
|
@@ -121,6 +121,15 @@ export default defineConfig({
|
|
|
121
121
|
port: 9019,
|
|
122
122
|
},
|
|
123
123
|
|
|
124
|
+
// Exclude @lingui/react from dependency optimization
|
|
125
|
+
// Why: Source code uses `@lingui/react/macro` (for Lingui SWC plugin recognition),
|
|
126
|
+
// but SWC rewrites imports to `@jant/core/i18n` at compile time (see runtimeModules config).
|
|
127
|
+
// Vite's dependency scanner sees the source imports and warns about missing @lingui/react.
|
|
128
|
+
// This is harmless but causes multiple reloads. Excluding prevents the warning.
|
|
129
|
+
optimizeDeps: {
|
|
130
|
+
exclude: ["@lingui/react"],
|
|
131
|
+
},
|
|
132
|
+
|
|
124
133
|
environments: {
|
|
125
134
|
client: {
|
|
126
135
|
build: {
|