@stencil/cli 5.0.0-beta.3 → 5.0.0-beta.30
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 +1 -1
- package/dist/index.d.mts +34 -4
- package/dist/index.mjs +459 -803
- package/package.json +8 -5
package/README.md
CHANGED
|
@@ -67,6 +67,6 @@ const flags = createConfigFlags({ task: 'build', dev: true });
|
|
|
67
67
|
await runTask(coreCompiler, config, 'build', sys, flags);
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
Valid `task` values: `'build'` | `'docs'` | `'generate'` | `'serve'` | `'prerender'` | `'info'` | `'migrate'` | `'init'` | `'add'`
|
|
70
|
+
Valid `task` values: `'build'` | `'docs'` | `'generate'` | `'serve'` | `'prerender'` | `'info'` | `'migrate'` | `'init'` | `'add'`
|
|
71
71
|
|
|
72
72
|
`flags` is optional - if omitted, defaults are derived from the task.
|
package/dist/index.d.mts
CHANGED
|
@@ -4,13 +4,13 @@ import { ConfigCompat, LogLevel, OutputTarget } from "@stencil/core/compiler";
|
|
|
4
4
|
/**
|
|
5
5
|
* Supported CLI task commands
|
|
6
6
|
*/
|
|
7
|
-
type TaskCommand = 'add' | 'build' | 'docs' | 'generate' | 'g' | 'help' | 'info' | 'init' | 'migrate' | 'prerender' | 'serve' | '
|
|
7
|
+
type TaskCommand = 'add' | 'build' | 'docs' | 'generate' | 'g' | 'help' | 'info' | 'init' | 'migrate' | 'prerender' | 'serve' | 'version';
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/config-flags.d.ts
|
|
10
10
|
/**
|
|
11
11
|
* All the Boolean options supported by the Stencil CLI
|
|
12
12
|
*/
|
|
13
|
-
declare const BOOLEAN_CLI_FLAGS: readonly ["
|
|
13
|
+
declare const BOOLEAN_CLI_FLAGS: readonly ["cache", "ci", "debug", "dev", "dryRun", "help", "log", "open", "prerender", "profile", "serviceWorker", "serve", "ssr", "verbose", "version", "watch"];
|
|
14
14
|
/**
|
|
15
15
|
* All the Number options supported by the Stencil CLI
|
|
16
16
|
*/
|
|
@@ -174,6 +174,11 @@ interface ProjectConfig {
|
|
|
174
174
|
compat?: ConfigCompat;
|
|
175
175
|
/** Enable signal-based reactivity backing (top-level in stencil.config.ts). */
|
|
176
176
|
signalBacking?: boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Whether the build writes an `exports` map into the project's `package.json`. When `true`,
|
|
179
|
+
* consumers can only import the paths that map lists (e.g. `<pkg>/ssr`, not `<pkg>/dist/ssr`).
|
|
180
|
+
*/
|
|
181
|
+
generateExportMaps?: boolean;
|
|
177
182
|
}
|
|
178
183
|
/**
|
|
179
184
|
* Structured editor for `stencil.config.ts`, backed by the TypeScript compiler API.
|
|
@@ -323,6 +328,19 @@ interface StencilConfigEditor {
|
|
|
323
328
|
* editor.removePlugin('sass(');
|
|
324
329
|
*/
|
|
325
330
|
removePlugin(substring: string): boolean;
|
|
331
|
+
/**
|
|
332
|
+
* Sets a top-level property on the config object to `expression`, replacing its
|
|
333
|
+
* value if the property already exists, or adding it (after `namespace`, when
|
|
334
|
+
* present) if it doesn't.
|
|
335
|
+
*
|
|
336
|
+
* @param name - The config property, e.g. `'generateExportMaps'`.
|
|
337
|
+
* @param expression - A TypeScript expression, inserted verbatim, e.g. `'true'`.
|
|
338
|
+
*
|
|
339
|
+
* @example
|
|
340
|
+
* editor.setProperty('generateExportMaps', 'true');
|
|
341
|
+
* // > generateExportMaps: true,
|
|
342
|
+
*/
|
|
343
|
+
setProperty(name: string, expression: string): void;
|
|
326
344
|
/** Write all accumulated edits back to disk. */
|
|
327
345
|
save(): Promise<void>;
|
|
328
346
|
}
|
|
@@ -362,6 +380,16 @@ interface WizardContext {
|
|
|
362
380
|
*/
|
|
363
381
|
ts: typeof import('typescript');
|
|
364
382
|
}
|
|
383
|
+
/**
|
|
384
|
+
* What `stencil generate` is creating - passed to each {@link WizardFileTemplate.template}.
|
|
385
|
+
*/
|
|
386
|
+
interface GeneratedComponentInfo {
|
|
387
|
+
/**
|
|
388
|
+
* `true` for a CSS-only component: a `@component`-marked stylesheet with no JS class, so there's
|
|
389
|
+
* nothing to import - refer to it by tag name.
|
|
390
|
+
*/
|
|
391
|
+
cssOnly: boolean;
|
|
392
|
+
}
|
|
365
393
|
/**
|
|
366
394
|
* A single file a plugin can offer during `stencil generate`.
|
|
367
395
|
*/
|
|
@@ -381,7 +409,7 @@ interface WizardFileTemplate {
|
|
|
381
409
|
/**
|
|
382
410
|
* Returns the file content. `className` is the PascalCase form of `tagName`.
|
|
383
411
|
*/
|
|
384
|
-
template: (tagName: string, className: string) => string;
|
|
412
|
+
template: (tagName: string, className: string, component: GeneratedComponentInfo) => string;
|
|
385
413
|
/** Pre-selected in the generate prompt. Defaults to `true`. */
|
|
386
414
|
selectedByDefault?: boolean;
|
|
387
415
|
}
|
|
@@ -391,6 +419,8 @@ interface WizardFileTemplate {
|
|
|
391
419
|
interface GenerateContext {
|
|
392
420
|
/** The dash-case component tag name entered by the user. */
|
|
393
421
|
tagName: string;
|
|
422
|
+
/** `true` when generating a CSS-only component - e.g. to leave out templates that need a JS class. */
|
|
423
|
+
cssOnly: boolean;
|
|
394
424
|
/** Resolved project config. See {@link ProjectConfig} for available fields. */
|
|
395
425
|
config: ProjectConfig;
|
|
396
426
|
/** Clack prompts - use instead of importing `@clack/prompts` directly for consistent UX. */
|
|
@@ -457,4 +487,4 @@ interface StencilWizardPlugin {
|
|
|
457
487
|
init?: WizardInitContribution;
|
|
458
488
|
}
|
|
459
489
|
//#endregion
|
|
460
|
-
export { BOOLEAN_CLI_FLAGS, type ConfigFlags, type GenerateContext, type ProjectConfig, type StencilConfigEditor, type StencilWizardPlugin, type TaskCommand, type WizardContext, type WizardFileTemplate, type WizardGenerateContribution, type WizardInitContribution, createConfigFlags, parseFlags, run, runTask };
|
|
490
|
+
export { BOOLEAN_CLI_FLAGS, type ConfigFlags, type GenerateContext, type GeneratedComponentInfo, type ProjectConfig, type StencilConfigEditor, type StencilWizardPlugin, type TaskCommand, type WizardContext, type WizardFileTemplate, type WizardGenerateContribution, type WizardInitContribution, createConfigFlags, parseFlags, run, runTask };
|