create-lupine 1.0.28 → 1.0.30

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.
Files changed (113) hide show
  1. package/index.js +410 -411
  2. package/package.json +17 -17
  3. package/templates/common/.env.development +7 -7
  4. package/templates/common/.env.mobile +9 -9
  5. package/templates/common/.env.production +7 -7
  6. package/templates/common/_env +58 -58
  7. package/templates/common/_gitignore +25 -25
  8. package/templates/common/apps/server/src/index.ts +78 -76
  9. package/templates/common/apps/server/src/server-env-keys.ts +0 -9
  10. package/templates/common/dev/cp-folder.js +45 -45
  11. package/templates/common/tsconfig.json +128 -128
  12. package/templates/lupine-template-cv-starter/api/package.json +5 -5
  13. package/templates/lupine-template-cv-starter/api/resources/config_default.json +6 -6
  14. package/templates/lupine-template-cv-starter/api/resources/install.sqlite.sql +3 -3
  15. package/templates/lupine-template-cv-starter/api/src/index.ts +15 -15
  16. package/templates/lupine-template-cv-starter/lupine.json +40 -38
  17. package/templates/lupine-template-cv-starter/web/markdown/en/01-experience/index.md +32 -32
  18. package/templates/lupine-template-cv-starter/web/markdown/en/02-projects/index.md +36 -36
  19. package/templates/lupine-template-cv-starter/web/markdown/en/03-skills/index.md +28 -28
  20. package/templates/lupine-template-cv-starter/web/markdown/en/04-education/index.md +16 -16
  21. package/templates/lupine-template-cv-starter/web/markdown/en/index.md +41 -41
  22. package/templates/lupine-template-cv-starter/web/markdown/index.md +7 -7
  23. package/templates/lupine-template-cv-starter/web/markdown/zh/01-experience/index.md +32 -32
  24. package/templates/lupine-template-cv-starter/web/markdown/zh/02-projects/index.md +36 -36
  25. package/templates/lupine-template-cv-starter/web/markdown/zh/03-skills/index.md +28 -28
  26. package/templates/lupine-template-cv-starter/web/markdown/zh/04-education/index.md +17 -17
  27. package/templates/lupine-template-cv-starter/web/markdown/zh/index.md +41 -41
  28. package/templates/lupine-template-cv-starter/web/package.json +5 -5
  29. package/templates/lupine-template-cv-starter/web/src/client-env-keys.ts +5 -5
  30. package/templates/lupine-template-cv-starter/web/src/index.html +16 -16
  31. package/templates/lupine-template-cv-starter/web/src/index.tsx +28 -28
  32. package/templates/lupine-template-cv-starter/web/src/lupine-template-cv-starter/404.html +38 -38
  33. package/templates/lupine-template-cv-starter/web/src/lupine-template-cv-starter/index.html +73 -73
  34. package/templates/lupine-template-cv-starter/web/src/lupine-template-cv-starter/index.tsx +30 -30
  35. package/templates/lupine-template-cv-starter/web/src/markdown-built/en/01-experience/index.html +20 -20
  36. package/templates/lupine-template-cv-starter/web/src/markdown-built/en/02-projects/index.html +28 -28
  37. package/templates/lupine-template-cv-starter/web/src/markdown-built/en/03-skills/index.html +18 -18
  38. package/templates/lupine-template-cv-starter/web/src/markdown-built/en/04-education/index.html +10 -10
  39. package/templates/lupine-template-cv-starter/web/src/markdown-built/en/index.html +20 -20
  40. package/templates/lupine-template-cv-starter/web/src/markdown-built/zh/01-experience/index.html +20 -20
  41. package/templates/lupine-template-cv-starter/web/src/markdown-built/zh/02-projects/index.html +28 -28
  42. package/templates/lupine-template-cv-starter/web/src/markdown-built/zh/03-skills/index.html +18 -18
  43. package/templates/lupine-template-cv-starter/web/src/markdown-built/zh/04-education/index.html +11 -11
  44. package/templates/lupine-template-cv-starter/web/src/markdown-built/zh/index.html +20 -20
  45. package/templates/lupine-template-cv-starter/web/src/styles/base-css.ts +15 -15
  46. package/templates/lupine-template-doc-starter/api/package.json +5 -5
  47. package/templates/lupine-template-doc-starter/api/resources/config_default.json +6 -6
  48. package/templates/lupine-template-doc-starter/api/resources/install.sqlite.sql +3 -3
  49. package/templates/lupine-template-doc-starter/api/src/index.ts +15 -15
  50. package/templates/lupine-template-doc-starter/api/src/resources/config_default.json +6 -6
  51. package/templates/lupine-template-doc-starter/api/src/resources/install.sqlite.sql +3 -3
  52. package/templates/lupine-template-doc-starter/lupine.json +40 -38
  53. package/templates/lupine-template-doc-starter/web/markdown/en/essentials/index.md +6 -6
  54. package/templates/lupine-template-doc-starter/web/markdown/en/essentials/list.md +18 -18
  55. package/templates/lupine-template-doc-starter/web/markdown/en/guide/install.md +18 -18
  56. package/templates/lupine-template-doc-starter/web/markdown/en/guide/started.md +22 -22
  57. package/templates/lupine-template-doc-starter/web/markdown/en/index.md +42 -42
  58. package/templates/lupine-template-doc-starter/web/markdown/index.md +7 -7
  59. package/templates/lupine-template-doc-starter/web/markdown/zh/essentials/index.md +6 -6
  60. package/templates/lupine-template-doc-starter/web/markdown/zh/essentials/list.md +18 -18
  61. package/templates/lupine-template-doc-starter/web/markdown/zh/guide/install.md +18 -18
  62. package/templates/lupine-template-doc-starter/web/markdown/zh/guide/started.md +22 -22
  63. package/templates/lupine-template-doc-starter/web/markdown/zh/index.md +42 -42
  64. package/templates/lupine-template-doc-starter/web/package.json +5 -5
  65. package/templates/lupine-template-doc-starter/web/src/client-env-keys.ts +5 -5
  66. package/templates/lupine-template-doc-starter/web/src/index.html +16 -16
  67. package/templates/lupine-template-doc-starter/web/src/index.tsx +28 -28
  68. package/templates/lupine-template-doc-starter/web/src/lupine-template-doc-starter/404.html +38 -38
  69. package/templates/lupine-template-doc-starter/web/src/lupine-template-doc-starter/index.html +27 -27
  70. package/templates/lupine-template-doc-starter/web/src/lupine-template-doc-starter/index.tsx +30 -30
  71. package/templates/lupine-template-doc-starter/web/src/markdown-built/en/essentials/list.html +8 -8
  72. package/templates/lupine-template-doc-starter/web/src/markdown-built/en/guide/install.html +8 -8
  73. package/templates/lupine-template-doc-starter/web/src/markdown-built/en/guide/started.html +12 -12
  74. package/templates/lupine-template-doc-starter/web/src/markdown-built/zh/essentials/list.html +8 -8
  75. package/templates/lupine-template-doc-starter/web/src/markdown-built/zh/guide/install.html +8 -8
  76. package/templates/lupine-template-doc-starter/web/src/markdown-built/zh/guide/started.html +12 -12
  77. package/templates/lupine-template-doc-starter/web/src/styles/base-css.ts +15 -15
  78. package/templates/lupine-template-hello-world/api/resources/install.sqlite.sql +3 -3
  79. package/templates/lupine-template-hello-world/api/src/index.ts +4 -4
  80. package/templates/lupine-template-hello-world/api/src/service/root-api.ts +18 -18
  81. package/templates/lupine-template-hello-world/lupine.json +23 -23
  82. package/templates/lupine-template-hello-world/web/package.json +6 -6
  83. package/templates/lupine-template-hello-world/web/src/index.html +16 -16
  84. package/templates/lupine-template-hello-world/web/src/index.tsx +73 -73
  85. package/templates/lupine-template-responsive-starter/api/resources/install.sqlite.sql +3 -3
  86. package/templates/lupine-template-responsive-starter/api/src/index.ts +4 -4
  87. package/templates/lupine-template-responsive-starter/api/src/service/root-api.ts +18 -18
  88. package/templates/lupine-template-responsive-starter/lupine.json +7 -7
  89. package/templates/lupine-template-responsive-starter/web/src/app-icons.ts +76 -76
  90. package/templates/lupine-template-responsive-starter/web/src/components/input-history-component.tsx +93 -93
  91. package/templates/lupine-template-responsive-starter/web/src/components/mine-about-page.tsx +86 -86
  92. package/templates/lupine-template-responsive-starter/web/src/components/mine-premium-page.tsx +80 -80
  93. package/templates/lupine-template-responsive-starter/web/src/components/mine-settings-page.tsx +220 -219
  94. package/templates/lupine-template-responsive-starter/web/src/components/mobile-top-search-menu.tsx +119 -119
  95. package/templates/lupine-template-responsive-starter/web/src/components/note-detail.tsx +116 -116
  96. package/templates/lupine-template-responsive-starter/web/src/components/note-edit.tsx +154 -154
  97. package/templates/lupine-template-responsive-starter/web/src/components/note-search-page.tsx +193 -193
  98. package/templates/lupine-template-responsive-starter/web/src/components/search-input.tsx +95 -95
  99. package/templates/lupine-template-responsive-starter/web/src/components/side-menu-content.tsx +182 -182
  100. package/templates/lupine-template-responsive-starter/web/src/frames/app-responsive-frame.tsx +52 -52
  101. package/templates/lupine-template-responsive-starter/web/src/index.html +16 -16
  102. package/templates/lupine-template-responsive-starter/web/src/index.tsx +39 -39
  103. package/templates/lupine-template-responsive-starter/web/src/lupine-template-responsive-starter/404.html +35 -35
  104. package/templates/lupine-template-responsive-starter/web/src/lupine-template-responsive-starter/index.html +49 -49
  105. package/templates/lupine-template-responsive-starter/web/src/lupine-template-responsive-starter/index.tsx +32 -32
  106. package/templates/lupine-template-responsive-starter/web/src/pages/about-page.tsx +43 -43
  107. package/templates/lupine-template-responsive-starter/web/src/pages/finance-page.tsx +46 -46
  108. package/templates/lupine-template-responsive-starter/web/src/pages/home-page.tsx +452 -452
  109. package/templates/lupine-template-responsive-starter/web/src/pages/mine-page.tsx +325 -325
  110. package/templates/lupine-template-responsive-starter/web/src/pages/tools-page.tsx +46 -46
  111. package/templates/lupine-template-responsive-starter/web/src/services/local-notes-service.ts +87 -87
  112. package/templates/lupine-template-responsive-starter/web/src/services/mine-service.ts +45 -45
  113. package/templates/common/dev/dev-watch.js +0 -389
@@ -1,46 +1,46 @@
1
- import {
2
- CssProps,
3
- MobileHeaderCenter,
4
- MobileHeaderEmptyIcon,
5
- MobileHeaderTitleIcon,
6
- MobileTopSysIcon,
7
- PageProps,
8
- RefProps,
9
- } from 'lupine.components';
10
-
11
- export const ToolsPage = async (props: PageProps) => {
12
- const css: CssProps = {
13
- display: 'flex',
14
- flexDirection: 'column',
15
- height: '100%',
16
- position: 'relative',
17
- '.tools-list-container': {
18
- padding: '32px 24px',
19
- display: 'flex',
20
- flexDirection: 'column',
21
- alignItems: 'center',
22
- },
23
- };
24
-
25
- const ref: RefProps = {
26
- onLoad: async () => {},
27
- };
28
-
29
- return (
30
- <div css={css} ref={ref}>
31
- <MobileHeaderCenter>
32
- <MobileHeaderTitleIcon
33
- title='Tools'
34
- left={<MobileHeaderEmptyIcon />}
35
- right={
36
- <div class='flex-center-gap-12'>
37
- <MobileTopSysIcon />
38
- </div>
39
- }
40
- />
41
- </MobileHeaderCenter>
42
-
43
- <div class='tools-list-container no-scrollbar-container'>This is a demo tools page.</div>
44
- </div>
45
- );
46
- };
1
+ import {
2
+ CssProps,
3
+ MobileHeaderCenter,
4
+ MobileHeaderEmptyIcon,
5
+ MobileHeaderTitleIcon,
6
+ MobileTopSysIcon,
7
+ PageProps,
8
+ RefProps,
9
+ } from 'lupine.components';
10
+
11
+ export const ToolsPage = async (props: PageProps) => {
12
+ const css: CssProps = {
13
+ display: 'flex',
14
+ flexDirection: 'column',
15
+ height: '100%',
16
+ position: 'relative',
17
+ '.tools-list-container': {
18
+ padding: '32px 24px',
19
+ display: 'flex',
20
+ flexDirection: 'column',
21
+ alignItems: 'center',
22
+ },
23
+ };
24
+
25
+ const ref: RefProps = {
26
+ onLoad: async () => {},
27
+ };
28
+
29
+ return (
30
+ <div css={css} ref={ref}>
31
+ <MobileHeaderCenter>
32
+ <MobileHeaderTitleIcon
33
+ title='Tools'
34
+ left={<MobileHeaderEmptyIcon />}
35
+ right={
36
+ <div class='flex-center-gap-12'>
37
+ <MobileTopSysIcon />
38
+ </div>
39
+ }
40
+ />
41
+ </MobileHeaderCenter>
42
+
43
+ <div class='tools-list-container no-scrollbar-container'>This is a demo tools page.</div>
44
+ </div>
45
+ );
46
+ };
@@ -1,87 +1,87 @@
1
- export interface LocalNoteProps {
2
- id: number;
3
- title: string;
4
- content: string; // HTML string
5
- updatedAt: number;
6
- images?: string[]; // Optional base64 strings
7
- color?: string; // Optional color tag
8
- orderIndex?: number;
9
- }
10
-
11
- const STORAGE_KEY = 'lj_notes';
12
-
13
- export const LocalNotesService = {
14
- getAllNotes: (): LocalNoteProps[] => {
15
- try {
16
- const data = localStorage.getItem(STORAGE_KEY);
17
- const notes: LocalNoteProps[] = data ? JSON.parse(data) : [];
18
- return notes.sort((a, b) => {
19
- const orderA = a.orderIndex !== undefined ? a.orderIndex : a.id;
20
- const orderB = b.orderIndex !== undefined ? b.orderIndex : b.id;
21
- // Default sort: descending (newest/highest first), unless orderIndex dictates otherwise.
22
- // If we want manual ordering, let's just sort descending by orderIndex.
23
- return orderB - orderA;
24
- });
25
- } catch (e) {
26
- console.error('Failed to load notes', e);
27
- return [];
28
- }
29
- },
30
-
31
- getNoteById: (id: number): LocalNoteProps | undefined => {
32
- return LocalNotesService.getAllNotes().find((n) => n.id === id);
33
- },
34
-
35
- saveNote: (note: LocalNoteProps): LocalNoteProps => {
36
- const notes = LocalNotesService.getAllNotes();
37
- note.updatedAt = Date.now();
38
-
39
- if (note.id <= 0) {
40
- note.id = Date.now();
41
- // Calculate next highest order index
42
- const maxOrder = notes.length > 0 ? Math.max(...notes.map((n) => n.orderIndex ?? n.id)) : Date.now();
43
- note.orderIndex = maxOrder + 1;
44
- notes.unshift(note);
45
- } else {
46
- const index = notes.findIndex((n) => n.id === note.id);
47
- if (index > -1) {
48
- notes[index] = note;
49
- } else {
50
- notes.unshift(note);
51
- }
52
- }
53
-
54
- localStorage.setItem(STORAGE_KEY, JSON.stringify(notes));
55
- return note;
56
- },
57
-
58
- updateNoteOrders: (orderedIds: number[]): boolean => {
59
- // orderedIds is passed from top to bottom. Top has highest orderIndex.
60
- const notes = LocalNotesService.getAllNotes();
61
- let updated = false;
62
- const len = orderedIds.length;
63
- orderedIds.forEach((id, idx) => {
64
- const note = notes.find((n) => n.id === id);
65
- if (note) {
66
- note.orderIndex = len - idx; // Highest index for first item
67
- updated = true;
68
- }
69
- });
70
-
71
- if (updated) {
72
- localStorage.setItem(STORAGE_KEY, JSON.stringify(notes));
73
- }
74
- return updated;
75
- },
76
-
77
- deleteNote: (id: number): boolean => {
78
- let notes = LocalNotesService.getAllNotes();
79
- const len = notes.length;
80
- notes = notes.filter((n) => n.id !== id);
81
- if (notes.length !== len) {
82
- localStorage.setItem(STORAGE_KEY, JSON.stringify(notes));
83
- return true;
84
- }
85
- return false;
86
- },
87
- };
1
+ export interface LocalNoteProps {
2
+ id: number;
3
+ title: string;
4
+ content: string; // HTML string
5
+ updatedAt: number;
6
+ images?: string[]; // Optional base64 strings
7
+ color?: string; // Optional color tag
8
+ orderIndex?: number;
9
+ }
10
+
11
+ const STORAGE_KEY = 'lj_notes';
12
+
13
+ export const LocalNotesService = {
14
+ getAllNotes: (): LocalNoteProps[] => {
15
+ try {
16
+ const data = localStorage.getItem(STORAGE_KEY);
17
+ const notes: LocalNoteProps[] = data ? JSON.parse(data) : [];
18
+ return notes.sort((a, b) => {
19
+ const orderA = a.orderIndex !== undefined ? a.orderIndex : a.id;
20
+ const orderB = b.orderIndex !== undefined ? b.orderIndex : b.id;
21
+ // Default sort: descending (newest/highest first), unless orderIndex dictates otherwise.
22
+ // If we want manual ordering, let's just sort descending by orderIndex.
23
+ return orderB - orderA;
24
+ });
25
+ } catch (e) {
26
+ console.error('Failed to load notes', e);
27
+ return [];
28
+ }
29
+ },
30
+
31
+ getNoteById: (id: number): LocalNoteProps | undefined => {
32
+ return LocalNotesService.getAllNotes().find((n) => n.id === id);
33
+ },
34
+
35
+ saveNote: (note: LocalNoteProps): LocalNoteProps => {
36
+ const notes = LocalNotesService.getAllNotes();
37
+ note.updatedAt = Date.now();
38
+
39
+ if (note.id <= 0) {
40
+ note.id = Date.now();
41
+ // Calculate next highest order index
42
+ const maxOrder = notes.length > 0 ? Math.max(...notes.map((n) => n.orderIndex ?? n.id)) : Date.now();
43
+ note.orderIndex = maxOrder + 1;
44
+ notes.unshift(note);
45
+ } else {
46
+ const index = notes.findIndex((n) => n.id === note.id);
47
+ if (index > -1) {
48
+ notes[index] = note;
49
+ } else {
50
+ notes.unshift(note);
51
+ }
52
+ }
53
+
54
+ localStorage.setItem(STORAGE_KEY, JSON.stringify(notes));
55
+ return note;
56
+ },
57
+
58
+ updateNoteOrders: (orderedIds: number[]): boolean => {
59
+ // orderedIds is passed from top to bottom. Top has highest orderIndex.
60
+ const notes = LocalNotesService.getAllNotes();
61
+ let updated = false;
62
+ const len = orderedIds.length;
63
+ orderedIds.forEach((id, idx) => {
64
+ const note = notes.find((n) => n.id === id);
65
+ if (note) {
66
+ note.orderIndex = len - idx; // Highest index for first item
67
+ updated = true;
68
+ }
69
+ });
70
+
71
+ if (updated) {
72
+ localStorage.setItem(STORAGE_KEY, JSON.stringify(notes));
73
+ }
74
+ return updated;
75
+ },
76
+
77
+ deleteNote: (id: number): boolean => {
78
+ let notes = LocalNotesService.getAllNotes();
79
+ const len = notes.length;
80
+ notes = notes.filter((n) => n.id !== id);
81
+ if (notes.length !== len) {
82
+ localStorage.setItem(STORAGE_KEY, JSON.stringify(notes));
83
+ return true;
84
+ }
85
+ return false;
86
+ },
87
+ };
@@ -1,45 +1,45 @@
1
- import { LocalNotesService } from './local-notes-service';
2
-
3
- export interface MineStats {
4
- noteCount: number;
5
- }
6
-
7
- export interface BackupData {
8
- notes: any[];
9
- timestamp: string;
10
- }
11
-
12
- export const MineService = {
13
- getStats: (): MineStats => {
14
- const notes = LocalNotesService.getAllNotes();
15
-
16
- return {
17
- noteCount: notes.length,
18
- };
19
- },
20
-
21
- exportBackup: (): string => {
22
- const data: BackupData = {
23
- notes: LocalNotesService.getAllNotes(),
24
- timestamp: new Date().toISOString(),
25
- };
26
- return JSON.stringify(data, null, 2);
27
- },
28
-
29
- importBackup: (jsonStr: string): boolean => {
30
- try {
31
- const data: BackupData = JSON.parse(jsonStr);
32
- if (Array.isArray(data.notes)) {
33
- localStorage.setItem('lj_notes', JSON.stringify(data.notes));
34
- }
35
- return true;
36
- } catch (e) {
37
- console.error('Failed to import backup', e);
38
- return false;
39
- }
40
- },
41
-
42
- clearAllData: () => {
43
- localStorage.removeItem('lj_notes');
44
- },
45
- };
1
+ import { LocalNotesService } from './local-notes-service';
2
+
3
+ export interface MineStats {
4
+ noteCount: number;
5
+ }
6
+
7
+ export interface BackupData {
8
+ notes: any[];
9
+ timestamp: string;
10
+ }
11
+
12
+ export const MineService = {
13
+ getStats: (): MineStats => {
14
+ const notes = LocalNotesService.getAllNotes();
15
+
16
+ return {
17
+ noteCount: notes.length,
18
+ };
19
+ },
20
+
21
+ exportBackup: (): string => {
22
+ const data: BackupData = {
23
+ notes: LocalNotesService.getAllNotes(),
24
+ timestamp: new Date().toISOString(),
25
+ };
26
+ return JSON.stringify(data, null, 2);
27
+ },
28
+
29
+ importBackup: (jsonStr: string): boolean => {
30
+ try {
31
+ const data: BackupData = JSON.parse(jsonStr);
32
+ if (Array.isArray(data.notes)) {
33
+ localStorage.setItem('lj_notes', JSON.stringify(data.notes));
34
+ }
35
+ return true;
36
+ } catch (e) {
37
+ console.error('Failed to import backup', e);
38
+ return false;
39
+ }
40
+ },
41
+
42
+ clearAllData: () => {
43
+ localStorage.removeItem('lj_notes');
44
+ },
45
+ };