@simplysm/sd-cli 13.0.68 → 13.0.70
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 +10 -957
- package/dist/builders/BaseBuilder.d.ts +23 -23
- package/dist/builders/BaseBuilder.d.ts.map +1 -1
- package/dist/builders/BaseBuilder.js +15 -15
- package/dist/builders/DtsBuilder.d.ts +4 -4
- package/dist/builders/DtsBuilder.js +1 -1
- package/dist/builders/LibraryBuilder.d.ts +3 -3
- package/dist/builders/types.d.ts +10 -10
- package/dist/capacitor/capacitor.d.ts +36 -36
- package/dist/capacitor/capacitor.js +63 -63
- package/dist/capacitor/capacitor.js.map +1 -1
- package/dist/commands/add-client.d.ts +8 -8
- package/dist/commands/add-client.js +15 -15
- package/dist/commands/add-client.js.map +1 -1
- package/dist/commands/add-server.d.ts +9 -9
- package/dist/commands/add-server.js +13 -13
- package/dist/commands/add-server.js.map +1 -1
- package/dist/commands/build.d.ts +9 -9
- package/dist/commands/check.js +3 -3
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/dev.d.ts +9 -9
- package/dist/commands/device.d.ts +9 -9
- package/dist/commands/device.d.ts.map +1 -1
- package/dist/commands/device.js +17 -17
- package/dist/commands/device.js.map +1 -1
- package/dist/commands/init.d.ts +6 -6
- package/dist/commands/init.js +12 -12
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/lint.d.ts +23 -23
- package/dist/commands/lint.d.ts.map +1 -1
- package/dist/commands/lint.js +25 -25
- package/dist/commands/lint.js.map +1 -1
- package/dist/commands/publish.d.ts +13 -13
- package/dist/commands/publish.d.ts.map +1 -1
- package/dist/commands/publish.js +61 -61
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/replace-deps.d.ts +3 -3
- package/dist/commands/replace-deps.d.ts.map +1 -1
- package/dist/commands/replace-deps.js +1 -1
- package/dist/commands/replace-deps.js.map +1 -1
- package/dist/commands/typecheck.d.ts +20 -20
- package/dist/commands/typecheck.d.ts.map +1 -1
- package/dist/commands/typecheck.js +20 -20
- package/dist/commands/typecheck.js.map +1 -1
- package/dist/commands/watch.d.ts +7 -7
- package/dist/electron/electron.d.ts +27 -27
- package/dist/electron/electron.js +32 -32
- package/dist/electron/electron.js.map +1 -1
- package/dist/infra/ResultCollector.d.ts +9 -9
- package/dist/infra/ResultCollector.js +5 -5
- package/dist/infra/SignalHandler.d.ts +7 -7
- package/dist/infra/SignalHandler.js +4 -4
- package/dist/infra/WorkerManager.d.ts +14 -14
- package/dist/infra/WorkerManager.js +11 -11
- package/dist/orchestrators/BuildOrchestrator.d.ts +19 -19
- package/dist/orchestrators/BuildOrchestrator.d.ts.map +1 -1
- package/dist/orchestrators/BuildOrchestrator.js +26 -26
- package/dist/orchestrators/BuildOrchestrator.js.map +1 -1
- package/dist/orchestrators/DevOrchestrator.d.ts +25 -25
- package/dist/orchestrators/DevOrchestrator.d.ts.map +1 -1
- package/dist/orchestrators/DevOrchestrator.js +30 -30
- package/dist/orchestrators/DevOrchestrator.js.map +1 -1
- package/dist/orchestrators/WatchOrchestrator.d.ts +13 -13
- package/dist/orchestrators/WatchOrchestrator.js +17 -17
- package/dist/orchestrators/WatchOrchestrator.js.map +1 -1
- package/dist/sd-cli-entry.d.ts +2 -2
- package/dist/sd-cli-entry.js +38 -38
- package/dist/sd-cli-entry.js.map +1 -1
- package/dist/sd-cli.d.ts +2 -2
- package/dist/sd-cli.js +1 -1
- package/dist/sd-cli.js.map +1 -1
- package/dist/sd-config.types.d.ts +84 -84
- package/dist/sd-config.types.d.ts.map +1 -1
- package/dist/utils/build-env.d.ts +1 -1
- package/dist/utils/config-editor.d.ts +5 -5
- package/dist/utils/config-editor.js +2 -2
- package/dist/utils/config-editor.js.map +1 -1
- package/dist/utils/copy-public.d.ts +9 -9
- package/dist/utils/copy-src.d.ts +9 -9
- package/dist/utils/esbuild-config.d.ts +30 -30
- package/dist/utils/esbuild-config.d.ts.map +1 -1
- package/dist/utils/output-utils.d.ts +6 -6
- package/dist/utils/package-utils.d.ts +6 -6
- package/dist/utils/package-utils.js +1 -1
- package/dist/utils/package-utils.js.map +1 -1
- package/dist/utils/rebuild-manager.js +3 -3
- package/dist/utils/rebuild-manager.js.map +1 -1
- package/dist/utils/replace-deps.d.ts +25 -25
- package/dist/utils/replace-deps.js +3 -3
- package/dist/utils/replace-deps.js.map +1 -1
- package/dist/utils/sd-config.d.ts +3 -3
- package/dist/utils/sd-config.js +3 -3
- package/dist/utils/sd-config.js.map +1 -1
- package/dist/utils/tailwind-config-deps.d.ts +3 -3
- package/dist/utils/template.d.ts +8 -8
- package/dist/utils/tsconfig.d.ts +16 -16
- package/dist/utils/tsconfig.js +2 -2
- package/dist/utils/tsconfig.js.map +1 -1
- package/dist/utils/typecheck-serialization.d.ts +8 -8
- package/dist/utils/vite-config.d.ts +8 -8
- package/dist/utils/vite-config.d.ts.map +1 -1
- package/dist/utils/vite-config.js +3 -3
- package/dist/utils/worker-events.d.ts +12 -12
- package/dist/utils/worker-events.d.ts.map +1 -1
- package/dist/utils/worker-utils.d.ts +3 -3
- package/dist/utils/worker-utils.js +2 -2
- package/dist/utils/worker-utils.js.map +1 -1
- package/dist/workers/client.worker.d.ts +14 -14
- package/dist/workers/client.worker.d.ts.map +1 -1
- package/dist/workers/client.worker.js +1 -1
- package/dist/workers/client.worker.js.map +1 -1
- package/dist/workers/dts.worker.d.ts +13 -13
- package/dist/workers/dts.worker.d.ts.map +1 -1
- package/dist/workers/dts.worker.js +3 -3
- package/dist/workers/dts.worker.js.map +1 -1
- package/dist/workers/library.worker.d.ts +12 -12
- package/dist/workers/library.worker.js +1 -1
- 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 +6 -6
- package/dist/workers/server-runtime.worker.js +6 -6
- package/dist/workers/server-runtime.worker.js.map +1 -1
- package/dist/workers/server.worker.d.ts +20 -20
- package/dist/workers/server.worker.d.ts.map +1 -1
- package/dist/workers/server.worker.js +6 -6
- package/dist/workers/server.worker.js.map +1 -1
- package/package.json +8 -7
- package/src/builders/BaseBuilder.ts +33 -33
- package/src/builders/DtsBuilder.ts +5 -5
- package/src/builders/LibraryBuilder.ts +9 -9
- package/src/builders/types.ts +10 -10
- package/src/capacitor/capacitor.ts +119 -119
- package/src/commands/add-client.ts +31 -31
- package/src/commands/add-server.ts +34 -34
- package/src/commands/build.ts +9 -9
- package/src/commands/check.ts +5 -5
- package/src/commands/dev.ts +9 -9
- package/src/commands/device.ts +30 -30
- package/src/commands/init.ts +25 -25
- package/src/commands/lint.ts +64 -64
- package/src/commands/publish.ts +139 -139
- package/src/commands/replace-deps.ts +4 -4
- package/src/commands/typecheck.ts +74 -74
- package/src/commands/watch.ts +7 -7
- package/src/electron/electron.ts +51 -51
- package/src/infra/ResultCollector.ts +9 -9
- package/src/infra/SignalHandler.ts +7 -7
- package/src/infra/WorkerManager.ts +14 -14
- package/src/orchestrators/BuildOrchestrator.ts +76 -76
- package/src/orchestrators/DevOrchestrator.ts +88 -88
- package/src/orchestrators/WatchOrchestrator.ts +39 -39
- package/src/sd-cli-entry.ts +43 -43
- package/src/sd-cli.ts +15 -15
- package/src/sd-config.types.ts +85 -85
- package/src/utils/build-env.ts +1 -1
- package/src/utils/config-editor.ts +19 -19
- package/src/utils/copy-public.ts +17 -17
- package/src/utils/copy-src.ts +11 -11
- package/src/utils/esbuild-config.ts +33 -33
- package/src/utils/output-utils.ts +11 -11
- package/src/utils/package-utils.ts +12 -12
- package/src/utils/rebuild-manager.ts +3 -3
- package/src/utils/replace-deps.ts +361 -361
- package/src/utils/sd-config.ts +44 -44
- package/src/utils/tailwind-config-deps.ts +98 -98
- package/src/utils/template.ts +56 -56
- package/src/utils/tsconfig.ts +127 -127
- package/src/utils/typecheck-serialization.ts +86 -86
- package/src/utils/vite-config.ts +341 -341
- package/src/utils/worker-events.ts +16 -16
- package/src/utils/worker-utils.ts +45 -45
- package/src/workers/client.worker.ts +34 -34
- package/src/workers/dts.worker.ts +467 -467
- package/src/workers/library.worker.ts +314 -314
- package/src/workers/lint.worker.ts +16 -16
- package/src/workers/server-runtime.worker.ts +157 -157
- package/src/workers/server.worker.ts +572 -572
- package/templates/add-client/__CLIENT__/package.json.hbs +1 -1
- package/templates/add-server/__SERVER__/package.json.hbs +2 -2
- package/templates/init/package.json.hbs +3 -3
- package/tests/config-editor.spec.ts +160 -0
- package/tests/copy-src.spec.ts +50 -0
- package/tests/get-compiler-options-for-package.spec.ts +139 -0
- package/tests/get-package-source-files.spec.ts +181 -0
- package/tests/get-types-from-package-json.spec.ts +107 -0
- package/tests/infra/ResultCollector.spec.ts +39 -0
- package/tests/infra/SignalHandler.spec.ts +38 -0
- package/tests/infra/WorkerManager.spec.ts +97 -0
- package/tests/load-ignore-patterns.spec.ts +188 -0
- package/tests/load-sd-config.spec.ts +137 -0
- package/tests/package-utils.spec.ts +188 -0
- package/tests/parse-root-tsconfig.spec.ts +89 -0
- package/tests/replace-deps.spec.ts +308 -0
- package/tests/run-lint.spec.ts +415 -0
- package/tests/run-typecheck.spec.ts +653 -0
- package/tests/run-watch.spec.ts +75 -0
- package/tests/sd-cli.spec.ts +330 -0
- package/tests/tailwind-config-deps.spec.ts +30 -0
- package/tests/template.spec.ts +70 -0
- package/tests/utils/rebuild-manager.spec.ts +43 -0
- package/tests/write-changed-output-files.spec.ts +97 -0
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* - node: Node.js
|
|
4
|
-
* - browser:
|
|
5
|
-
* - neutral: Node
|
|
2
|
+
* Build target type (built with esbuild)
|
|
3
|
+
* - node: Node.js only package
|
|
4
|
+
* - browser: browser only package
|
|
5
|
+
* - neutral: Node/browser shared package
|
|
6
6
|
*/
|
|
7
7
|
export type BuildTarget = "node" | "browser" | "neutral";
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
* - "npm": npm
|
|
11
|
-
* - SdLocalDirectoryPublishConfig:
|
|
12
|
-
* - SdStoragePublishConfig: FTP/FTPS/SFTP
|
|
9
|
+
* Package publish configuration
|
|
10
|
+
* - "npm": deploy to npm registry
|
|
11
|
+
* - SdLocalDirectoryPublishConfig: copy to local directory
|
|
12
|
+
* - SdStoragePublishConfig: upload to FTP/FTPS/SFTP server
|
|
13
13
|
*/
|
|
14
14
|
export type SdPublishConfig = "npm" | SdLocalDirectoryPublishConfig | SdStoragePublishConfig;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Local directory publish configuration
|
|
17
17
|
*/
|
|
18
18
|
export interface SdLocalDirectoryPublishConfig {
|
|
19
19
|
type: "local-directory";
|
|
20
|
-
/**
|
|
20
|
+
/** deployment target path (supports environment variable substitution: %VER%, %PROJECT%) */
|
|
21
21
|
path: string;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Storage (FTP/FTPS/SFTP) publish configuration
|
|
25
25
|
*/
|
|
26
26
|
export interface SdStoragePublishConfig {
|
|
27
27
|
type: "ftp" | "ftps" | "sftp";
|
|
@@ -32,202 +32,202 @@ export interface SdStoragePublishConfig {
|
|
|
32
32
|
pass?: string;
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
|
-
* postPublish
|
|
35
|
+
* postPublish script configuration
|
|
36
36
|
*/
|
|
37
37
|
export interface SdPostPublishScriptConfig {
|
|
38
38
|
type: "script";
|
|
39
39
|
cmd: string;
|
|
40
|
-
/**
|
|
40
|
+
/** script arguments (supports environment variable substitution: %VER%, %PROJECT%) */
|
|
41
41
|
args: string[];
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Package configuration (node/browser/neutral)
|
|
45
45
|
*/
|
|
46
46
|
export interface SdBuildPackageConfig {
|
|
47
|
-
/**
|
|
47
|
+
/** build target */
|
|
48
48
|
target: BuildTarget;
|
|
49
|
-
/** publish
|
|
49
|
+
/** publish configuration */
|
|
50
50
|
publish?: SdPublishConfig;
|
|
51
|
-
/**
|
|
51
|
+
/** glob patterns for files to copy from src/ to dist/ (relative path based on src/) */
|
|
52
52
|
copySrc?: string[];
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
|
-
* Capacitor Android
|
|
55
|
+
* Capacitor Android sign configuration
|
|
56
56
|
*/
|
|
57
57
|
export interface SdCapacitorSignConfig {
|
|
58
|
-
/** keystore
|
|
58
|
+
/** keystore file path (relative path based on package directory) */
|
|
59
59
|
keystore: string;
|
|
60
|
-
/** keystore
|
|
60
|
+
/** keystore password */
|
|
61
61
|
storePassword: string;
|
|
62
|
-
/**
|
|
62
|
+
/** key alias */
|
|
63
63
|
alias: string;
|
|
64
|
-
/**
|
|
64
|
+
/** key password */
|
|
65
65
|
password: string;
|
|
66
|
-
/** keystore
|
|
66
|
+
/** keystore type (default: "jks") */
|
|
67
67
|
keystoreType?: string;
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
|
-
* Capacitor Android
|
|
70
|
+
* Capacitor Android permission configuration
|
|
71
71
|
*/
|
|
72
72
|
export interface SdCapacitorPermission {
|
|
73
|
-
/**
|
|
73
|
+
/** permission name (e.g., "CAMERA", "WRITE_EXTERNAL_STORAGE") */
|
|
74
74
|
name: string;
|
|
75
|
-
/**
|
|
75
|
+
/** maximum SDK version */
|
|
76
76
|
maxSdkVersion?: number;
|
|
77
|
-
/** tools:ignore
|
|
77
|
+
/** tools:ignore attribute value */
|
|
78
78
|
ignore?: string;
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
|
-
* Capacitor Android Intent Filter
|
|
81
|
+
* Capacitor Android Intent Filter configuration
|
|
82
82
|
*/
|
|
83
83
|
export interface SdCapacitorIntentFilter {
|
|
84
|
-
/** intent action (
|
|
84
|
+
/** intent action (e.g., "android.intent.action.VIEW") */
|
|
85
85
|
action?: string;
|
|
86
|
-
/** intent category (
|
|
86
|
+
/** intent category (e.g., "android.intent.category.DEFAULT") */
|
|
87
87
|
category?: string;
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
|
-
* Capacitor Android
|
|
90
|
+
* Capacitor Android platform configuration
|
|
91
91
|
*/
|
|
92
92
|
export interface SdCapacitorAndroidConfig {
|
|
93
|
-
/** AndroidManifest.xml application
|
|
93
|
+
/** AndroidManifest.xml application tag attributes (e.g., { requestLegacyExternalStorage: "true" }) */
|
|
94
94
|
config?: Record<string, string>;
|
|
95
|
-
/** AAB
|
|
95
|
+
/** AAB bundle build flag (false for APK) */
|
|
96
96
|
bundle?: boolean;
|
|
97
|
-
/** Intent Filter
|
|
97
|
+
/** Intent Filter configuration */
|
|
98
98
|
intentFilters?: SdCapacitorIntentFilter[];
|
|
99
|
-
/** APK/AAB
|
|
99
|
+
/** APK/AAB signing configuration */
|
|
100
100
|
sign?: SdCapacitorSignConfig;
|
|
101
|
-
/** Android SDK
|
|
101
|
+
/** Android SDK version (minSdk, targetSdk) */
|
|
102
102
|
sdkVersion?: number;
|
|
103
|
-
/**
|
|
103
|
+
/** additional permission configuration */
|
|
104
104
|
permissions?: SdCapacitorPermission[];
|
|
105
105
|
}
|
|
106
106
|
/**
|
|
107
|
-
* Capacitor
|
|
107
|
+
* Capacitor configuration
|
|
108
108
|
*/
|
|
109
109
|
export interface SdCapacitorConfig {
|
|
110
|
-
/**
|
|
110
|
+
/** app ID (e.g., "com.example.app") */
|
|
111
111
|
appId: string;
|
|
112
|
-
/**
|
|
112
|
+
/** app name */
|
|
113
113
|
appName: string;
|
|
114
|
-
/** Capacitor
|
|
114
|
+
/** Capacitor plugin configuration (key: package name, value: true or plugin options) */
|
|
115
115
|
plugins?: Record<string, Record<string, unknown> | true>;
|
|
116
|
-
/**
|
|
116
|
+
/** app icon path (relative path based on package directory) */
|
|
117
117
|
icon?: string;
|
|
118
|
-
/**
|
|
118
|
+
/** debug build flag */
|
|
119
119
|
debug?: boolean;
|
|
120
|
-
/**
|
|
120
|
+
/** per-platform configuration */
|
|
121
121
|
platform?: {
|
|
122
122
|
android?: SdCapacitorAndroidConfig;
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
125
|
/**
|
|
126
|
-
* Electron
|
|
126
|
+
* Electron configuration
|
|
127
127
|
*/
|
|
128
128
|
export interface SdElectronConfig {
|
|
129
|
-
/** Electron
|
|
129
|
+
/** Electron app ID (e.g., "com.example.myapp") */
|
|
130
130
|
appId: string;
|
|
131
|
-
/** portable .exe (true)
|
|
131
|
+
/** portable .exe (true) or NSIS installer (false/unspecified) */
|
|
132
132
|
portable?: boolean;
|
|
133
|
-
/**
|
|
133
|
+
/** installer icon path (.ico, relative path based on package directory) */
|
|
134
134
|
installerIcon?: string;
|
|
135
|
-
/**
|
|
135
|
+
/** npm packages to include in Electron (native modules, etc.) */
|
|
136
136
|
reinstallDependencies?: string[];
|
|
137
|
-
/** npm postinstall
|
|
137
|
+
/** npm postinstall script */
|
|
138
138
|
postInstallScript?: string;
|
|
139
|
-
/** NSIS
|
|
139
|
+
/** NSIS options (when portable is false) */
|
|
140
140
|
nsisOptions?: Record<string, unknown>;
|
|
141
|
-
/**
|
|
141
|
+
/** environment variables (accessible via process.env in electron-main.ts) */
|
|
142
142
|
env?: Record<string, string>;
|
|
143
143
|
}
|
|
144
144
|
/**
|
|
145
|
-
*
|
|
145
|
+
* Client package configuration (Vite development server)
|
|
146
146
|
*/
|
|
147
147
|
export interface SdClientPackageConfig {
|
|
148
|
-
/**
|
|
148
|
+
/** build target */
|
|
149
149
|
target: "client";
|
|
150
150
|
/**
|
|
151
|
-
*
|
|
152
|
-
* - string:
|
|
153
|
-
* - number: Vite
|
|
151
|
+
* server configuration
|
|
152
|
+
* - string: server package name to connect to (e.g., "solid-demo-server")
|
|
153
|
+
* - number: use Vite port directly (backward compatibility)
|
|
154
154
|
*/
|
|
155
155
|
server: string | number;
|
|
156
|
-
/**
|
|
156
|
+
/** environment variables to substitute during build (replace process.env with object) */
|
|
157
157
|
env?: Record<string, string>;
|
|
158
|
-
/** publish
|
|
158
|
+
/** publish configuration */
|
|
159
159
|
publish?: SdPublishConfig;
|
|
160
|
-
/** Capacitor
|
|
160
|
+
/** Capacitor configuration */
|
|
161
161
|
capacitor?: SdCapacitorConfig;
|
|
162
|
-
/** Electron
|
|
162
|
+
/** Electron configuration */
|
|
163
163
|
electron?: SdElectronConfig;
|
|
164
164
|
/** runtime config (written to dist/.config.json during build) */
|
|
165
165
|
configs?: Record<string, unknown>;
|
|
166
166
|
}
|
|
167
167
|
/**
|
|
168
|
-
*
|
|
168
|
+
* Server package configuration (Fastify server)
|
|
169
169
|
*/
|
|
170
170
|
export interface SdServerPackageConfig {
|
|
171
|
-
/**
|
|
171
|
+
/** build target */
|
|
172
172
|
target: "server";
|
|
173
|
-
/**
|
|
173
|
+
/** environment variables to substitute during build (replace process.env.KEY with constant) */
|
|
174
174
|
env?: Record<string, string>;
|
|
175
|
-
/** publish
|
|
175
|
+
/** publish configuration */
|
|
176
176
|
publish?: SdPublishConfig;
|
|
177
177
|
/** runtime config (written to dist/.config.json during build) */
|
|
178
178
|
configs?: Record<string, unknown>;
|
|
179
|
-
/**
|
|
179
|
+
/** external modules not to include in esbuild bundle (in addition to automatic binding.gyp detection) */
|
|
180
180
|
externals?: string[];
|
|
181
|
-
/** PM2
|
|
181
|
+
/** PM2 configuration (generates dist/pm2.config.cjs when specified) */
|
|
182
182
|
pm2?: {
|
|
183
|
-
/** PM2
|
|
183
|
+
/** PM2 process name (generated from package.json name if unspecified) */
|
|
184
184
|
name?: string;
|
|
185
|
-
/** PM2 watch
|
|
185
|
+
/** paths to exclude from PM2 watch */
|
|
186
186
|
ignoreWatchPaths?: string[];
|
|
187
187
|
};
|
|
188
188
|
/** Package manager to use (affects mise.toml or volta settings generation) */
|
|
189
189
|
packageManager?: "volta" | "mise";
|
|
190
190
|
}
|
|
191
191
|
/**
|
|
192
|
-
*
|
|
192
|
+
* Scripts-only package configuration (excluded from watch/typecheck)
|
|
193
193
|
*/
|
|
194
194
|
export interface SdScriptsPackageConfig {
|
|
195
|
-
/**
|
|
195
|
+
/** build target */
|
|
196
196
|
target: "scripts";
|
|
197
197
|
}
|
|
198
198
|
/**
|
|
199
|
-
*
|
|
199
|
+
* Package configuration
|
|
200
200
|
*/
|
|
201
201
|
export type SdPackageConfig = SdBuildPackageConfig | SdClientPackageConfig | SdServerPackageConfig | SdScriptsPackageConfig;
|
|
202
202
|
/**
|
|
203
|
-
* sd.config.ts
|
|
203
|
+
* sd.config.ts configuration type
|
|
204
204
|
*/
|
|
205
205
|
export interface SdConfig {
|
|
206
|
-
/**
|
|
206
|
+
/** per-package configuration (key: subdirectory name under packages/, e.g., "core-common") */
|
|
207
207
|
packages: Record<string, SdPackageConfig | undefined>;
|
|
208
208
|
/**
|
|
209
|
-
*
|
|
210
|
-
* -
|
|
211
|
-
* -
|
|
212
|
-
* -
|
|
209
|
+
* dependency replacement configuration (replace node_modules packages with local sources via symlink)
|
|
210
|
+
* - key: package glob pattern to find in node_modules (e.g., "@simplysm/*")
|
|
211
|
+
* - value: source directory path (captured values from key's * are substituted into value's *)
|
|
212
|
+
* - example: { "@simplysm/*": "../simplysm/packages/*" }
|
|
213
213
|
*/
|
|
214
214
|
replaceDeps?: Record<string, string>;
|
|
215
|
-
/**
|
|
215
|
+
/** script to execute after deployment completes */
|
|
216
216
|
postPublish?: SdPostPublishScriptConfig[];
|
|
217
217
|
}
|
|
218
218
|
/**
|
|
219
|
-
* sd.config.ts
|
|
219
|
+
* parameters passed to sd.config.ts function
|
|
220
220
|
*/
|
|
221
221
|
export interface SdConfigParams {
|
|
222
|
-
/**
|
|
222
|
+
/** current working directory */
|
|
223
223
|
cwd: string;
|
|
224
|
-
/**
|
|
224
|
+
/** development mode flag */
|
|
225
225
|
dev: boolean;
|
|
226
|
-
/**
|
|
226
|
+
/** additional options (from CLI's -o flag) */
|
|
227
227
|
opt: string[];
|
|
228
228
|
}
|
|
229
229
|
/**
|
|
230
|
-
* sd.config.ts
|
|
230
|
+
* sd.config.ts must default export a function of the following form:
|
|
231
231
|
*
|
|
232
232
|
* ```typescript
|
|
233
233
|
* import type { SdConfig, SdConfigFn, SdConfigParams } from "@simplysm/sd-cli";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-config.types.d.ts","sourceRoot":"","sources":["..\\src\\sd-config.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AAIzD;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,6BAA6B,GAAG,sBAAsB,CAAC;AAE7F;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,iBAAiB,CAAC;IACxB,
|
|
1
|
+
{"version":3,"file":"sd-config.types.d.ts","sourceRoot":"","sources":["..\\src\\sd-config.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AAIzD;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,6BAA6B,GAAG,sBAAsB,CAAC;AAE7F;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,iBAAiB,CAAC;IACxB,4FAA4F;IAC5F,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,sFAAsF;IACtF,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAID;;GAEG;AACH,MAAM,WAAW,oBA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B;IAC5B,GAAG,EAAE,OAAO,CAAC;IACb,8CAA8C;IAC9C,GAAG,EAAE,MAAM,EAAE,CAAC;CACf;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,cAAc,KAAK,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Add new package entry to packages object in sd.config.ts
|
|
3
3
|
*
|
|
4
|
-
* @returns true:
|
|
4
|
+
* @returns true: success, false: already exists
|
|
5
5
|
*/
|
|
6
6
|
export declare function addPackageToSdConfig(configPath: string, packageName: string, config: Record<string, unknown>): boolean;
|
|
7
7
|
/**
|
|
8
|
-
* sd.config.ts
|
|
8
|
+
* Set server field for specific client in sd.config.ts
|
|
9
9
|
*/
|
|
10
10
|
export declare function setClientServerInSdConfig(configPath: string, clientName: string, serverName: string): void;
|
|
11
11
|
/**
|
|
12
|
-
* eslint.config.ts
|
|
12
|
+
* Add tailwindcss config block to eslint.config.ts
|
|
13
13
|
*
|
|
14
|
-
* @returns true:
|
|
14
|
+
* @returns true: added, false: already exists
|
|
15
15
|
*/
|
|
16
16
|
export declare function addTailwindToEslintConfig(configPath: string, clientName: string): boolean;
|
|
17
17
|
//# sourceMappingURL=config-editor.d.ts.map
|
|
@@ -12,7 +12,7 @@ function findPackagesObject(configPath) {
|
|
|
12
12
|
const returnStmt = body.getFirstDescendantByKindOrThrow(SyntaxKind.ReturnStatement);
|
|
13
13
|
returnObj = returnStmt.getExpressionIfKindOrThrow(SyntaxKind.ObjectLiteralExpression);
|
|
14
14
|
} else {
|
|
15
|
-
throw new Error("sd.config.ts
|
|
15
|
+
throw new Error("Unable to recognize structure of sd.config.ts");
|
|
16
16
|
}
|
|
17
17
|
const packagesProp = returnObj.getPropertyOrThrow("packages").asKindOrThrow(SyntaxKind.PropertyAssignment);
|
|
18
18
|
const packagesObj = packagesProp.getInitializerIfKindOrThrow(SyntaxKind.ObjectLiteralExpression);
|
|
@@ -36,7 +36,7 @@ function setClientServerInSdConfig(configPath, clientName, serverName) {
|
|
|
36
36
|
const { project, packagesObj } = findPackagesObject(configPath);
|
|
37
37
|
const clientPropNode = packagesObj.getProperty(`"${clientName}"`) ?? packagesObj.getProperty(clientName);
|
|
38
38
|
if (clientPropNode == null) {
|
|
39
|
-
throw new Error(
|
|
39
|
+
throw new Error(`Client "${clientName}" not found in sd.config.ts`);
|
|
40
40
|
}
|
|
41
41
|
const clientProp = clientPropNode.asKindOrThrow(SyntaxKind.PropertyAssignment);
|
|
42
42
|
const clientObj = clientProp.getInitializerIfKindOrThrow(SyntaxKind.ObjectLiteralExpression);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/config-editor.ts"],
|
|
4
|
-
"mappings": "AAAA,SAAS,SAAS,kBAAgD;AAQlE,SAAS,mBAAmB,YAG1B;AACA,QAAM,UAAU,IAAI,QAAQ;AAC5B,QAAM,aAAa,QAAQ,oBAAoB,UAAU;AAGzD,QAAM,YAAY,WAAW,8BAA8B,QAAQ;AACnE,QAAM,UAAU,UAAU,4BAA4B,WAAW,aAAa;AAG9E,QAAM,OAAO,QAAQ,QAAQ;AAC7B,MAAI;AAEJ,MAAI,KAAK,OAAO,WAAW,uBAAuB,GAAG;AACnD,gBAAY,KAAK,2BAA2B,WAAW,uBAAuB;AAAA,EAChF,WAAW,KAAK,OAAO,WAAW,KAAK,GAAG;AACxC,UAAM,aAAa,KAAK,gCAAgC,WAAW,eAAe;AAClF,gBAAY,WAAW,2BAA2B,WAAW,uBAAuB;AAAA,EACtF,OAAO;AACL,UAAM,IAAI,MAAM
|
|
4
|
+
"mappings": "AAAA,SAAS,SAAS,kBAAgD;AAQlE,SAAS,mBAAmB,YAG1B;AACA,QAAM,UAAU,IAAI,QAAQ;AAC5B,QAAM,aAAa,QAAQ,oBA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AAM,aAAa,eAAe,cAAc,WAAW,kBAAkB;AAC7E,QAAM,YAAY,WAAW,4BAA4B,WAAW,uBAAuB;AAG3F,QAAM,aAAa,UAAU,YAAY,QAAQ;AACjD,MAAI,YAAY;AACd,eAAW,OAAO;AAAA,EACpB;AAGA,YAAU,sBAAsB;AAAA,IAC9B,MAAM;AAAA,IACN,aAAa,IAAI,UAAU;AAAA,EAC7B,CAAC;AAED,UAAQ,SAAS;AACnB;AAOO,SAAS,0BAA0B,YAAoB,YAA6B;AACzF,QAAM,UAAU,IAAI,QAAQ;AAC5B,QAAM,aAAa,QAAQ,oBAAoB,UAAU;AAGzD,QAAM,gBAAgB,WAAW;AAAA,IAC/B,WAAW;AAAA,EACb;AAGA,QAAM,OAAO,cAAc,QAAQ;AACnC,MAAI,KAAK,SAAS,aAAa,GAAG;AAChC,WAAO;AAAA,EACT;AAGA,gBAAc,WAAW;AAAA;AAAA;AAAA;AAAA,4BAIC,UAAU;AAAA;AAAA;AAAA,IAGlC;AAEF,UAAQ,SAAS;AACjB,SAAO;AACT;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { FsWatcher } from "@simplysm/core-node";
|
|
2
2
|
/**
|
|
3
|
-
* public/
|
|
4
|
-
* public-dev
|
|
3
|
+
* Copy files from public/ and public-dev/ directories to dist/.
|
|
4
|
+
* public-dev/ takes priority over public/ (overlay).
|
|
5
5
|
*
|
|
6
|
-
* @param pkgDir
|
|
7
|
-
* @param includeDev public-dev/
|
|
6
|
+
* @param pkgDir Package root directory
|
|
7
|
+
* @param includeDev Whether to include public-dev/ (true only in dev mode)
|
|
8
8
|
*/
|
|
9
9
|
export declare function copyPublicFiles(pkgDir: string, includeDev: boolean): Promise<void>;
|
|
10
10
|
/**
|
|
11
|
-
* public/
|
|
12
|
-
*
|
|
11
|
+
* Watch public/ and public-dev/ directories and copy files to dist/ in real-time.
|
|
12
|
+
* Automatically reflects changes/additions/deletions after initial copy.
|
|
13
13
|
*
|
|
14
|
-
* @param pkgDir
|
|
15
|
-
* @param includeDev public-dev/
|
|
16
|
-
* @returns FsWatcher
|
|
14
|
+
* @param pkgDir Package root directory
|
|
15
|
+
* @param includeDev Whether to include public-dev/ (true only in dev mode)
|
|
16
|
+
* @returns FsWatcher instance (must call close() on shutdown) or undefined if no watch targets
|
|
17
17
|
*/
|
|
18
18
|
export declare function watchPublicFiles(pkgDir: string, includeDev: boolean): Promise<FsWatcher | undefined>;
|
|
19
19
|
//# sourceMappingURL=copy-public.d.ts.map
|
package/dist/utils/copy-src.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { FsWatcher } from "@simplysm/core-node";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Copy files matching glob patterns from src/ to dist/
|
|
4
|
+
* Relative paths are preserved: src/a/b.css → dist/a/b.css
|
|
5
5
|
*
|
|
6
|
-
* @param pkgDir
|
|
7
|
-
* @param patterns glob
|
|
6
|
+
* @param pkgDir Package root directory
|
|
7
|
+
* @param patterns Array of glob patterns (relative to src/)
|
|
8
8
|
*/
|
|
9
9
|
export declare function copySrcFiles(pkgDir: string, patterns: string[]): Promise<void>;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Watch and copy files matching glob patterns from src/ to dist/
|
|
12
|
+
* Automatically reflects changes, additions, and deletions after initial copy.
|
|
13
13
|
*
|
|
14
|
-
* @param pkgDir
|
|
15
|
-
* @param patterns glob
|
|
16
|
-
* @returns FsWatcher
|
|
14
|
+
* @param pkgDir Package root directory
|
|
15
|
+
* @param patterns Array of glob patterns (relative to src/)
|
|
16
|
+
* @returns FsWatcher instance (call close() on shutdown)
|
|
17
17
|
*/
|
|
18
18
|
export declare function watchCopySrcFiles(pkgDir: string, patterns: string[]): Promise<FsWatcher>;
|
|
19
19
|
//# sourceMappingURL=copy-src.d.ts.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type esbuild from "esbuild";
|
|
2
2
|
import type { TypecheckEnv } from "./tsconfig";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Write only changed files from esbuild outputFiles to disk
|
|
5
5
|
*
|
|
6
|
-
* - .js
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
6
|
+
* - .js files: Add .js extension to ESM relative import paths before comparing
|
|
7
|
+
* - Other files (.js.map etc): Compare original content as-is
|
|
8
|
+
* - Skip writing if content matches existing file to preserve timestamps
|
|
9
9
|
*/
|
|
10
10
|
export declare function writeChangedOutputFiles(outputFiles: esbuild.OutputFile[]): Promise<boolean>;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* - bundle: false (
|
|
14
|
-
* - platform:
|
|
12
|
+
* esbuild options for Library build
|
|
13
|
+
* - bundle: false (transpile individual files)
|
|
14
|
+
* - platform: node or browser depending on target
|
|
15
15
|
*/
|
|
16
16
|
export interface LibraryEsbuildOptions {
|
|
17
17
|
pkgDir: string;
|
|
@@ -20,55 +20,55 @@ export interface LibraryEsbuildOptions {
|
|
|
20
20
|
compilerOptions: Record<string, unknown>;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
24
|
-
* - bundle: true (
|
|
23
|
+
* esbuild options for Server build
|
|
24
|
+
* - bundle: true (single bundle with all dependencies)
|
|
25
25
|
*/
|
|
26
26
|
export interface ServerEsbuildOptions {
|
|
27
27
|
pkgDir: string;
|
|
28
28
|
entryPoints: string[];
|
|
29
29
|
compilerOptions: Record<string, unknown>;
|
|
30
30
|
env?: Record<string, string>;
|
|
31
|
-
/**
|
|
31
|
+
/** External modules to exclude from bundle */
|
|
32
32
|
external?: string[];
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* Create esbuild config for Library build
|
|
36
36
|
*
|
|
37
|
-
* node/browser/neutral
|
|
38
|
-
* - bundle: false (
|
|
39
|
-
* - platform: target
|
|
40
|
-
* - target: node
|
|
37
|
+
* Used to build library packages with node/browser/neutral targets
|
|
38
|
+
* - bundle: false (transpile each file individually)
|
|
39
|
+
* - platform: node if target is node, otherwise browser
|
|
40
|
+
* - target: node20 if target is node, otherwise chrome84
|
|
41
41
|
*/
|
|
42
42
|
export declare function createLibraryEsbuildOptions(options: LibraryEsbuildOptions): esbuild.BuildOptions;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Create esbuild config for Server build
|
|
45
45
|
*
|
|
46
|
-
*
|
|
47
|
-
* - bundle: true (
|
|
48
|
-
* - minify: true (
|
|
49
|
-
* - banner: CJS
|
|
50
|
-
* - env
|
|
46
|
+
* Used for server package builds
|
|
47
|
+
* - bundle: true (single bundle with all dependencies)
|
|
48
|
+
* - minify: true (minify for code protection)
|
|
49
|
+
* - banner: createRequire shim for CJS package require() support
|
|
50
|
+
* - Replace env with define option (process.env.KEY format)
|
|
51
51
|
*/
|
|
52
52
|
export declare function createServerEsbuildOptions(options: ServerEsbuildOptions): esbuild.BuildOptions;
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
54
|
+
* Extract TypecheckEnv from build target
|
|
55
55
|
*
|
|
56
|
-
*
|
|
57
|
-
* (neutral
|
|
56
|
+
* Neutral is treated as browser for builds.
|
|
57
|
+
* (neutral packages are Node/browser universal, but we treat as browser for build)
|
|
58
58
|
*/
|
|
59
59
|
export declare function getTypecheckEnvFromTarget(target: "node" | "browser" | "neutral"): TypecheckEnv;
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
61
|
+
* Collect uninstalled optional peer deps from dependency tree
|
|
62
62
|
*
|
|
63
|
-
*
|
|
64
|
-
* esbuild
|
|
63
|
+
* For server builds (bundle: true), specify uninstalled optional peer dependencies
|
|
64
|
+
* as esbuild externals to prevent build failures
|
|
65
65
|
*/
|
|
66
66
|
export declare function collectUninstalledOptionalPeerDeps(pkgDir: string): string[];
|
|
67
67
|
/**
|
|
68
|
-
*
|
|
68
|
+
* Collect native modules with binding.gyp from dependencies
|
|
69
69
|
*
|
|
70
|
-
* node-gyp
|
|
71
|
-
*
|
|
70
|
+
* Native modules built with node-gyp cannot be bundled by esbuild,
|
|
71
|
+
* so they must be specified as externals.
|
|
72
72
|
*/
|
|
73
73
|
export declare function collectNativeModuleExternals(pkgDir: string): string[];
|
|
74
74
|
//# sourceMappingURL=esbuild-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esbuild-config.d.ts","sourceRoot":"","sources":["..\\..\\src\\utils\\esbuild-config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAAC,WAAW,EAAE,OAAO,CAAC,UAAU,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CA2BjG;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;IACvC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,
|
|
1
|
+
{"version":3,"file":"esbuild-config.d.ts","sourceRoot":"","sources":["..\\..\\src\\utils\\esbuild-config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;;;G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ages
|
|
4
4
|
*/
|
|
5
5
|
export declare function formatBuildMessages(name: string, label: string, messages: string[]): string;
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
* @param results
|
|
7
|
+
* Print only errors
|
|
8
|
+
* @param results Build result status per package
|
|
9
9
|
*/
|
|
10
10
|
export declare function printErrors(results: Map<string, BuildResult>): void;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* @param results
|
|
14
|
-
* @param serverClientsMap
|
|
12
|
+
* Print server URLs only
|
|
13
|
+
* @param results Build result status per package
|
|
14
|
+
* @param serverClientsMap List of connected clients per server
|
|
15
15
|
*/
|
|
16
16
|
export declare function printServers(results: Map<string, BuildResult>, serverClientsMap?: Map<string, string[]>): void;
|
|
17
17
|
//# sourceMappingURL=output-utils.d.ts.map
|