create-lupine 1.0.15 → 1.0.17
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/index.js +35 -6
- package/package.json +1 -1
- package/templates/common/AI_CONTEXT.md +565 -523
- package/templates/common/tsconfig.json +128 -0
- package/templates/{cv-starter → lupine-template-cv-starter}/api/package.json +6 -6
- package/templates/{doc-starter/api/src → lupine-template-cv-starter/api}/resources/config_default.json +6 -6
- package/templates/{cv-starter → lupine-template-cv-starter}/lupine.json +6 -6
- package/templates/{doc-starter → lupine-template-cv-starter}/web/package.json +6 -6
- package/templates/{doc-starter → lupine-template-cv-starter}/web/src/client-env-keys.ts +5 -5
- package/templates/{doc-starter/web/github-pj-name → lupine-template-cv-starter/web/src/lupine-template-cv-starter}/404.html +8 -5
- package/templates/lupine-template-cv-starter/web/src/lupine-template-cv-starter/assets/og-image.png +0 -0
- package/templates/lupine-template-cv-starter/web/src/lupine-template-cv-starter/index.html +73 -0
- package/templates/{cv-starter/web/github-pj-name → lupine-template-cv-starter/web/src/lupine-template-cv-starter}/index.tsx +5 -5
- package/templates/{cv-starter → lupine-template-cv-starter}/web/src/markdown-built/en/01-experience/index.html +20 -20
- package/templates/{cv-starter → lupine-template-cv-starter}/web/src/markdown-built/en/02-projects/index.html +28 -28
- package/templates/{cv-starter → lupine-template-cv-starter}/web/src/markdown-built/en/03-skills/index.html +18 -18
- package/templates/{cv-starter → lupine-template-cv-starter}/web/src/markdown-built/en/04-education/index.html +10 -10
- package/templates/{cv-starter → lupine-template-cv-starter}/web/src/markdown-built/en/index.html +20 -20
- package/templates/{cv-starter → lupine-template-cv-starter}/web/src/markdown-built/zh/01-experience/index.html +20 -20
- package/templates/{cv-starter → lupine-template-cv-starter}/web/src/markdown-built/zh/02-projects/index.html +28 -28
- package/templates/{cv-starter → lupine-template-cv-starter}/web/src/markdown-built/zh/03-skills/index.html +18 -18
- package/templates/{cv-starter → lupine-template-cv-starter}/web/src/markdown-built/zh/04-education/index.html +11 -11
- package/templates/{cv-starter → lupine-template-cv-starter}/web/src/markdown-built/zh/index.html +20 -20
- package/templates/{cv-starter → lupine-template-cv-starter}/web/src/styles/base-css.ts +15 -15
- package/templates/lupine-template-doc-starter/api/package.json +6 -0
- package/templates/{hello-world → lupine-template-doc-starter}/api/resources/config_default.json +6 -6
- package/templates/lupine-template-doc-starter/api/src/resources/config_default.json +6 -0
- package/templates/{doc-starter → lupine-template-doc-starter}/lupine.json +9 -4
- package/templates/lupine-template-doc-starter/web/package.json +6 -0
- package/templates/{cv-starter → lupine-template-doc-starter}/web/src/client-env-keys.ts +5 -5
- package/templates/lupine-template-doc-starter/web/src/lupine-template-doc-starter/404.html +38 -0
- package/templates/{cv-starter/web/src → lupine-template-doc-starter/web/src/lupine-template-doc-starter}/index.html +13 -2
- package/templates/{doc-starter/web/github-pj-name → lupine-template-doc-starter/web/src/lupine-template-doc-starter}/index.tsx +5 -5
- package/templates/{doc-starter → lupine-template-doc-starter}/web/src/markdown-built/en/essentials/list.html +8 -8
- package/templates/{doc-starter → lupine-template-doc-starter}/web/src/markdown-built/en/guide/install.html +8 -8
- package/templates/{doc-starter → lupine-template-doc-starter}/web/src/markdown-built/en/guide/started.html +12 -12
- package/templates/{doc-starter → lupine-template-doc-starter}/web/src/markdown-built/zh/essentials/list.html +8 -8
- package/templates/{doc-starter → lupine-template-doc-starter}/web/src/markdown-built/zh/guide/install.html +8 -8
- package/templates/{doc-starter → lupine-template-doc-starter}/web/src/markdown-built/zh/guide/started.html +12 -12
- package/templates/{doc-starter → lupine-template-doc-starter}/web/src/styles/base-css.ts +15 -15
- package/templates/{cv-starter/web → lupine-template-responsive-starter/api}/package.json +1 -1
- package/templates/lupine-template-responsive-starter/lupine.json +33 -0
- package/templates/{doc-starter/api → lupine-template-responsive-starter/web}/package.json +1 -1
- package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/app-icons.ts +4 -0
- package/templates/{cv-starter/web/github-pj-name → lupine-template-responsive-starter/web/src/lupine-template-responsive-starter}/404.html +4 -4
- package/templates/lupine-template-responsive-starter/web/src/lupine-template-responsive-starter/assets/favicon.ico +0 -0
- package/templates/lupine-template-responsive-starter/web/src/lupine-template-responsive-starter/assets/og-image.png +0 -0
- package/templates/lupine-template-responsive-starter/web/src/lupine-template-responsive-starter/index.html +49 -0
- package/templates/lupine-template-responsive-starter/web/src/lupine-template-responsive-starter/index.tsx +35 -0
- package/templates/hello-world/web/src/index.html +0 -16
- package/templates/responsive-starter/api/package.json +0 -6
- package/templates/responsive-starter/api/resources/config_default.json +0 -6
- package/templates/responsive-starter/lupine.json +0 -23
- package/templates/responsive-starter/web/package.json +0 -6
- /package/templates/{cv-starter → lupine-template-cv-starter}/api/resources/install.sqlite.sql +0 -0
- /package/templates/{cv-starter → lupine-template-cv-starter}/api/src/index.ts +0 -0
- /package/templates/{cv-starter → lupine-template-cv-starter}/web/assets/favicon.ico +0 -0
- /package/templates/{cv-starter → lupine-template-cv-starter}/web/markdown/en/01-experience/index.md +0 -0
- /package/templates/{cv-starter → lupine-template-cv-starter}/web/markdown/en/02-projects/index.md +0 -0
- /package/templates/{cv-starter → lupine-template-cv-starter}/web/markdown/en/03-skills/index.md +0 -0
- /package/templates/{cv-starter → lupine-template-cv-starter}/web/markdown/en/04-education/index.md +0 -0
- /package/templates/{cv-starter → lupine-template-cv-starter}/web/markdown/en/index.md +0 -0
- /package/templates/{cv-starter → lupine-template-cv-starter}/web/markdown/index.md +0 -0
- /package/templates/{cv-starter → lupine-template-cv-starter}/web/markdown/zh/01-experience/index.md +0 -0
- /package/templates/{cv-starter → lupine-template-cv-starter}/web/markdown/zh/02-projects/index.md +0 -0
- /package/templates/{cv-starter → lupine-template-cv-starter}/web/markdown/zh/03-skills/index.md +0 -0
- /package/templates/{cv-starter → lupine-template-cv-starter}/web/markdown/zh/04-education/index.md +0 -0
- /package/templates/{cv-starter → lupine-template-cv-starter}/web/markdown/zh/index.md +0 -0
- /package/templates/{cv-starter/web/github-pj-name → lupine-template-cv-starter/web/src}/index.html +0 -0
- /package/templates/{cv-starter → lupine-template-cv-starter}/web/src/index.tsx +0 -0
- /package/templates/{cv-starter/web/github-pj-name → lupine-template-cv-starter/web/src/lupine-template-cv-starter}/assets/favicon.ico +0 -0
- /package/templates/{cv-starter → lupine-template-cv-starter}/web/src/markdown-built/index.html +0 -0
- /package/templates/{cv-starter → lupine-template-cv-starter}/web/src/markdown-built/markdown-config.ts +0 -0
- /package/templates/{doc-starter → lupine-template-doc-starter}/api/resources/install.sqlite.sql +0 -0
- /package/templates/{doc-starter → lupine-template-doc-starter}/api/src/index.ts +0 -0
- /package/templates/{doc-starter → lupine-template-doc-starter}/api/src/resources/install.sqlite.sql +0 -0
- /package/templates/{doc-starter → lupine-template-doc-starter}/web/assets/favicon.ico +0 -0
- /package/templates/{doc-starter → lupine-template-doc-starter}/web/markdown/en/essentials/index.md +0 -0
- /package/templates/{doc-starter → lupine-template-doc-starter}/web/markdown/en/essentials/list.md +0 -0
- /package/templates/{doc-starter → lupine-template-doc-starter}/web/markdown/en/guide/install.md +0 -0
- /package/templates/{doc-starter → lupine-template-doc-starter}/web/markdown/en/guide/started.md +0 -0
- /package/templates/{doc-starter → lupine-template-doc-starter}/web/markdown/en/index.md +0 -0
- /package/templates/{doc-starter → lupine-template-doc-starter}/web/markdown/index.md +0 -0
- /package/templates/{doc-starter → lupine-template-doc-starter}/web/markdown/zh/essentials/index.md +0 -0
- /package/templates/{doc-starter → lupine-template-doc-starter}/web/markdown/zh/essentials/list.md +0 -0
- /package/templates/{doc-starter → lupine-template-doc-starter}/web/markdown/zh/guide/install.md +0 -0
- /package/templates/{doc-starter → lupine-template-doc-starter}/web/markdown/zh/guide/started.md +0 -0
- /package/templates/{doc-starter → lupine-template-doc-starter}/web/markdown/zh/index.md +0 -0
- /package/templates/{doc-starter/web/github-pj-name → lupine-template-doc-starter/web/src}/index.html +0 -0
- /package/templates/{doc-starter → lupine-template-doc-starter}/web/src/index.tsx +0 -0
- /package/templates/{doc-starter/web/github-pj-name → lupine-template-doc-starter/web/src/lupine-template-doc-starter}/assets/favicon.ico +0 -0
- /package/templates/{doc-starter → lupine-template-doc-starter}/web/src/markdown-built/en/essentials/index.html +0 -0
- /package/templates/{doc-starter → lupine-template-doc-starter}/web/src/markdown-built/en/index.html +0 -0
- /package/templates/{doc-starter → lupine-template-doc-starter}/web/src/markdown-built/index.html +0 -0
- /package/templates/{doc-starter → lupine-template-doc-starter}/web/src/markdown-built/markdown-config.ts +0 -0
- /package/templates/{doc-starter → lupine-template-doc-starter}/web/src/markdown-built/zh/essentials/index.html +0 -0
- /package/templates/{doc-starter → lupine-template-doc-starter}/web/src/markdown-built/zh/index.html +0 -0
- /package/templates/{hello-world → lupine-template-hello-world}/api/package.json +0 -0
- /package/templates/{cv-starter → lupine-template-hello-world}/api/resources/config_default.json +0 -0
- /package/templates/{hello-world → lupine-template-hello-world}/api/resources/install.sqlite.sql +0 -0
- /package/templates/{hello-world → lupine-template-hello-world}/api/src/index.ts +0 -0
- /package/templates/{hello-world → lupine-template-hello-world}/api/src/service/root-api.ts +0 -0
- /package/templates/{hello-world → lupine-template-hello-world}/lupine.json +0 -0
- /package/templates/{hello-world → lupine-template-hello-world}/web/assets/favicon.ico +0 -0
- /package/templates/{hello-world → lupine-template-hello-world}/web/package.json +0 -0
- /package/templates/{doc-starter → lupine-template-hello-world}/web/src/index.html +0 -0
- /package/templates/{hello-world → lupine-template-hello-world}/web/src/index.tsx +0 -0
- /package/templates/{hello-world → lupine-template-hello-world}/web/src/styles/app.css +0 -0
- /package/templates/{hello-world → lupine-template-hello-world}/web/src/styles/base-css.ts +0 -0
- /package/templates/{hello-world → lupine-template-hello-world}/web/src/styles/global.css +0 -0
- /package/templates/{hello-world → lupine-template-hello-world}/web/src/styles/theme.ts +0 -0
- /package/templates/{doc-starter → lupine-template-responsive-starter}/api/resources/config_default.json +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/api/resources/install.sqlite.sql +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/api/src/index.ts +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/api/src/service/root-api.ts +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/assets/favicon.ico +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/components/input-history-component.tsx +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/components/mine-about-page.tsx +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/components/mine-premium-page.tsx +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/components/mine-settings-page.tsx +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/components/mobile-top-search-menu.tsx +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/components/note-detail.tsx +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/components/note-edit.tsx +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/components/note-search-page.tsx +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/components/search-input.tsx +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/components/side-menu-content.tsx +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/frames/app-responsive-frame.tsx +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/index.html +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/index.tsx +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/pages/about-page.tsx +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/pages/finance-page.tsx +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/pages/home-page.tsx +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/pages/mine-page.tsx +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/pages/tools-page.tsx +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/services/local-notes-service.ts +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/services/mine-service.ts +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/styles/app.css +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/styles/base-css.ts +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/styles/global.css +0 -0
- /package/templates/{responsive-starter → lupine-template-responsive-starter}/web/src/styles/theme.ts +0 -0
package/index.js
CHANGED
|
@@ -54,12 +54,14 @@ const cwd = process.cwd();
|
|
|
54
54
|
const TEMPLATES = [
|
|
55
55
|
{
|
|
56
56
|
name: 'hello-world',
|
|
57
|
+
dir: 'lupine-template-hello-world',
|
|
57
58
|
display: 'Hello World',
|
|
58
59
|
itemType: 'frontend',
|
|
59
60
|
color: green,
|
|
60
61
|
},
|
|
61
62
|
{
|
|
62
63
|
name: 'doc-starter',
|
|
64
|
+
dir: 'lupine-template-doc-starter',
|
|
63
65
|
display: 'Documentation Starter',
|
|
64
66
|
itemType: 'frontend',
|
|
65
67
|
color: green,
|
|
@@ -67,6 +69,7 @@ const TEMPLATES = [
|
|
|
67
69
|
},
|
|
68
70
|
{
|
|
69
71
|
name: 'cv-starter',
|
|
72
|
+
dir: 'lupine-template-cv-starter',
|
|
70
73
|
display: 'CV Starter',
|
|
71
74
|
itemType: 'frontend',
|
|
72
75
|
color: green,
|
|
@@ -74,7 +77,7 @@ const TEMPLATES = [
|
|
|
74
77
|
},
|
|
75
78
|
{
|
|
76
79
|
name: 'responsive-starter-tabs',
|
|
77
|
-
dir: 'responsive-starter',
|
|
80
|
+
dir: 'lupine-template-responsive-starter',
|
|
78
81
|
layout: 'tabs',
|
|
79
82
|
display: 'Responsive Starter (tabs)',
|
|
80
83
|
itemType: 'frontend',
|
|
@@ -82,7 +85,7 @@ const TEMPLATES = [
|
|
|
82
85
|
},
|
|
83
86
|
{
|
|
84
87
|
name: 'responsive-starter-sidemenu',
|
|
85
|
-
dir: 'responsive-starter',
|
|
88
|
+
dir: 'lupine-template-responsive-starter',
|
|
86
89
|
layout: 'sidemenu',
|
|
87
90
|
display: 'Responsive Starter (sidemenu)',
|
|
88
91
|
itemType: 'frontend',
|
|
@@ -174,16 +177,42 @@ async function init() {
|
|
|
174
177
|
const appName = path.basename(root);
|
|
175
178
|
const targetAppDir = path.join(appsDir, appName);
|
|
176
179
|
|
|
180
|
+
function replaceStr(filepath, fromToArr) {
|
|
181
|
+
let content = fs.readFileSync(filepath, 'utf-8');
|
|
182
|
+
for (const { from, to } of fromToArr) {
|
|
183
|
+
content = content.replace(new RegExp(from, 'g'), to);
|
|
184
|
+
}
|
|
185
|
+
fs.writeFileSync(filepath, content);
|
|
186
|
+
}
|
|
187
|
+
|
|
177
188
|
copyDir(templateDir, targetAppDir);
|
|
189
|
+
// if templateDir\web\src\appName exists, rename it to github-pj-name
|
|
190
|
+
const githubName = path.join(targetAppDir, `web/src/${templateObj?.dir}`);
|
|
191
|
+
if (templateObj?.dir && fs.existsSync(githubName)) {
|
|
192
|
+
fs.renameSync(githubName, path.join(targetAppDir, 'web/src/github-pj-name'));
|
|
193
|
+
replaceStr(path.join(targetAppDir, 'web/src/github-pj-name/index.tsx'), [
|
|
194
|
+
{ from: `/${templateObj?.dir}`, to: '/github-pj-name' },
|
|
195
|
+
{ from: `${templateObj?.dir}/`, to: 'github-pj-name/' },
|
|
196
|
+
]);
|
|
197
|
+
replaceStr(path.join(targetAppDir, 'web/src/github-pj-name/index.html'), [
|
|
198
|
+
{ from: `/${templateObj?.dir}`, to: '/github-pj-name' },
|
|
199
|
+
{ from: `${templateObj?.dir}/`, to: 'github-pj-name/' },
|
|
200
|
+
]);
|
|
201
|
+
replaceStr(path.join(targetAppDir, 'web/src/github-pj-name/404.html'), [
|
|
202
|
+
{ from: `/${templateObj?.dir}`, to: '/github-pj-name' },
|
|
203
|
+
{ from: `${templateObj?.dir}/`, to: 'github-pj-name/' },
|
|
204
|
+
]);
|
|
205
|
+
replaceStr(path.join(targetAppDir, 'lupine.json'), [
|
|
206
|
+
{ from: `/${templateObj?.dir}`, to: '/github-pj-name' },
|
|
207
|
+
{ from: `${templateObj?.dir}/`, to: 'github-pj-name/' },
|
|
208
|
+
]);
|
|
209
|
+
}
|
|
178
210
|
|
|
179
211
|
if (templateObj?.layout) {
|
|
180
212
|
const frameFile = path.join(targetAppDir, 'web/src/frames/app-responsive-frame.tsx');
|
|
181
213
|
if (fs.existsSync(frameFile)) {
|
|
182
214
|
let content = fs.readFileSync(frameFile, 'utf-8');
|
|
183
|
-
content = content.replace(
|
|
184
|
-
/const DEFAULT_LAYOUT = '.*';/,
|
|
185
|
-
`const DEFAULT_LAYOUT = '${templateObj.layout}';`
|
|
186
|
-
);
|
|
215
|
+
content = content.replace(/const DEFAULT_LAYOUT = '.*';/, `const DEFAULT_LAYOUT = '${templateObj.layout}';`);
|
|
187
216
|
fs.writeFileSync(frameFile, content);
|
|
188
217
|
}
|
|
189
218
|
}
|