@simplysm/sd-cli 14.0.23 → 14.0.24
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/package.json +4 -5
- package/README.md +0 -128
- package/docs/config.md +0 -368
- package/docs/publish-configuration-types.md +0 -87
- package/docs/pwa-configuration-types.md +0 -55
- package/docs/vitest-plugin.md +0 -47
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplysm/sd-cli",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.0.24",
|
|
4
4
|
"description": "Simplysm package - CLI tool",
|
|
5
5
|
"author": "simplysm",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
15
|
"files": [
|
|
16
16
|
"dist",
|
|
17
|
-
"docs",
|
|
18
17
|
"src",
|
|
19
18
|
"tests"
|
|
20
19
|
],
|
|
@@ -42,9 +41,9 @@
|
|
|
42
41
|
"vite-plugin-solid": "^2.11.12",
|
|
43
42
|
"vite-tsconfig-paths": "^6.1.1",
|
|
44
43
|
"yargs": "^18.0.0",
|
|
45
|
-
"@simplysm/
|
|
46
|
-
"@simplysm/
|
|
47
|
-
"@simplysm/core-
|
|
44
|
+
"@simplysm/core-common": "14.0.24",
|
|
45
|
+
"@simplysm/storage": "14.0.24",
|
|
46
|
+
"@simplysm/core-node": "14.0.24"
|
|
48
47
|
},
|
|
49
48
|
"devDependencies": {
|
|
50
49
|
"@types/semver": "^7.7.1",
|
package/README.md
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
# @simplysm/sd-cli
|
|
2
|
-
|
|
3
|
-
Simplysm monorepo build, development, and deployment CLI tool. Reads `sd.config.ts` to determine per-package build strategies and orchestrates TypeScript compilation, esbuild bundling, Vite dev server, Angular AOT, linting, and publishing.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @simplysm/sd-cli
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## CLI Commands
|
|
12
|
-
|
|
13
|
-
All commands are run via `pnpm sd-cli <command>`. The `--debug` flag is available on all commands. Omitting `[targets..]` runs against all packages defined in `sd.config.ts`. Targets are specified by package name (e.g., `core-common`).
|
|
14
|
-
|
|
15
|
-
| Command | Description |
|
|
16
|
-
|---|---|
|
|
17
|
-
| `pnpm dev [targets..]` | Run server packages in development mode |
|
|
18
|
-
| `pnpm watch [targets..]` | Watch-build library packages |
|
|
19
|
-
| `pnpm build [targets..]` | Production build |
|
|
20
|
-
| `pnpm pub [targets..]` | Build and publish (npm/sftp) |
|
|
21
|
-
| `pnpm check [targets..]` | Run typecheck + lint + test in parallel |
|
|
22
|
-
| `pnpm typecheck [targets..]` | TypeScript type checking |
|
|
23
|
-
| `pnpm lint [targets..]` | ESLint |
|
|
24
|
-
| `pnpm test [targets..]` | Vitest single run |
|
|
25
|
-
|
|
26
|
-
## API Overview
|
|
27
|
-
|
|
28
|
-
The package exports configuration types for `sd.config.ts` and a Vitest plugin for Angular AOT compilation.
|
|
29
|
-
|
|
30
|
-
### Config
|
|
31
|
-
|
|
32
|
-
| API | Type | Description |
|
|
33
|
-
|-----|------|-------------|
|
|
34
|
-
| `NpmConfig` | interface | npm `package.json` structure with name, version, and dependency fields |
|
|
35
|
-
| `BuildTarget` | type | Build target platform: `"node"`, `"browser"`, or `"neutral"` |
|
|
36
|
-
| `SdBuildPackageConfig` | interface | Configuration for buildable packages (node/browser/neutral) |
|
|
37
|
-
| `SdClientPackageConfig` | interface | Configuration for client (Angular/Solid + Vite) packages |
|
|
38
|
-
| `SdServerPackageConfig` | interface | Configuration for server (Fastify) packages |
|
|
39
|
-
| `SdScriptsPackageConfig` | interface | Configuration for scripts-only packages (no build output) |
|
|
40
|
-
| `SdWatchHookConfig` | interface | Watch hook for running commands on file changes |
|
|
41
|
-
| `SdPackageConfig` | type | Union of all package configuration types |
|
|
42
|
-
| `SdConfig` | interface | Main configuration object for `sd.config.ts` |
|
|
43
|
-
| `SdConfigParams` | interface | Parameters passed to the `sd.config.ts` function |
|
|
44
|
-
| `SdConfigFn` | type | Type for the default export of `sd.config.ts` |
|
|
45
|
-
| `SdBrowserSupportConfig` | interface | Browser compatibility settings for client packages |
|
|
46
|
-
| `SdCapacitorConfig` | interface | Capacitor mobile build configuration |
|
|
47
|
-
| `SdCapacitorAndroidConfig` | interface | Capacitor Android platform configuration |
|
|
48
|
-
| `SdCapacitorSignConfig` | interface | APK/AAB signing configuration |
|
|
49
|
-
| `SdCapacitorPermission` | interface | Android permission configuration |
|
|
50
|
-
| `SdCapacitorIntentFilter` | interface | Android Intent Filter configuration |
|
|
51
|
-
| `SdElectronConfig` | interface | Electron desktop build configuration |
|
|
52
|
-
|
|
53
|
-
-> See [docs/config.md](./docs/config.md) for details.
|
|
54
|
-
|
|
55
|
-
### Publish Configuration Types
|
|
56
|
-
|
|
57
|
-
| API | Type | Description |
|
|
58
|
-
|-----|------|-------------|
|
|
59
|
-
| `SdPublishConfig` | type | Union of all publish configuration types |
|
|
60
|
-
| `SdNpmPublishConfig` | interface | npm registry publish configuration |
|
|
61
|
-
| `SdLocalDirectoryPublishConfig` | interface | Copy build output to a local directory |
|
|
62
|
-
| `SdStoragePublishConfig` | interface | Upload build output to FTP/FTPS/SFTP server |
|
|
63
|
-
| `SdPostPublishScriptConfig` | interface | Script to run after publish completes |
|
|
64
|
-
|
|
65
|
-
-> See [docs/publish-configuration-types.md](./docs/publish-configuration-types.md) for details.
|
|
66
|
-
|
|
67
|
-
### PWA Configuration Types
|
|
68
|
-
|
|
69
|
-
| API | Type | Description |
|
|
70
|
-
|-----|------|-------------|
|
|
71
|
-
| `SdPwaConfig` | interface | PWA configuration |
|
|
72
|
-
| `SdPwaManifestConfig` | interface | PWA manifest options |
|
|
73
|
-
| `SdPwaWorkboxConfig` | interface | PWA workbox service worker options |
|
|
74
|
-
|
|
75
|
-
-> See [docs/pwa-configuration-types.md](./docs/pwa-configuration-types.md) for details.
|
|
76
|
-
|
|
77
|
-
### Vitest Plugin
|
|
78
|
-
|
|
79
|
-
| API | Type | Description |
|
|
80
|
-
|-----|------|-------------|
|
|
81
|
-
| `angularVitestPlugin` | function | Vite plugin for Angular AOT compilation in Vitest |
|
|
82
|
-
| `AngularVitestPluginOptions` | interface | Options for `angularVitestPlugin` |
|
|
83
|
-
|
|
84
|
-
-> See [docs/vitest-plugin.md](./docs/vitest-plugin.md) for details.
|
|
85
|
-
|
|
86
|
-
## Usage Examples
|
|
87
|
-
|
|
88
|
-
### sd.config.ts
|
|
89
|
-
|
|
90
|
-
```typescript
|
|
91
|
-
import type { SdConfigFn, SdConfigParams } from "@simplysm/sd-cli";
|
|
92
|
-
|
|
93
|
-
const config: SdConfigFn = (params: SdConfigParams) => ({
|
|
94
|
-
packages: {
|
|
95
|
-
"core-common": { target: "neutral" },
|
|
96
|
-
"core-node": { target: "node" },
|
|
97
|
-
"my-client": {
|
|
98
|
-
target: "client",
|
|
99
|
-
server: "my-server",
|
|
100
|
-
capacitor: {
|
|
101
|
-
appId: "com.example.app",
|
|
102
|
-
appName: "My App",
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
"my-server": {
|
|
106
|
-
target: "server",
|
|
107
|
-
publish: { type: "npm" },
|
|
108
|
-
pm2: { name: "my-server" },
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
replaceDeps: {
|
|
112
|
-
"@simplysm/*": "../simplysm/packages/*",
|
|
113
|
-
},
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
export default config;
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
### Vitest with Angular
|
|
120
|
-
|
|
121
|
-
```typescript
|
|
122
|
-
import { angularVitestPlugin } from "@simplysm/sd-cli/vitest-plugin";
|
|
123
|
-
import { defineConfig } from "vitest/config";
|
|
124
|
-
|
|
125
|
-
export default defineConfig({
|
|
126
|
-
plugins: [angularVitestPlugin({ tsconfig: "./tsconfig.json" })],
|
|
127
|
-
});
|
|
128
|
-
```
|
package/docs/config.md
DELETED
|
@@ -1,368 +0,0 @@
|
|
|
1
|
-
# Config
|
|
2
|
-
|
|
3
|
-
## `NpmConfig`
|
|
4
|
-
|
|
5
|
-
npm `package.json` structure.
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
interface NpmConfig {
|
|
9
|
-
name: string;
|
|
10
|
-
version: string;
|
|
11
|
-
description?: string;
|
|
12
|
-
dependencies?: Record<string, string>;
|
|
13
|
-
devDependencies?: Record<string, string>;
|
|
14
|
-
peerDependencies?: Record<string, string>;
|
|
15
|
-
volta?: unknown;
|
|
16
|
-
}
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
| Field | Type | Description |
|
|
20
|
-
|-------|------|-------------|
|
|
21
|
-
| `name` | `string` | Package name |
|
|
22
|
-
| `version` | `string` | Package version |
|
|
23
|
-
| `description` | `string` | Package description |
|
|
24
|
-
| `dependencies` | `Record<string, string>` | Production dependencies |
|
|
25
|
-
| `devDependencies` | `Record<string, string>` | Development dependencies |
|
|
26
|
-
| `peerDependencies` | `Record<string, string>` | Peer dependencies |
|
|
27
|
-
| `volta` | `unknown` | Volta configuration |
|
|
28
|
-
|
|
29
|
-
## `BuildTarget`
|
|
30
|
-
|
|
31
|
-
Build target type (built with esbuild).
|
|
32
|
-
|
|
33
|
-
```typescript
|
|
34
|
-
type BuildTarget = "node" | "browser" | "neutral";
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
| Value | Description |
|
|
38
|
-
|---|---|
|
|
39
|
-
| `"node"` | Node.js only package |
|
|
40
|
-
| `"browser"` | Browser only package |
|
|
41
|
-
| `"neutral"` | Node/browser shared package |
|
|
42
|
-
|
|
43
|
-
## `SdBuildPackageConfig`
|
|
44
|
-
|
|
45
|
-
Configuration for buildable packages (node/browser/neutral).
|
|
46
|
-
|
|
47
|
-
```typescript
|
|
48
|
-
interface SdBuildPackageConfig {
|
|
49
|
-
target: BuildTarget;
|
|
50
|
-
publish?: SdPublishConfig;
|
|
51
|
-
copySrc?: string[];
|
|
52
|
-
watch?: SdWatchHookConfig;
|
|
53
|
-
}
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
| Field | Type | Description |
|
|
57
|
-
|-------|------|-------------|
|
|
58
|
-
| `target` | `BuildTarget` | Build target |
|
|
59
|
-
| `publish` | `SdPublishConfig` | Publish configuration |
|
|
60
|
-
| `copySrc` | `string[]` | Glob patterns for files to copy from `src/` to `dist/` (relative path based on `src/`) |
|
|
61
|
-
| `watch` | `SdWatchHookConfig` | Watch hook configuration (when set, hook runs alongside build engine in watch mode) |
|
|
62
|
-
|
|
63
|
-
## `SdClientPackageConfig`
|
|
64
|
-
|
|
65
|
-
Configuration for client (Angular/Vite) packages.
|
|
66
|
-
|
|
67
|
-
```typescript
|
|
68
|
-
interface SdClientPackageConfig {
|
|
69
|
-
target: "client";
|
|
70
|
-
framework?: "angular" | "solid";
|
|
71
|
-
server: string | number;
|
|
72
|
-
env?: Record<string, string>;
|
|
73
|
-
publish?: SdPublishConfig;
|
|
74
|
-
capacitor?: SdCapacitorConfig;
|
|
75
|
-
electron?: SdElectronConfig;
|
|
76
|
-
configs?: Record<string, unknown>;
|
|
77
|
-
exclude?: string[];
|
|
78
|
-
browserSupport?: SdBrowserSupportConfig;
|
|
79
|
-
pwa?: false | SdPwaConfig;
|
|
80
|
-
}
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
| Field | Type | Description |
|
|
84
|
-
|-------|------|-------------|
|
|
85
|
-
| `target` | `"client"` | Fixed value |
|
|
86
|
-
| `framework` | `"angular" \| "solid"` | Client framework selection. Defaults to `"angular"` when not specified |
|
|
87
|
-
| `server` | `string \| number` | Server package name to connect to (e.g., `"solid-demo-server"`), or Vite port number (backward compatibility) |
|
|
88
|
-
| `env` | `Record<string, string>` | Environment variables to substitute during build (replaces `process.env` with object) |
|
|
89
|
-
| `publish` | `SdPublishConfig` | Publish configuration |
|
|
90
|
-
| `capacitor` | `SdCapacitorConfig` | Capacitor mobile build configuration |
|
|
91
|
-
| `electron` | `SdElectronConfig` | Electron desktop build configuration |
|
|
92
|
-
| `configs` | `Record<string, unknown>` | Runtime config (written to `dist/.config.json` during build) |
|
|
93
|
-
| `exclude` | `string[]` | Packages to exclude from Vite optimizeDeps and add to Capacitor/Electron `package.json` |
|
|
94
|
-
| `browserSupport` | `SdBrowserSupportConfig` | Browser compatibility settings (browserslist, PostCSS, legacyModule) |
|
|
95
|
-
| `pwa` | `false \| SdPwaConfig` | PWA configuration. `false` to disable. Enabled with defaults when not specified |
|
|
96
|
-
|
|
97
|
-
## `SdServerPackageConfig`
|
|
98
|
-
|
|
99
|
-
Configuration for server (Fastify) packages.
|
|
100
|
-
|
|
101
|
-
```typescript
|
|
102
|
-
interface SdServerPackageConfig {
|
|
103
|
-
target: "server";
|
|
104
|
-
env?: Record<string, string>;
|
|
105
|
-
publish?: SdPublishConfig;
|
|
106
|
-
configs?: Record<string, unknown>;
|
|
107
|
-
externals?: string[];
|
|
108
|
-
pm2?: { name?: string; ignoreWatchPaths?: string[] };
|
|
109
|
-
packageManager?: "volta" | "mise";
|
|
110
|
-
}
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
| Field | Type | Description |
|
|
114
|
-
|-------|------|-------------|
|
|
115
|
-
| `target` | `"server"` | Fixed value |
|
|
116
|
-
| `env` | `Record<string, string>` | Environment variables to substitute during build (replaces `process.env.KEY` with constant) |
|
|
117
|
-
| `publish` | `SdPublishConfig` | Publish configuration |
|
|
118
|
-
| `configs` | `Record<string, unknown>` | Runtime config (written to `dist/.config.json` during build) |
|
|
119
|
-
| `externals` | `string[]` | External modules not to include in esbuild bundle (in addition to automatic `binding.gyp` detection) |
|
|
120
|
-
| `pm2` | `{ name?: string; ignoreWatchPaths?: string[] }` | PM2 configuration (generates `dist/pm2.config.cjs` when specified). `name` defaults to a name generated from `package.json` |
|
|
121
|
-
| `packageManager` | `"volta" \| "mise"` | Package manager to use (affects `mise.toml` or `volta` settings generation) |
|
|
122
|
-
|
|
123
|
-
## `SdScriptsPackageConfig`
|
|
124
|
-
|
|
125
|
-
Configuration for scripts-only packages (excluded from watch/typecheck unless watch hook is configured).
|
|
126
|
-
|
|
127
|
-
```typescript
|
|
128
|
-
interface SdScriptsPackageConfig {
|
|
129
|
-
target: "scripts";
|
|
130
|
-
publish?: SdPublishConfig;
|
|
131
|
-
watch?: SdWatchHookConfig;
|
|
132
|
-
}
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
| Field | Type | Description |
|
|
136
|
-
|-------|------|-------------|
|
|
137
|
-
| `target` | `"scripts"` | Fixed value |
|
|
138
|
-
| `publish` | `SdPublishConfig` | Publish configuration |
|
|
139
|
-
| `watch` | `SdWatchHookConfig` | Watch hook configuration (when set, package is included in watch mode) |
|
|
140
|
-
|
|
141
|
-
## `SdWatchHookConfig`
|
|
142
|
-
|
|
143
|
-
Watch hook configuration for running commands on file changes.
|
|
144
|
-
|
|
145
|
-
```typescript
|
|
146
|
-
interface SdWatchHookConfig {
|
|
147
|
-
target: string[];
|
|
148
|
-
cmd: string;
|
|
149
|
-
args?: string[];
|
|
150
|
-
}
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
| Field | Type | Description |
|
|
154
|
-
|-------|------|-------------|
|
|
155
|
-
| `target` | `string[]` | Glob patterns to watch (relative to package directory) |
|
|
156
|
-
| `cmd` | `string` | Command to execute on change |
|
|
157
|
-
| `args` | `string[]` | Command arguments |
|
|
158
|
-
|
|
159
|
-
## `SdPackageConfig`
|
|
160
|
-
|
|
161
|
-
Union of all package configuration types. Discriminated by the `target` field.
|
|
162
|
-
|
|
163
|
-
```typescript
|
|
164
|
-
type SdPackageConfig =
|
|
165
|
-
| SdBuildPackageConfig
|
|
166
|
-
| SdClientPackageConfig
|
|
167
|
-
| SdServerPackageConfig
|
|
168
|
-
| SdScriptsPackageConfig;
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
| Variant | Discriminant (`target`) |
|
|
172
|
-
|---------|------------------------|
|
|
173
|
-
| `SdBuildPackageConfig` | `"node"`, `"browser"`, `"neutral"` |
|
|
174
|
-
| `SdClientPackageConfig` | `"client"` |
|
|
175
|
-
| `SdServerPackageConfig` | `"server"` |
|
|
176
|
-
| `SdScriptsPackageConfig` | `"scripts"` |
|
|
177
|
-
|
|
178
|
-
## `SdConfig`
|
|
179
|
-
|
|
180
|
-
The main configuration object for `sd.config.ts`.
|
|
181
|
-
|
|
182
|
-
```typescript
|
|
183
|
-
interface SdConfig {
|
|
184
|
-
packages: Record<string, SdPackageConfig | undefined>;
|
|
185
|
-
replaceDeps?: Record<string, string>;
|
|
186
|
-
postPublish?: SdPostPublishScriptConfig[];
|
|
187
|
-
}
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
| Field | Type | Description |
|
|
191
|
-
|-------|------|-------------|
|
|
192
|
-
| `packages` | `Record<string, SdPackageConfig \| undefined>` | Per-package configuration (key: subdirectory name under `packages/`, e.g., `"core-common"`) |
|
|
193
|
-
| `replaceDeps` | `Record<string, string>` | Dependency replacement configuration (replace `node_modules` packages with local sources via symlink). Key is a package glob pattern (e.g., `"@simplysm/*"`), value is a source directory path. Captured values from key's `*` are substituted into value's `*` |
|
|
194
|
-
| `postPublish` | `SdPostPublishScriptConfig[]` | Scripts to execute after deployment completes |
|
|
195
|
-
|
|
196
|
-
## `SdConfigParams`
|
|
197
|
-
|
|
198
|
-
Parameters passed to the `sd.config.ts` function.
|
|
199
|
-
|
|
200
|
-
```typescript
|
|
201
|
-
interface SdConfigParams {
|
|
202
|
-
cwd: string;
|
|
203
|
-
dev: boolean;
|
|
204
|
-
opt: string[];
|
|
205
|
-
}
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
| Field | Type | Description |
|
|
209
|
-
|-------|------|-------------|
|
|
210
|
-
| `cwd` | `string` | Current working directory |
|
|
211
|
-
| `dev` | `boolean` | Development mode flag |
|
|
212
|
-
| `opt` | `string[]` | Additional options (from CLI's `-o` flag) |
|
|
213
|
-
|
|
214
|
-
## `SdConfigFn`
|
|
215
|
-
|
|
216
|
-
The type for the default export of `sd.config.ts`.
|
|
217
|
-
|
|
218
|
-
```typescript
|
|
219
|
-
type SdConfigFn = (params: SdConfigParams) => SdConfig | Promise<SdConfig>;
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
## `SdBrowserSupportConfig`
|
|
223
|
-
|
|
224
|
-
Browser support configuration for client packages.
|
|
225
|
-
|
|
226
|
-
```typescript
|
|
227
|
-
interface SdBrowserSupportConfig {
|
|
228
|
-
browserslist?: string | string[];
|
|
229
|
-
postCss?: { plugins: unknown[] };
|
|
230
|
-
legacyModule?: boolean;
|
|
231
|
-
}
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
| Field | Type | Description |
|
|
235
|
-
|-------|------|-------------|
|
|
236
|
-
| `browserslist` | `string \| string[]` | Browserslist query (e.g., `"last 2 Chrome versions"` or `["ie 11", "last 2 versions"]`) |
|
|
237
|
-
| `postCss` | `{ plugins: unknown[] }` | PostCSS plugins configuration |
|
|
238
|
-
| `legacyModule` | `boolean` | Legacy module support (disables code splitting + replaces `import.meta`) |
|
|
239
|
-
|
|
240
|
-
## `SdCapacitorConfig`
|
|
241
|
-
|
|
242
|
-
Capacitor configuration.
|
|
243
|
-
|
|
244
|
-
```typescript
|
|
245
|
-
interface SdCapacitorConfig {
|
|
246
|
-
appId: string;
|
|
247
|
-
appName: string;
|
|
248
|
-
plugins?: Record<string, Record<string, unknown> | true>;
|
|
249
|
-
icon?: string;
|
|
250
|
-
debug?: boolean;
|
|
251
|
-
platform?: { android?: SdCapacitorAndroidConfig };
|
|
252
|
-
}
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
| Field | Type | Description |
|
|
256
|
-
|-------|------|-------------|
|
|
257
|
-
| `appId` | `string` | App ID (e.g., `"com.example.app"`) |
|
|
258
|
-
| `appName` | `string` | App display name |
|
|
259
|
-
| `plugins` | `Record<string, Record<string, unknown> \| true>` | Capacitor plugin configuration (key: package name, value: `true` or plugin options) |
|
|
260
|
-
| `icon` | `string` | App icon path (relative to package directory) |
|
|
261
|
-
| `debug` | `boolean` | Debug build flag |
|
|
262
|
-
| `platform` | `{ android?: SdCapacitorAndroidConfig }` | Per-platform configuration |
|
|
263
|
-
|
|
264
|
-
## `SdCapacitorAndroidConfig`
|
|
265
|
-
|
|
266
|
-
Capacitor Android platform configuration.
|
|
267
|
-
|
|
268
|
-
```typescript
|
|
269
|
-
interface SdCapacitorAndroidConfig {
|
|
270
|
-
config?: Record<string, string>;
|
|
271
|
-
bundle?: boolean;
|
|
272
|
-
intentFilters?: SdCapacitorIntentFilter[];
|
|
273
|
-
sign?: SdCapacitorSignConfig;
|
|
274
|
-
sdkVersion?: number;
|
|
275
|
-
permissions?: SdCapacitorPermission[];
|
|
276
|
-
}
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
| Field | Type | Description |
|
|
280
|
-
|-------|------|-------------|
|
|
281
|
-
| `config` | `Record<string, string>` | `AndroidManifest.xml` application tag attributes (e.g., `{ requestLegacyExternalStorage: "true" }`) |
|
|
282
|
-
| `bundle` | `boolean` | AAB bundle build flag (`true` for AAB, `false` for APK) |
|
|
283
|
-
| `intentFilters` | `SdCapacitorIntentFilter[]` | Intent Filter configuration |
|
|
284
|
-
| `sign` | `SdCapacitorSignConfig` | APK/AAB signing configuration |
|
|
285
|
-
| `sdkVersion` | `number` | Android SDK version (minSdk, targetSdk) |
|
|
286
|
-
| `permissions` | `SdCapacitorPermission[]` | Additional permission configuration |
|
|
287
|
-
|
|
288
|
-
## `SdCapacitorSignConfig`
|
|
289
|
-
|
|
290
|
-
Capacitor Android sign configuration.
|
|
291
|
-
|
|
292
|
-
```typescript
|
|
293
|
-
interface SdCapacitorSignConfig {
|
|
294
|
-
keystore: string;
|
|
295
|
-
storePassword: string;
|
|
296
|
-
alias: string;
|
|
297
|
-
password: string;
|
|
298
|
-
keystoreType?: string;
|
|
299
|
-
}
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
| Field | Type | Description |
|
|
303
|
-
|-------|------|-------------|
|
|
304
|
-
| `keystore` | `string` | Keystore file path (relative to package directory) |
|
|
305
|
-
| `storePassword` | `string` | Keystore password |
|
|
306
|
-
| `alias` | `string` | Key alias |
|
|
307
|
-
| `password` | `string` | Key password |
|
|
308
|
-
| `keystoreType` | `string` | Keystore type (default: `"jks"`) |
|
|
309
|
-
|
|
310
|
-
## `SdCapacitorPermission`
|
|
311
|
-
|
|
312
|
-
Capacitor Android permission configuration.
|
|
313
|
-
|
|
314
|
-
```typescript
|
|
315
|
-
interface SdCapacitorPermission {
|
|
316
|
-
name: string;
|
|
317
|
-
maxSdkVersion?: number;
|
|
318
|
-
ignore?: string;
|
|
319
|
-
}
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
| Field | Type | Description |
|
|
323
|
-
|-------|------|-------------|
|
|
324
|
-
| `name` | `string` | Permission name (e.g., `"CAMERA"`, `"WRITE_EXTERNAL_STORAGE"`) |
|
|
325
|
-
| `maxSdkVersion` | `number` | Maximum SDK version |
|
|
326
|
-
| `ignore` | `string` | `tools:ignore` attribute value |
|
|
327
|
-
|
|
328
|
-
## `SdCapacitorIntentFilter`
|
|
329
|
-
|
|
330
|
-
Capacitor Android Intent Filter configuration.
|
|
331
|
-
|
|
332
|
-
```typescript
|
|
333
|
-
interface SdCapacitorIntentFilter {
|
|
334
|
-
action?: string;
|
|
335
|
-
category?: string;
|
|
336
|
-
}
|
|
337
|
-
```
|
|
338
|
-
|
|
339
|
-
| Field | Type | Description |
|
|
340
|
-
|-------|------|-------------|
|
|
341
|
-
| `action` | `string` | Intent action (e.g., `"android.intent.action.VIEW"`) |
|
|
342
|
-
| `category` | `string` | Intent category (e.g., `"android.intent.category.DEFAULT"`) |
|
|
343
|
-
|
|
344
|
-
## `SdElectronConfig`
|
|
345
|
-
|
|
346
|
-
Electron configuration.
|
|
347
|
-
|
|
348
|
-
```typescript
|
|
349
|
-
interface SdElectronConfig {
|
|
350
|
-
appId: string;
|
|
351
|
-
portable?: boolean;
|
|
352
|
-
installerIcon?: string;
|
|
353
|
-
reinstallDependencies?: string[];
|
|
354
|
-
postInstallScript?: string;
|
|
355
|
-
nsisOptions?: Record<string, unknown>;
|
|
356
|
-
env?: Record<string, string>;
|
|
357
|
-
}
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
| Field | Type | Description |
|
|
361
|
-
|-------|------|-------------|
|
|
362
|
-
| `appId` | `string` | Electron app ID (e.g., `"com.example.myapp"`) |
|
|
363
|
-
| `portable` | `boolean` | `true` for portable `.exe`, `false`/unspecified for NSIS installer |
|
|
364
|
-
| `installerIcon` | `string` | Installer icon path (`.ico`, relative to package directory) |
|
|
365
|
-
| `reinstallDependencies` | `string[]` | npm packages to include in Electron (native modules, etc.) |
|
|
366
|
-
| `postInstallScript` | `string` | npm postinstall script |
|
|
367
|
-
| `nsisOptions` | `Record<string, unknown>` | NSIS options (when `portable` is `false`) |
|
|
368
|
-
| `env` | `Record<string, string>` | Environment variables (accessible via `process.env` in `electron-main.ts`) |
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
# Publish Configuration Types
|
|
2
|
-
|
|
3
|
-
## `SdPublishConfig`
|
|
4
|
-
|
|
5
|
-
Union of all publish configuration types. Discriminated by the `type` field.
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
type SdPublishConfig = SdNpmPublishConfig | SdLocalDirectoryPublishConfig | SdStoragePublishConfig;
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
| Variant | Discriminant (`type`) |
|
|
12
|
-
|---------|----------------------|
|
|
13
|
-
| `SdNpmPublishConfig` | `"npm"` |
|
|
14
|
-
| `SdLocalDirectoryPublishConfig` | `"local-directory"` |
|
|
15
|
-
| `SdStoragePublishConfig` | `"ftp"`, `"ftps"`, `"sftp"` |
|
|
16
|
-
|
|
17
|
-
## `SdNpmPublishConfig`
|
|
18
|
-
|
|
19
|
-
npm registry publish configuration.
|
|
20
|
-
|
|
21
|
-
```typescript
|
|
22
|
-
interface SdNpmPublishConfig {
|
|
23
|
-
type: "npm";
|
|
24
|
-
}
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
| Field | Type | Description |
|
|
28
|
-
|-------|------|-------------|
|
|
29
|
-
| `type` | `"npm"` | Publish type discriminator |
|
|
30
|
-
|
|
31
|
-
## `SdLocalDirectoryPublishConfig`
|
|
32
|
-
|
|
33
|
-
Copy build output to a local directory.
|
|
34
|
-
|
|
35
|
-
```typescript
|
|
36
|
-
interface SdLocalDirectoryPublishConfig {
|
|
37
|
-
type: "local-directory";
|
|
38
|
-
path: string;
|
|
39
|
-
}
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
| Field | Type | Description |
|
|
43
|
-
|-------|------|-------------|
|
|
44
|
-
| `type` | `"local-directory"` | Publish type discriminator |
|
|
45
|
-
| `path` | `string` | Deployment target path (supports environment variable substitution: `%VER%`, `%PROJECT%`) |
|
|
46
|
-
|
|
47
|
-
## `SdStoragePublishConfig`
|
|
48
|
-
|
|
49
|
-
Upload build output to FTP/FTPS/SFTP server.
|
|
50
|
-
|
|
51
|
-
```typescript
|
|
52
|
-
interface SdStoragePublishConfig {
|
|
53
|
-
type: "ftp" | "ftps" | "sftp";
|
|
54
|
-
host: string;
|
|
55
|
-
port?: number;
|
|
56
|
-
path?: string;
|
|
57
|
-
user?: string;
|
|
58
|
-
password?: string;
|
|
59
|
-
}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
| Field | Type | Description |
|
|
63
|
-
|-------|------|-------------|
|
|
64
|
-
| `type` | `"ftp" \| "ftps" \| "sftp"` | Protocol |
|
|
65
|
-
| `host` | `string` | Server hostname |
|
|
66
|
-
| `port` | `number` | Server port |
|
|
67
|
-
| `path` | `string` | Remote path |
|
|
68
|
-
| `user` | `string` | Username |
|
|
69
|
-
| `password` | `string` | Password |
|
|
70
|
-
|
|
71
|
-
## `SdPostPublishScriptConfig`
|
|
72
|
-
|
|
73
|
-
Script to run after publish completes.
|
|
74
|
-
|
|
75
|
-
```typescript
|
|
76
|
-
interface SdPostPublishScriptConfig {
|
|
77
|
-
type: "script";
|
|
78
|
-
cmd: string;
|
|
79
|
-
args: string[];
|
|
80
|
-
}
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
| Field | Type | Description |
|
|
84
|
-
|-------|------|-------------|
|
|
85
|
-
| `type` | `"script"` | Config type discriminator |
|
|
86
|
-
| `cmd` | `string` | Command to execute |
|
|
87
|
-
| `args` | `string[]` | Command arguments (supports environment variable substitution: `%VER%`, `%PROJECT%`) |
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# PWA Configuration Types
|
|
2
|
-
|
|
3
|
-
## `SdPwaConfig`
|
|
4
|
-
|
|
5
|
-
PWA configuration.
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
interface SdPwaConfig {
|
|
9
|
-
manifest?: SdPwaManifestConfig;
|
|
10
|
-
workbox?: SdPwaWorkboxConfig;
|
|
11
|
-
}
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
| Field | Type | Description |
|
|
15
|
-
|-------|------|-------------|
|
|
16
|
-
| `manifest` | `SdPwaManifestConfig` | PWA manifest options |
|
|
17
|
-
| `workbox` | `SdPwaWorkboxConfig` | Workbox service worker options |
|
|
18
|
-
|
|
19
|
-
## `SdPwaManifestConfig`
|
|
20
|
-
|
|
21
|
-
PWA manifest configuration.
|
|
22
|
-
|
|
23
|
-
```typescript
|
|
24
|
-
interface SdPwaManifestConfig {
|
|
25
|
-
name?: string;
|
|
26
|
-
short_name?: string;
|
|
27
|
-
display?: "standalone" | "fullscreen" | "minimal-ui" | "browser";
|
|
28
|
-
theme_color?: string;
|
|
29
|
-
background_color?: string;
|
|
30
|
-
icons?: Array<{ src: string; sizes: string; type?: string }>;
|
|
31
|
-
}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
| Field | Type | Description |
|
|
35
|
-
|-------|------|-------------|
|
|
36
|
-
| `name` | `string` | App name |
|
|
37
|
-
| `short_name` | `string` | Short app name |
|
|
38
|
-
| `display` | `"standalone" \| "fullscreen" \| "minimal-ui" \| "browser"` | Display mode |
|
|
39
|
-
| `theme_color` | `string` | Theme color |
|
|
40
|
-
| `background_color` | `string` | Background color |
|
|
41
|
-
| `icons` | `Array<{ src: string; sizes: string; type?: string }>` | App icons |
|
|
42
|
-
|
|
43
|
-
## `SdPwaWorkboxConfig`
|
|
44
|
-
|
|
45
|
-
PWA workbox configuration.
|
|
46
|
-
|
|
47
|
-
```typescript
|
|
48
|
-
interface SdPwaWorkboxConfig {
|
|
49
|
-
globPatterns?: string[];
|
|
50
|
-
}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
| Field | Type | Description |
|
|
54
|
-
|-------|------|-------------|
|
|
55
|
-
| `globPatterns` | `string[]` | Glob patterns for precaching |
|
package/docs/vitest-plugin.md
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# Vitest Plugin
|
|
2
|
-
|
|
3
|
-
## `angularVitestPlugin`
|
|
4
|
-
|
|
5
|
-
Vite plugin for Angular AOT compilation in Vitest. Compiles `src/` files and `.fixture.` files using Angular's `NgtscProgram`, caching the compiled output in memory and returning it from the `transform` hook.
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
function angularVitestPlugin(options: AngularVitestPluginOptions): Plugin;
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
| Parameter | Type | Description |
|
|
12
|
-
|-----------|------|-------------|
|
|
13
|
-
| `options` | `AngularVitestPluginOptions` | Plugin options |
|
|
14
|
-
|
|
15
|
-
**Returns:** A Vite `Plugin` object with `buildStart` and `transform` hooks.
|
|
16
|
-
|
|
17
|
-
**Behavior:**
|
|
18
|
-
|
|
19
|
-
- `buildStart`: Reads `tsconfig.json`, creates an Angular `NgtscProgram`, runs AOT analysis, and emits compiled JavaScript for each source file into an in-memory cache.
|
|
20
|
-
- `transform`: For `.ts` files (excluding `node_modules`), returns the cached compiled output if available.
|
|
21
|
-
|
|
22
|
-
**Usage:**
|
|
23
|
-
|
|
24
|
-
```typescript
|
|
25
|
-
import { angularVitestPlugin } from "@simplysm/sd-cli/vitest-plugin";
|
|
26
|
-
import { defineConfig } from "vitest/config";
|
|
27
|
-
|
|
28
|
-
export default defineConfig({
|
|
29
|
-
plugins: [angularVitestPlugin({ tsconfig: "./tsconfig.json" })],
|
|
30
|
-
});
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## `AngularVitestPluginOptions`
|
|
34
|
-
|
|
35
|
-
Options for `angularVitestPlugin`.
|
|
36
|
-
|
|
37
|
-
```typescript
|
|
38
|
-
interface AngularVitestPluginOptions {
|
|
39
|
-
tsconfig: string;
|
|
40
|
-
cwd?: string;
|
|
41
|
-
}
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
| Field | Type | Description |
|
|
45
|
-
|-------|------|-------------|
|
|
46
|
-
| `tsconfig` | `string` | Angular package's `tsconfig.json` absolute path |
|
|
47
|
-
| `cwd` | `string` | Monorepo workspace root path. When not specified, uses two directories above the `tsconfig` path |
|