@stencil/cli 5.0.0-alpha.5 → 5.0.0-alpha.7

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/dist/index.d.mts CHANGED
@@ -1,11 +1,11 @@
1
- import * as _$_stencil_core_compiler0 from "@stencil/core/compiler";
1
+ import * as d from "@stencil/core/compiler";
2
2
  import { LogLevel } from "@stencil/core/compiler";
3
3
 
4
4
  //#region src/types.d.ts
5
5
  /**
6
6
  * Supported CLI task commands
7
7
  */
8
- type TaskCommand = 'build' | 'docs' | 'generate' | 'g' | 'help' | 'info' | 'migrate' | 'prerender' | 'serve' | 'telemetry' | 'test' | 'version';
8
+ type TaskCommand = 'build' | 'docs' | 'generate' | 'g' | 'help' | 'info' | 'init' | 'migrate' | 'prerender' | 'serve' | 'telemetry' | 'test' | 'version';
9
9
  //#endregion
10
10
  //#region src/config-flags.d.ts
11
11
  /**
@@ -123,7 +123,7 @@ declare const createConfigFlags: (init?: Partial<ConfigFlags>) => ConfigFlags;
123
123
  declare const parseFlags: (args: string[]) => ConfigFlags;
124
124
  //#endregion
125
125
  //#region src/load-compiler.d.ts
126
- type CoreCompiler = typeof _$_stencil_core_compiler0;
126
+ type CoreCompiler = typeof import('@stencil/core/compiler');
127
127
  //#endregion
128
128
  //#region src/run.d.ts
129
129
  /**
@@ -136,7 +136,7 @@ type CoreCompiler = typeof _$_stencil_core_compiler0;
136
136
  * @param init initial CLI options
137
137
  * @returns an empty promise
138
138
  */
139
- declare const run: (init: _$_stencil_core_compiler0.CliInitOptions) => Promise<any>;
139
+ declare const run: (init: d.CliInitOptions) => Promise<any>;
140
140
  /**
141
141
  * Run a specified task
142
142
  *
@@ -148,6 +148,97 @@ declare const run: (init: _$_stencil_core_compiler0.CliInitOptions) => Promise<a
148
148
  * @public
149
149
  * @returns a void promise
150
150
  */
151
- declare const runTask: (coreCompiler: CoreCompiler, config: _$_stencil_core_compiler0.Config, task: TaskCommand, sys: _$_stencil_core_compiler0.CompilerSystem, flags?: ConfigFlags) => Promise<void>;
151
+ declare const runTask: (coreCompiler: CoreCompiler, config: d.Config, task: TaskCommand, sys: d.CompilerSystem, flags?: ConfigFlags) => Promise<void>;
152
152
  //#endregion
153
- export { BOOLEAN_CLI_FLAGS, type ConfigFlags, type TaskCommand, createConfigFlags, parseFlags, run, runTask };
153
+ //#region src/wizard/types.d.ts
154
+ /**
155
+ * Context passed to wizard steps at runtime.
156
+ */
157
+ interface WizardContext {
158
+ /** Absolute path to the project root directory. */
159
+ rootDir: string;
160
+ /** True when `stencil.config.ts` did not previously exist (fresh scaffold). */
161
+ isNewProject: boolean;
162
+ }
163
+ /**
164
+ * A single file a plugin can offer during `stencil generate`.
165
+ */
166
+ interface WizardFileTemplate {
167
+ /** Label shown in the generate prompt checkbox, e.g. `"Spec Test (.spec.tsx)"`. */
168
+ label: string;
169
+ /**
170
+ * File extension used to derive the filename and deduplicate contributions,
171
+ * e.g. `"spec.tsx"` or `"e2e.ts"`.
172
+ */
173
+ extension: string;
174
+ /**
175
+ * Subdirectory within the component directory where the file is placed.
176
+ * e.g. `'test'` to place alongside other test files. Omit for the component root.
177
+ */
178
+ subdirectory?: string;
179
+ /**
180
+ * Returns the file content. `className` is the PascalCase form of `tagName`.
181
+ */
182
+ template: (tagName: string, className: string) => string;
183
+ /** Pre-selected in the generate prompt. Defaults to `true`. */
184
+ selectedByDefault?: boolean;
185
+ }
186
+ /**
187
+ * Contribution a package can make to `stencil generate`.
188
+ */
189
+ interface WizardGenerateContribution {
190
+ /**
191
+ * Files this plugin can generate alongside the component.
192
+ * Each entry appears as a checkbox in the generate prompt.
193
+ * A single plugin may contribute multiple entries (e.g. a vitest setup
194
+ * with several project configs, each producing a differently-scoped test file).
195
+ */
196
+ fileTemplates?: ReadonlyArray<WizardFileTemplate>;
197
+ /**
198
+ * Additional style extensions this package supports (e.g. `['sass', 'scss']`
199
+ * from `@stencil/sass`). The first entry is used as the default.
200
+ */
201
+ styleExtensions?: ReadonlyArray<string>;
202
+ }
203
+ /**
204
+ * Contribution a package can make to `stencil init`.
205
+ *
206
+ * The plugin owns its entire setup: prompts, peer dep installs, config file
207
+ * generation, example files, package.json script updates, etc.
208
+ */
209
+ interface WizardInitContribution {
210
+ /** Stable identifier used to deduplicate across re-runs. */
211
+ id: string;
212
+ /** Human-readable name shown in the prompt list. */
213
+ displayName: string;
214
+ /** One-line description shown alongside the name. */
215
+ description: string;
216
+ /**
217
+ * Called by the CLI after packages are installed. The plugin is responsible
218
+ * for all further setup: additional prompts, peer dep installs, config file
219
+ * writes, example tests, `.gitignore` and `package.json` script updates, etc.
220
+ */
221
+ run: (context: WizardContext) => Promise<void>;
222
+ }
223
+ /**
224
+ * Interface a package exports to participate in `stencil init` and/or
225
+ * `stencil generate`.
226
+ *
227
+ * Declare the entry point in `package.json`:
228
+ * ```json
229
+ * { "stencil": { "wizard": "./dist/wizard.js" } }
230
+ * ```
231
+ *
232
+ * Export a named `wizard` constant from that module:
233
+ * ```ts
234
+ * export const wizard: StencilWizardPlugin = { ... };
235
+ * ```
236
+ */
237
+ interface StencilWizardPlugin {
238
+ /** Contributions to `stencil generate`. */
239
+ generate?: WizardGenerateContribution;
240
+ /** Contributions to `stencil init`. */
241
+ init?: WizardInitContribution;
242
+ }
243
+ //#endregion
244
+ export { BOOLEAN_CLI_FLAGS, type ConfigFlags, type StencilWizardPlugin, type TaskCommand, type WizardContext, type WizardFileTemplate, type WizardGenerateContribution, type WizardInitContribution, createConfigFlags, parseFlags, run, runTask };