@stdex/create 0.0.0-stage → 1.1.0

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 (103) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +66 -2
  3. package/README_EN.md +67 -0
  4. package/package.json +39 -3
  5. package/src/eslint.config.js +2 -0
  6. package/src/index.js +232 -0
  7. package/templates/base/eslint.config.js +2 -0
  8. package/templates/base/index.js +1 -0
  9. package/templates/base/package.json +16 -0
  10. package/templates/miniprogram/README.md +27 -0
  11. package/templates/miniprogram/_gitignore +3 -0
  12. package/templates/miniprogram/dist/app.js +9 -0
  13. package/templates/miniprogram/dist/app.json +16 -0
  14. package/templates/miniprogram/dist/app.wxss +0 -0
  15. package/templates/miniprogram/dist/lib/app-data.js +51 -0
  16. package/templates/miniprogram/dist/pages/index/index.js +20 -0
  17. package/templates/miniprogram/dist/pages/index/index.json +3 -0
  18. package/templates/miniprogram/dist/pages/index/index.wxml +1 -0
  19. package/templates/miniprogram/dist/pages/index/index.wxss +11 -0
  20. package/templates/miniprogram/dist/sitemap.json +9 -0
  21. package/templates/miniprogram/eslint.config.cjs +25 -0
  22. package/templates/miniprogram/gulpfile.js +81 -0
  23. package/templates/miniprogram/package.json +22 -0
  24. package/templates/miniprogram/project.config.json +31 -0
  25. package/templates/miniprogram/project.private.config.json +8 -0
  26. package/templates/miniprogram/src/app.json +16 -0
  27. package/templates/miniprogram/src/app.scss +0 -0
  28. package/templates/miniprogram/src/app.ts +6 -0
  29. package/templates/miniprogram/src/lib/app-data.ts +46 -0
  30. package/templates/miniprogram/src/pages/index/index.json +3 -0
  31. package/templates/miniprogram/src/pages/index/index.scss +11 -0
  32. package/templates/miniprogram/src/pages/index/index.ts +13 -0
  33. package/templates/miniprogram/src/pages/index/index.wxml +1 -0
  34. package/templates/miniprogram/src/sitemap.json +9 -0
  35. package/templates/miniprogram/tsconfig.json +11 -0
  36. package/templates/miniprogram/typings/index.d.ts +5 -0
  37. package/templates/miniprogram/typings/types/index.d.ts +1 -0
  38. package/templates/miniprogram/typings/types/wx/index.d.ts +162 -0
  39. package/templates/miniprogram/typings/types/wx/lib.wx.api.d.ts +32387 -0
  40. package/templates/miniprogram/typings/types/wx/lib.wx.app.d.ts +400 -0
  41. package/templates/miniprogram/typings/types/wx/lib.wx.behavior.d.ts +68 -0
  42. package/templates/miniprogram/typings/types/wx/lib.wx.canvas.d.ts +2623 -0
  43. package/templates/miniprogram/typings/types/wx/lib.wx.cloud.d.ts +1016 -0
  44. package/templates/miniprogram/typings/types/wx/lib.wx.component.d.ts +700 -0
  45. package/templates/miniprogram/typings/types/wx/lib.wx.event.d.ts +1436 -0
  46. package/templates/miniprogram/typings/types/wx/lib.wx.page.d.ts +272 -0
  47. package/templates/miniprogram/typings/types/wx/lib.wx.phys3D.d.ts +409 -0
  48. package/templates/miniprogram/typings/types/wx/lib.wx.wasm.d.ts +152 -0
  49. package/templates/miniprogram/typings/types/wx/lib.wx.xr-frame.d.ts +15631 -0
  50. package/templates/miniprogram/variables.json +11 -0
  51. package/templates/service/.env +1 -0
  52. package/templates/service/README.md +64 -0
  53. package/templates/service/_gitignore +5 -0
  54. package/templates/service/eslint.config.js +2 -0
  55. package/templates/service/package.json +44 -0
  56. package/templates/service/prisma/schema.prisma +40 -0
  57. package/templates/service/prisma/sql/demoTypedSql.sql +1 -0
  58. package/templates/service/prisma.config.ts +12 -0
  59. package/templates/service/setup.js +4 -0
  60. package/templates/service/src/cache.ts +28 -0
  61. package/templates/service/src/config.ts +49 -0
  62. package/templates/service/src/controllers/common.ts +43 -0
  63. package/templates/service/src/controllers/demo-school.ts +7 -0
  64. package/templates/service/src/controllers/demo-student.ts +7 -0
  65. package/templates/service/src/controllers/index.ts +15 -0
  66. package/templates/service/src/database.ts +52 -0
  67. package/templates/service/src/index.ts +15 -0
  68. package/templates/service/src/logger.ts +11 -0
  69. package/templates/service/src/routes/demo-school.ts +9 -0
  70. package/templates/service/src/routes/index.ts +3 -0
  71. package/templates/service/src/routes/router.ts +42 -0
  72. package/templates/service/src/tasks/common.ts +24 -0
  73. package/templates/service/src/tasks/demo-school.ts +6 -0
  74. package/templates/service/src/tasks/index.ts +1 -0
  75. package/templates/service/tsconfig.build.json +9 -0
  76. package/templates/service/tsconfig.json +10 -0
  77. package/templates/site/_gitignore +3 -0
  78. package/templates/site/_pnpm-workspace.yaml +4 -0
  79. package/templates/site/eslint.config.js +19 -0
  80. package/templates/site/package.json +38 -0
  81. package/templates/site/public/favicon.png +0 -0
  82. package/templates/site/src/app/header.tsx +31 -0
  83. package/templates/site/src/app/index.tsx +38 -0
  84. package/templates/site/src/app/layout.tsx +63 -0
  85. package/templates/site/src/app/menu.tsx +115 -0
  86. package/templates/site/src/app/router.tsx +50 -0
  87. package/templates/site/src/app/style.css +9 -0
  88. package/templates/site/src/assets/logo.png +0 -0
  89. package/templates/site/src/components/Breadcrumb.tsx +47 -0
  90. package/templates/site/src/components/DevStatus.tsx +14 -0
  91. package/templates/site/src/index.html +13 -0
  92. package/templates/site/src/index.tsx +5 -0
  93. package/templates/site/src/lib/config.ts +6 -0
  94. package/templates/site/src/lib/logging.ts +11 -0
  95. package/templates/site/src/views/dashboard.tsx +7 -0
  96. package/templates/site/src/views/school-detail.tsx +13 -0
  97. package/templates/site/src/views/school-ranking.tsx +7 -0
  98. package/templates/site/src/views/schools.tsx +43 -0
  99. package/templates/site/src/views/setting.tsx +7 -0
  100. package/templates/site/src/views/student-score.tsx +7 -0
  101. package/templates/site/src/views/students.tsx +7 -0
  102. package/templates/site/tsconfig.json +10 -0
  103. package/templates/site/vite.config.js +60 -0
@@ -0,0 +1,152 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) 2023 Tencent, Inc. All rights reserved.
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ this software and associated documentation files (the "Software"), to deal in
6
+ the Software without restriction, including without limitation the rights to
7
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
8
+ of the Software, and to permit persons to whom the Software is furnished to do
9
+ so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
21
+ ***************************************************************************** */
22
+
23
+ /** [WXWebAssembly](https://developers.weixin.qq.com/miniprogram/dev/framework/performance/wasm.html)
24
+ *
25
+ * WXWebAssembly */
26
+ declare namespace WXWebAssembly {
27
+ type BufferSource = ArrayBufferView | ArrayBuffer
28
+
29
+ type CompileError = Error
30
+
31
+ const CompileError: {
32
+ prototype: CompileError
33
+ new (message?: string): CompileError
34
+ (message?: string): CompileError
35
+ }
36
+
37
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance) */
38
+ interface Instance {
39
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance/exports) */
40
+ readonly exports: Exports
41
+ }
42
+
43
+ const Instance: {
44
+ prototype: Instance
45
+ new (module: Module, importObject?: Imports): Instance
46
+ }
47
+
48
+ type LinkError = Error
49
+
50
+ const LinkError: {
51
+ prototype: LinkError
52
+ new (message?: string): LinkError
53
+ (message?: string): LinkError
54
+ }
55
+
56
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory) */
57
+ interface Memory {
58
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory/buffer) */
59
+ readonly buffer: ArrayBuffer
60
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory/grow) */
61
+ grow(delta: number): number
62
+ }
63
+
64
+ const Memory: {
65
+ prototype: Memory
66
+ new (descriptor: MemoryDescriptor): Memory
67
+ }
68
+
69
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module) */
70
+ interface Module {}
71
+
72
+ const Module: {
73
+ prototype: Module
74
+ new (bytes: BufferSource): Module
75
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module/customSections) */
76
+ customSections(moduleObject: Module, sectionName: string): ArrayBuffer[]
77
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module/exports) */
78
+ exports(moduleObject: Module): ModuleExportDescriptor[]
79
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module/imports) */
80
+ imports(moduleObject: Module): ModuleImportDescriptor[]
81
+ }
82
+
83
+ interface RuntimeError extends Error {}
84
+
85
+ const RuntimeError: {
86
+ prototype: RuntimeError
87
+ new (message?: string): RuntimeError
88
+ (message?: string): RuntimeError
89
+ }
90
+
91
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table) */
92
+ interface Table {
93
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table/length) */
94
+ readonly length: number
95
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table/get) */
96
+ get(index: number): any
97
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table/grow) */
98
+ grow(delta: number, value?: any): number
99
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table/set) */
100
+ set(index: number, value?: any): void
101
+ }
102
+
103
+ const Table: {
104
+ prototype: Table
105
+ new (descriptor: TableDescriptor, value?: any): Table
106
+ }
107
+
108
+ interface MemoryDescriptor {
109
+ initial: number
110
+ maximum?: number
111
+ shared?: boolean
112
+ }
113
+
114
+ interface ModuleExportDescriptor {
115
+ kind: ImportExportKind
116
+ name: string
117
+ }
118
+
119
+ interface ModuleImportDescriptor {
120
+ kind: ImportExportKind
121
+ module: string
122
+ name: string
123
+ }
124
+
125
+ interface TableDescriptor {
126
+ element: TableKind
127
+ initial: number
128
+ maximum?: number
129
+ }
130
+
131
+ type ImportExportKind = 'function' | 'global' | 'memory' | 'table'
132
+ type TableKind = 'anyfunc' | 'externref'
133
+ type ValueType =
134
+ | 'anyfunc'
135
+ | 'externref'
136
+ | 'f32'
137
+ | 'f64'
138
+ | 'i32'
139
+ | 'i64'
140
+ | 'v128'
141
+ // eslint-disable-next-line @typescript-eslint/ban-types
142
+ type ExportValue = Function | Memory | Table
143
+ type Exports = Record<string, ExportValue>
144
+ type ImportValue = ExportValue | number
145
+ type Imports = Record<string, ModuleImports>
146
+ type ModuleImports = Record<string, ImportValue>
147
+ /** [WXWebAssembly](https://developers.weixin.qq.com/miniprogram/dev/framework/performance/wasm.html) */
148
+ function instantiate(
149
+ path: string,
150
+ importObject?: Imports
151
+ ): Promise<Instance>
152
+ }