@outwalk/create-firefly 0.14.4 → 0.15.1
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 +12 -5
- package/package.json +6 -6
- package/templates/javascript/.gitignore.template +4 -1
- package/templates/javascript/eslint.config.js.template +2 -1
- package/templates/javascript/jsconfig.json.template +2 -0
- package/templates/javascript/package.json.template +2 -2
- package/templates/javascript/src/index.js.template +1 -1
- package/templates/typescript/.gitignore.template +4 -1
- package/templates/typescript/eslint.config.ts.template +2 -1
- package/templates/typescript/package.json.template +2 -2
- package/templates/typescript/src/index.ts.template +1 -1
- package/templates/typescript/tsconfig.json.template +3 -2
package/dist/index.js
CHANGED
|
@@ -63,7 +63,7 @@ class TemplateBuilder {
|
|
|
63
63
|
for (let key of keys) {
|
|
64
64
|
content = content.replace(new RegExp(`{{${key}}}`, "g"), values[key]);
|
|
65
65
|
}
|
|
66
|
-
return content;
|
|
66
|
+
return content.replace(/\n{3,}/g, "\n\n");
|
|
67
67
|
};
|
|
68
68
|
for (let file of filesToCreate) {
|
|
69
69
|
const originalPath = path.join(src, file);
|
|
@@ -154,7 +154,8 @@ const questions = [
|
|
|
154
154
|
message: "Select a platform:",
|
|
155
155
|
choices: [
|
|
156
156
|
{ title: "Express", value: JSON.stringify(express) },
|
|
157
|
-
{ title: "Hono", value: JSON.stringify(hono) }
|
|
157
|
+
{ title: "Hono", value: JSON.stringify(hono) },
|
|
158
|
+
{ title: "No Platform (Node)", value: null }
|
|
158
159
|
]
|
|
159
160
|
}
|
|
160
161
|
];
|
|
@@ -165,7 +166,7 @@ const questions = [
|
|
|
165
166
|
const force = args["force"];
|
|
166
167
|
const platform = JSON.parse(config.platform);
|
|
167
168
|
const settings = { useCurrentDirectory: false };
|
|
168
|
-
const dependencies = ["@outwalk/firefly", ...platform
|
|
169
|
+
const dependencies = ["@outwalk/firefly", ...platform?.dependencies ?? []];
|
|
169
170
|
if (config.language != "javascript") {
|
|
170
171
|
dependencies.push(config.language);
|
|
171
172
|
}
|
|
@@ -198,8 +199,14 @@ const questions = [
|
|
|
198
199
|
try {
|
|
199
200
|
const template = new TemplateBuilder(templatePath, projectPath);
|
|
200
201
|
template.inject("project-name", config.name);
|
|
201
|
-
template.
|
|
202
|
-
|
|
202
|
+
template.inject("options", !platform ? "" : "{ platform }");
|
|
203
|
+
if (platform) {
|
|
204
|
+
template.snippet("import-platform", path.join(snippetPath, platform.template, "import-platform.template"));
|
|
205
|
+
template.snippet("define-platform", path.join(snippetPath, platform.template, "define-platform.template"));
|
|
206
|
+
} else {
|
|
207
|
+
template.inject("import-platform", "");
|
|
208
|
+
template.inject("define-platform", "");
|
|
209
|
+
}
|
|
203
210
|
template.build();
|
|
204
211
|
} catch (error) {
|
|
205
212
|
logger.error(error.message);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@outwalk/create-firefly",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.15.1",
|
|
5
5
|
"description": "Firefly - a modern scalable web framework.",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -48,13 +48,13 @@
|
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@eslint/js": "^10.0.1",
|
|
51
|
-
"@rollup/plugin-commonjs": "^29.0.
|
|
51
|
+
"@rollup/plugin-commonjs": "^29.0.3",
|
|
52
52
|
"@rollup/plugin-json": "^6.1.0",
|
|
53
53
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
54
|
-
"esbuild": "^0.
|
|
55
|
-
"eslint": "^10.
|
|
56
|
-
"globals": "^17.
|
|
57
|
-
"rollup": "^4.
|
|
54
|
+
"esbuild": "^0.28.2",
|
|
55
|
+
"eslint": "^10.10.0",
|
|
56
|
+
"globals": "^17.12.0",
|
|
57
|
+
"rollup": "^4.63.2",
|
|
58
58
|
"rollup-plugin-esbuild": "^6.2.1"
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -3,5 +3,6 @@ import firefly from "@outwalk/firefly/eslint";
|
|
|
3
3
|
export default {
|
|
4
4
|
files: ["src/**/*.{js,ts}"],
|
|
5
5
|
languageOptions: { ...firefly.configs.language },
|
|
6
|
-
rules: { ...firefly.configs.recommended }
|
|
6
|
+
rules: { ...firefly.configs.recommended },
|
|
7
|
+
plugins: { ...firefly.configs.plugins },
|
|
7
8
|
}
|
|
@@ -3,5 +3,6 @@ import firefly from "@outwalk/firefly/eslint";
|
|
|
3
3
|
export default {
|
|
4
4
|
files: ["src/**/*.{js,ts}"],
|
|
5
5
|
languageOptions: { ...firefly.configs.language },
|
|
6
|
-
rules: { ...firefly.configs.recommended }
|
|
6
|
+
rules: { ...firefly.configs.recommended },
|
|
7
|
+
plugins: { ...firefly.configs.plugins },
|
|
7
8
|
}
|
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
"useDefineForClassFields": true,
|
|
8
8
|
|
|
9
9
|
/* syntax */
|
|
10
|
-
"target": "
|
|
10
|
+
"target": "ES2024",
|
|
11
11
|
"module": "ESNext",
|
|
12
|
-
"lib": ["
|
|
12
|
+
"lib": ["ES2024"],
|
|
13
13
|
"jsx": "preserve",
|
|
14
|
+
"types": ["node"],
|
|
14
15
|
"skipLibCheck": true,
|
|
15
16
|
|
|
16
17
|
/* bundler mode */
|