@simplysm/sd-cli 13.0.75 → 13.0.77
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/README.md +341 -16
- package/dist/builders/DtsBuilder.js +2 -2
- package/dist/builders/DtsBuilder.js.map +1 -1
- package/dist/builders/LibraryBuilder.d.ts +3 -3
- package/dist/builders/LibraryBuilder.d.ts.map +1 -1
- package/dist/builders/LibraryBuilder.js +2 -2
- package/dist/builders/LibraryBuilder.js.map +1 -1
- package/dist/builders/types.d.ts +7 -1
- package/dist/builders/types.d.ts.map +1 -1
- package/dist/capacitor/capacitor.d.ts +5 -0
- package/dist/capacitor/capacitor.d.ts.map +1 -1
- package/dist/capacitor/capacitor.js +59 -59
- package/dist/capacitor/capacitor.js.map +1 -1
- package/dist/commands/check.js +4 -4
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/device.js +3 -3
- package/dist/commands/device.js.map +1 -1
- package/dist/commands/lint.d.ts +2 -2
- package/dist/commands/lint.d.ts.map +1 -1
- package/dist/commands/lint.js +4 -98
- package/dist/commands/lint.js.map +1 -1
- package/dist/commands/publish.js +20 -20
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/replace-deps.js +1 -1
- package/dist/commands/replace-deps.js.map +1 -1
- package/dist/commands/typecheck.js +9 -9
- package/dist/commands/typecheck.js.map +1 -1
- package/dist/electron/electron.js +16 -16
- package/dist/electron/electron.js.map +1 -1
- package/dist/orchestrators/BuildOrchestrator.js +6 -6
- package/dist/orchestrators/BuildOrchestrator.js.map +1 -1
- package/dist/orchestrators/DevOrchestrator.d.ts +7 -6
- package/dist/orchestrators/DevOrchestrator.d.ts.map +1 -1
- package/dist/orchestrators/DevOrchestrator.js +157 -203
- package/dist/orchestrators/DevOrchestrator.js.map +1 -1
- package/dist/orchestrators/WatchOrchestrator.d.ts.map +1 -1
- package/dist/orchestrators/WatchOrchestrator.js +3 -4
- package/dist/orchestrators/WatchOrchestrator.js.map +1 -1
- package/dist/sd-cli.js +1 -1
- package/dist/sd-cli.js.map +1 -1
- package/dist/sd-config.types.d.ts +9 -3
- package/dist/sd-config.types.d.ts.map +1 -1
- package/dist/utils/copy-public.d.ts.map +1 -1
- package/dist/utils/copy-public.js +23 -27
- package/dist/utils/copy-public.js.map +1 -1
- package/dist/utils/copy-src.d.ts.map +1 -1
- package/dist/utils/copy-src.js +7 -7
- package/dist/utils/copy-src.js.map +1 -1
- package/dist/utils/esbuild-config.d.ts.map +1 -1
- package/dist/utils/esbuild-config.js +36 -42
- package/dist/utils/esbuild-config.js.map +1 -1
- package/dist/utils/replace-deps.js +7 -7
- package/dist/utils/replace-deps.js.map +1 -1
- package/dist/utils/sd-config.js +2 -2
- package/dist/utils/sd-config.js.map +1 -1
- package/dist/utils/template.js +7 -7
- package/dist/utils/template.js.map +1 -1
- package/dist/utils/tsconfig.d.ts +1 -2
- package/dist/utils/tsconfig.d.ts.map +1 -1
- package/dist/utils/tsconfig.js +5 -8
- package/dist/utils/tsconfig.js.map +1 -1
- package/dist/utils/typecheck-serialization.js +2 -2
- package/dist/utils/typecheck-serialization.js.map +1 -1
- package/dist/utils/vite-config.d.ts +2 -0
- package/dist/utils/vite-config.d.ts.map +1 -1
- package/dist/utils/vite-config.js +36 -3
- package/dist/utils/vite-config.js.map +1 -1
- package/dist/utils/worker-events.d.ts +11 -1
- package/dist/utils/worker-events.d.ts.map +1 -1
- package/dist/utils/worker-events.js +3 -5
- package/dist/utils/worker-events.js.map +1 -1
- package/dist/utils/worker-utils.d.ts +2 -2
- package/dist/utils/worker-utils.d.ts.map +1 -1
- package/dist/utils/worker-utils.js +1 -1
- package/dist/utils/worker-utils.js.map +1 -1
- package/dist/workers/client.worker.d.ts +1 -1
- package/dist/workers/client.worker.js +3 -3
- package/dist/workers/client.worker.js.map +1 -1
- package/dist/workers/dts.worker.d.ts +1 -1
- package/dist/workers/dts.worker.d.ts.map +1 -1
- package/dist/workers/dts.worker.js +13 -28
- package/dist/workers/dts.worker.js.map +1 -1
- package/dist/workers/library.worker.d.ts +1 -1
- package/dist/workers/library.worker.js +4 -4
- package/dist/workers/library.worker.js.map +1 -1
- package/dist/workers/lint.worker.d.ts +1 -1
- package/dist/workers/server-runtime.worker.d.ts +1 -1
- package/dist/workers/server-runtime.worker.js +4 -4
- package/dist/workers/server-runtime.worker.js.map +1 -1
- package/dist/workers/server.worker.d.ts +1 -1
- package/dist/workers/server.worker.js +6 -6
- package/dist/workers/server.worker.js.map +1 -1
- package/package.json +4 -5
- package/src/builders/DtsBuilder.ts +2 -2
- package/src/builders/LibraryBuilder.ts +7 -10
- package/src/builders/types.ts +6 -1
- package/src/capacitor/capacitor.ts +61 -60
- package/src/commands/check.ts +4 -4
- package/src/commands/device.ts +3 -3
- package/src/commands/lint.ts +6 -117
- package/src/commands/publish.ts +20 -20
- package/src/commands/replace-deps.ts +1 -1
- package/src/commands/typecheck.ts +9 -9
- package/src/electron/electron.ts +16 -16
- package/src/orchestrators/BuildOrchestrator.ts +6 -6
- package/src/orchestrators/DevOrchestrator.ts +210 -256
- package/src/orchestrators/WatchOrchestrator.ts +8 -10
- package/src/sd-cli.ts +1 -1
- package/src/sd-config.types.ts +10 -3
- package/src/utils/copy-public.ts +22 -26
- package/src/utils/copy-src.ts +7 -7
- package/src/utils/esbuild-config.ts +51 -63
- package/src/utils/replace-deps.ts +7 -7
- package/src/utils/sd-config.ts +2 -2
- package/src/utils/template.ts +7 -7
- package/src/utils/tsconfig.ts +6 -10
- package/src/utils/typecheck-serialization.ts +2 -2
- package/src/utils/vite-config.ts +376 -341
- package/src/utils/worker-events.ts +13 -10
- package/src/utils/worker-utils.ts +45 -45
- package/src/workers/client.worker.ts +3 -3
- package/src/workers/dts.worker.ts +451 -467
- package/src/workers/library.worker.ts +4 -4
- package/src/workers/server-runtime.worker.ts +4 -4
- package/src/workers/server.worker.ts +572 -572
- package/templates/init/package.json.hbs +2 -3
- package/templates/init/packages/client-admin/package.json.hbs +5 -5
- package/templates/init/packages/client-admin/src/views/auth/LoginView.tsx +2 -2
- package/templates/init/packages/client-admin/src/views/home/base/employee/EmployeeDetail.tsx.hbs +86 -105
- package/templates/init/packages/client-admin/src/views/home/base/employee/EmployeeSheet.tsx.hbs +1 -1
- package/templates/init/packages/client-admin/src/views/home/base/role-permission/RoleDetail.tsx.hbs +4 -12
- package/templates/init/packages/client-admin/src/views/home/base/role-permission/RolePermissionDetail.tsx.hbs +0 -2
- package/templates/init/packages/client-admin/src/views/home/base/role-permission/RolePermissionView.tsx +1 -1
- package/templates/init/packages/client-admin/src/views/home/base/role-permission/RoleSheet.tsx.hbs +1 -1
- package/templates/init/packages/client-admin/src/views/home/my-info/MyInfoDetail.tsx.hbs +36 -43
- package/templates/init/packages/db-main/package.json.hbs +2 -2
- package/templates/init/packages/server/package.json.hbs +4 -4
- package/templates/init/tests/e2e/package.json.hbs +1 -1
- package/tests/get-compiler-options-for-package.spec.ts +13 -72
- package/tests/get-package-source-files.spec.ts +0 -42
- package/tests/get-types-from-package-json.spec.ts +15 -30
- package/tests/infra/ResultCollector.spec.ts +0 -9
- package/tests/infra/WorkerManager.spec.ts +0 -34
- package/tests/load-ignore-patterns.spec.ts +15 -40
- package/tests/load-sd-config.spec.ts +16 -53
- package/tests/publish-config-narrowing.spec.ts +20 -0
- package/tests/run-lint.spec.ts +38 -87
- package/tests/run-typecheck.spec.ts +194 -303
- package/tests/run-watch.spec.ts +0 -34
- package/tests/sd-cli.spec.ts +0 -88
- package/tests/sd-public-dev-plugin-mime.spec.ts +19 -0
- package/dist/builders/index.d.ts +0 -5
- package/dist/builders/index.d.ts.map +0 -1
- package/dist/builders/index.js +0 -5
- package/dist/builders/index.js.map +0 -6
- package/dist/infra/index.d.ts +0 -4
- package/dist/infra/index.d.ts.map +0 -1
- package/dist/infra/index.js +0 -4
- package/dist/infra/index.js.map +0 -6
- package/dist/orchestrators/index.d.ts +0 -4
- package/dist/orchestrators/index.d.ts.map +0 -1
- package/dist/orchestrators/index.js +0 -4
- package/dist/orchestrators/index.js.map +0 -6
- package/src/builders/index.ts +0 -4
- package/src/infra/index.ts +0 -3
- package/src/orchestrators/index.ts +0 -3
- package/templates/init/stylelint.config.ts +0 -1
package/tests/sd-cli.spec.ts
CHANGED
|
@@ -74,15 +74,6 @@ describe("sd-cli", () => {
|
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
-
it("runs lint command without targets", async () => {
|
|
78
|
-
await createCliParser(["lint"]).parse();
|
|
79
|
-
|
|
80
|
-
expect(runLint).toHaveBeenCalledWith({
|
|
81
|
-
targets: [],
|
|
82
|
-
fix: false,
|
|
83
|
-
timing: false,
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
77
|
});
|
|
87
78
|
|
|
88
79
|
describe("typecheck command", () => {
|
|
@@ -124,15 +115,6 @@ describe("sd-cli", () => {
|
|
|
124
115
|
});
|
|
125
116
|
});
|
|
126
117
|
|
|
127
|
-
it("runs check command without targets", async () => {
|
|
128
|
-
await createCliParser(["check"]).parse();
|
|
129
|
-
|
|
130
|
-
expect(runCheck).toHaveBeenCalledWith({
|
|
131
|
-
targets: [],
|
|
132
|
-
types: ["typecheck", "lint", "test"],
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
|
|
136
118
|
it("specifies single type using --type option", async () => {
|
|
137
119
|
await createCliParser(["check", "--type", "test"]).parse();
|
|
138
120
|
|
|
@@ -153,32 +135,6 @@ describe("sd-cli", () => {
|
|
|
153
135
|
});
|
|
154
136
|
});
|
|
155
137
|
|
|
156
|
-
it("passes multiple targets to watch command", async () => {
|
|
157
|
-
await createCliParser(["watch", "solid", "solid-demo"]).parse();
|
|
158
|
-
|
|
159
|
-
expect(runWatch).toHaveBeenCalledWith({
|
|
160
|
-
targets: ["solid", "solid-demo"],
|
|
161
|
-
options: [],
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
it("runs watch command without targets", async () => {
|
|
166
|
-
await createCliParser(["watch"]).parse();
|
|
167
|
-
|
|
168
|
-
expect(runWatch).toHaveBeenCalledWith({
|
|
169
|
-
targets: [],
|
|
170
|
-
options: [],
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
it("passes --options option correctly", async () => {
|
|
175
|
-
await createCliParser(["watch", "-o", "dev"]).parse();
|
|
176
|
-
|
|
177
|
-
expect(runWatch).toHaveBeenCalledWith({
|
|
178
|
-
targets: [],
|
|
179
|
-
options: ["dev"],
|
|
180
|
-
});
|
|
181
|
-
});
|
|
182
138
|
});
|
|
183
139
|
|
|
184
140
|
describe("build command", () => {
|
|
@@ -191,23 +147,6 @@ describe("sd-cli", () => {
|
|
|
191
147
|
});
|
|
192
148
|
});
|
|
193
149
|
|
|
194
|
-
it("runs build command without targets", async () => {
|
|
195
|
-
await createCliParser(["build"]).parse();
|
|
196
|
-
|
|
197
|
-
expect(runBuild).toHaveBeenCalledWith({
|
|
198
|
-
targets: [],
|
|
199
|
-
options: [],
|
|
200
|
-
});
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
it("passes --options option correctly", async () => {
|
|
204
|
-
await createCliParser(["build", "-o", "prod"]).parse();
|
|
205
|
-
|
|
206
|
-
expect(runBuild).toHaveBeenCalledWith({
|
|
207
|
-
targets: [],
|
|
208
|
-
options: ["prod"],
|
|
209
|
-
});
|
|
210
|
-
});
|
|
211
150
|
});
|
|
212
151
|
|
|
213
152
|
describe("publish command", () => {
|
|
@@ -222,17 +161,6 @@ describe("sd-cli", () => {
|
|
|
222
161
|
});
|
|
223
162
|
});
|
|
224
163
|
|
|
225
|
-
it("runs publish command without targets", async () => {
|
|
226
|
-
await createCliParser(["publish"]).parse();
|
|
227
|
-
|
|
228
|
-
expect(runPublish).toHaveBeenCalledWith({
|
|
229
|
-
targets: [],
|
|
230
|
-
noBuild: false,
|
|
231
|
-
dryRun: false,
|
|
232
|
-
options: [],
|
|
233
|
-
});
|
|
234
|
-
});
|
|
235
|
-
|
|
236
164
|
it("passes --no-build option correctly", async () => {
|
|
237
165
|
await createCliParser(["publish", "--no-build"]).parse();
|
|
238
166
|
|
|
@@ -277,16 +205,6 @@ describe("sd-cli", () => {
|
|
|
277
205
|
});
|
|
278
206
|
});
|
|
279
207
|
|
|
280
|
-
it("uses --dry-run with other options together", async () => {
|
|
281
|
-
await createCliParser(["publish", "solid", "--dry-run", "-o", "prod"]).parse();
|
|
282
|
-
|
|
283
|
-
expect(runPublish).toHaveBeenCalledWith({
|
|
284
|
-
targets: ["solid"],
|
|
285
|
-
noBuild: false,
|
|
286
|
-
dryRun: true,
|
|
287
|
-
options: ["prod"],
|
|
288
|
-
});
|
|
289
|
-
});
|
|
290
208
|
});
|
|
291
209
|
|
|
292
210
|
describe("global --debug option", () => {
|
|
@@ -296,12 +214,6 @@ describe("sd-cli", () => {
|
|
|
296
214
|
expect(consola.level).toBe(LogLevels.debug);
|
|
297
215
|
});
|
|
298
216
|
|
|
299
|
-
it("does not change consola.level without --debug", async () => {
|
|
300
|
-
const levelBefore = consola.level;
|
|
301
|
-
await createCliParser(["lint"]).parse();
|
|
302
|
-
|
|
303
|
-
expect(consola.level).toBe(levelBefore);
|
|
304
|
-
});
|
|
305
217
|
});
|
|
306
218
|
|
|
307
219
|
describe("error handling", () => {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { getMimeType } from "../src/utils/vite-config";
|
|
3
|
+
|
|
4
|
+
describe("getMimeType", () => {
|
|
5
|
+
it("returns correct MIME for common web types", () => {
|
|
6
|
+
expect(getMimeType(".html")).toBe("text/html");
|
|
7
|
+
expect(getMimeType(".css")).toBe("text/css");
|
|
8
|
+
expect(getMimeType(".js")).toBe("text/javascript");
|
|
9
|
+
expect(getMimeType(".json")).toBe("application/json");
|
|
10
|
+
expect(getMimeType(".png")).toBe("image/png");
|
|
11
|
+
expect(getMimeType(".svg")).toBe("image/svg+xml");
|
|
12
|
+
expect(getMimeType(".woff2")).toBe("font/woff2");
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it("returns application/octet-stream for unknown extensions", () => {
|
|
16
|
+
expect(getMimeType(".xyz")).toBe("application/octet-stream");
|
|
17
|
+
expect(getMimeType("")).toBe("application/octet-stream");
|
|
18
|
+
});
|
|
19
|
+
});
|
package/dist/builders/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["..\\..\\src\\builders\\index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC"}
|
package/dist/builders/index.js
DELETED
package/dist/infra/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["..\\..\\src\\infra\\index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
|
package/dist/infra/index.js
DELETED
package/dist/infra/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["..\\..\\src\\orchestrators\\index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
|
package/src/builders/index.ts
DELETED
package/src/infra/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "@simplysm/lint/stylelint-recommended";
|