create-nodality 1.0.85 → 1.0.91
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/bin/index.js +27 -1
- package/package.json +2 -2
- package/release.sh +1 -1
package/bin/index.js
CHANGED
|
@@ -107,12 +107,16 @@ export default {
|
|
|
107
107
|
type: "module",
|
|
108
108
|
scripts: {
|
|
109
109
|
build: "webpack --config webpack.config.js",
|
|
110
|
+
// `prerender` is the SSG step — renders upload/*.html in place
|
|
111
|
+
// from upload/pages/*.js entries. Reads nodality.config.json
|
|
112
|
+
// (scaffolded below) for origin + optional locales/pages.
|
|
113
|
+
prerender: "nodality prerender",
|
|
110
114
|
watch: "webpack --watch --config webpack.config.js",
|
|
111
115
|
start: "live-server . --port=4000 --watch=dist,src",
|
|
112
116
|
dev: "npm-run-all --parallel watch start"
|
|
113
117
|
},
|
|
114
118
|
dependencies: {
|
|
115
|
-
nodality: "
|
|
119
|
+
nodality: "latest"
|
|
116
120
|
},
|
|
117
121
|
devDependencies: {
|
|
118
122
|
"@babel/core": "^7.28.4",
|
|
@@ -128,6 +132,23 @@ export default {
|
|
|
128
132
|
};
|
|
129
133
|
writeFileSync(resolve(projectPath, "package.json"), JSON.stringify(pkg, null, 2));
|
|
130
134
|
|
|
135
|
+
// nodality.config.json — read by `nodality prerender`. Origin is
|
|
136
|
+
// a placeholder the user should change; everything else has a
|
|
137
|
+
// sensible default and can stay out of the file unless overridden.
|
|
138
|
+
// The empty `pages: []` means "auto-discover" (walk upload/*.html
|
|
139
|
+
// and pair with upload/pages/<name>.js or upload/<name>.js). For
|
|
140
|
+
// irregular pairs like `index.html → app.js`, fill in pages
|
|
141
|
+
// explicitly here.
|
|
142
|
+
const nodalityConfig = {
|
|
143
|
+
origin: `https://${projectName}.example.com`,
|
|
144
|
+
uploadDir: "upload",
|
|
145
|
+
tolerateAsyncErrors: false
|
|
146
|
+
};
|
|
147
|
+
writeFileSync(
|
|
148
|
+
resolve(projectPath, "nodality.config.json"),
|
|
149
|
+
JSON.stringify(nodalityConfig, null, 2)
|
|
150
|
+
);
|
|
151
|
+
|
|
131
152
|
console.log("Installing dependencies...");
|
|
132
153
|
execSync(`npm install`, { cwd: projectPath, stdio: "inherit" });
|
|
133
154
|
|
|
@@ -142,8 +163,13 @@ export default {
|
|
|
142
163
|
console.log("\nUsage:\n");
|
|
143
164
|
console.log(` cd ${projectName}`);
|
|
144
165
|
console.log(" npm run build # Rebuild library bundle");
|
|
166
|
+
console.log(" npm run prerender # Prerender static HTML for production (SSG)");
|
|
145
167
|
console.log(" npm run dev # Start dev server with live reload");
|
|
146
168
|
console.log(" npm start # Serve project without watch");
|
|
169
|
+
console.log("");
|
|
170
|
+
console.log(
|
|
171
|
+
` Edit ${color1abc9c}nodality.config.json${reset} to set your public origin before running prerender.`
|
|
172
|
+
);
|
|
147
173
|
}
|
|
148
174
|
|
|
149
175
|
// Get project name from CLI args
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-nodality",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.91",
|
|
4
4
|
"description": "Project scaffolding tool for Nodality library",
|
|
5
5
|
"bin": {
|
|
6
6
|
"create-nodality": "bin/index.js"
|
|
@@ -18,6 +18,6 @@
|
|
|
18
18
|
"author": "Filip Vabrousek",
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"nodality": "
|
|
21
|
+
"nodality": "latest"
|
|
22
22
|
}
|
|
23
23
|
}
|
package/release.sh
CHANGED