@stencil/core 2.16.1-0 → 2.17.1
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/cli/config-flags.d.ts +102 -0
- package/cli/index.cjs +697 -224
- package/cli/index.d.ts +2 -1
- package/cli/index.js +697 -224
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +856 -290
- package/compiler/stencil.min.js +2 -2
- package/dependencies.json +1 -1
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/package.json +1 -1
- package/internal/client/css-shim.js +1 -1
- package/internal/client/dom.js +1 -1
- package/internal/client/index.js +11 -6
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/client/patch-esm.js +1 -1
- package/internal/client/shadow-css.js +1 -1
- package/internal/hydrate/index.js +2 -2
- package/internal/hydrate/package.json +1 -1
- package/internal/package.json +1 -1
- package/internal/stencil-private.d.ts +6 -2
- package/internal/stencil-public-compiler.d.ts +67 -48
- package/internal/testing/index.js +1 -1
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +140 -5
- package/mock-doc/index.d.ts +76 -1
- package/mock-doc/index.js +140 -5
- package/mock-doc/package.json +1 -1
- package/package.json +2 -1
- package/screenshot/package.json +1 -1
- package/sys/node/index.js +325 -314
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.d.ts +1 -1
- package/testing/index.js +436 -381
- package/testing/jest/jest-config.d.ts +1 -1
- package/testing/jest/jest-runner.d.ts +3 -2
- package/testing/jest/jest-screenshot.d.ts +1 -1
- package/testing/mocks.d.ts +48 -3
- package/testing/package.json +1 -1
- package/testing/puppeteer/puppeteer-browser.d.ts +2 -2
- package/testing/test/testing-utils.spec.d.ts +1 -0
- package/testing/testing-utils.d.ts +74 -2
- package/testing/testing.d.ts +2 -2
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { LogLevel, TaskCommand } from '../internal/index';
|
|
2
|
+
/**
|
|
3
|
+
* All the Boolean options supported by the Stencil CLI
|
|
4
|
+
*/
|
|
5
|
+
export declare const BOOLEAN_CLI_ARGS: readonly ["build", "cache", "checkVersion", "ci", "compare", "debug", "dev", "devtools", "docs", "e2e", "es5", "esm", "headless", "help", "log", "open", "prerender", "prerenderExternal", "prod", "profile", "serviceWorker", "screenshot", "serve", "skipNodeCheck", "spec", "ssr", "stats", "updateScreenshot", "verbose", "version", "watch", "all", "automock", "bail", "changedFilesWithAncestor", "clearCache", "clearMocks", "collectCoverage", "color", "colors", "coverage", "detectLeaks", "detectOpenHandles", "errorOnDeprecated", "expand", "findRelatedTests", "forceExit", "init", "injectGlobals", "json", "lastCommit", "listTests", "logHeapUsage", "noStackTrace", "notify", "onlyChanged", "onlyFailures", "passWithNoTests", "resetMocks", "resetModules", "restoreMocks", "runInBand", "runTestsByPath", "showConfig", "silent", "skipFilter", "testLocationInResults", "updateSnapshot", "useStderr", "watchAll", "watchman"];
|
|
6
|
+
/**
|
|
7
|
+
* All the Number options supported by the Stencil CLI
|
|
8
|
+
*/
|
|
9
|
+
export declare const NUMBER_CLI_ARGS: readonly ["port", "maxConcurrency", "testTimeout"];
|
|
10
|
+
/**
|
|
11
|
+
* All the String options supported by the Stencil CLI
|
|
12
|
+
*/
|
|
13
|
+
export declare const STRING_CLI_ARGS: readonly ["address", "config", "docsApi", "docsJson", "emulate", "root", "screenshotConnector", "cacheDirectory", "changedSince", "collectCoverageFrom", "coverageDirectory", "coverageThreshold", "env", "filter", "globalSetup", "globalTeardown", "globals", "haste", "moduleNameMapper", "notifyMode", "outputFile", "preset", "prettierPath", "resolver", "rootDir", "runner", "testEnvironment", "testEnvironmentOptions", "testFailureExitCode", "testNamePattern", "testResultsProcessor", "testRunner", "testSequencer", "testURL", "timers", "transform", "collectCoverageOnlyFrom", "coveragePathIgnorePatterns", "coverageReporters", "moduleDirectories", "moduleFileExtensions", "modulePathIgnorePatterns", "modulePaths", "projects", "reporters", "roots", "selectProjects", "setupFiles", "setupFilesAfterEnv", "snapshotSerializers", "testMatch", "testPathIgnorePatterns", "testPathPattern", "testRegex", "transformIgnorePatterns", "unmockedModulePathPatterns", "watchPathIgnorePatterns"];
|
|
14
|
+
/**
|
|
15
|
+
* All the CLI arguments which may have string or number values
|
|
16
|
+
*
|
|
17
|
+
* `maxWorkers` is an argument which is used both by Stencil _and_ by Jest,
|
|
18
|
+
* which means that we need to support parsing both string and number values.
|
|
19
|
+
*/
|
|
20
|
+
export declare const STRING_NUMBER_CLI_ARGS: readonly ["maxWorkers"];
|
|
21
|
+
/**
|
|
22
|
+
* All the LogLevel-type options supported by the Stencil CLI
|
|
23
|
+
*
|
|
24
|
+
* This is a bit silly since there's only one such argument atm,
|
|
25
|
+
* but this approach lets us make sure that we're handling all
|
|
26
|
+
* our arguments in a type-safe way.
|
|
27
|
+
*/
|
|
28
|
+
export declare const LOG_LEVEL_CLI_ARGS: readonly ["logLevel"];
|
|
29
|
+
/**
|
|
30
|
+
* A type which gives the members of a `ReadonlyArray<string>` as
|
|
31
|
+
* an enum-like type which can be used for e.g. keys in a `Record`
|
|
32
|
+
* (as in the `AliasMap` type below)
|
|
33
|
+
*/
|
|
34
|
+
declare type ArrayValuesAsUnion<T extends ReadonlyArray<string>> = T[number];
|
|
35
|
+
export declare type BooleanCLIArg = ArrayValuesAsUnion<typeof BOOLEAN_CLI_ARGS>;
|
|
36
|
+
export declare type StringCLIArg = ArrayValuesAsUnion<typeof STRING_CLI_ARGS>;
|
|
37
|
+
export declare type NumberCLIArg = ArrayValuesAsUnion<typeof NUMBER_CLI_ARGS>;
|
|
38
|
+
export declare type StringNumberCLIArg = ArrayValuesAsUnion<typeof STRING_NUMBER_CLI_ARGS>;
|
|
39
|
+
export declare type LogCLIArg = ArrayValuesAsUnion<typeof LOG_LEVEL_CLI_ARGS>;
|
|
40
|
+
declare type KnownCLIArg = BooleanCLIArg | StringCLIArg | NumberCLIArg | StringNumberCLIArg | LogCLIArg;
|
|
41
|
+
declare type AliasMap = Partial<Record<KnownCLIArg, string>>;
|
|
42
|
+
/**
|
|
43
|
+
* For a small subset of CLI options we support a short alias e.g. `'h'` for `'help'`
|
|
44
|
+
*/
|
|
45
|
+
export declare const CLI_ARG_ALIASES: AliasMap;
|
|
46
|
+
/**
|
|
47
|
+
* Given two types `K` and `T` where `K` extends `ReadonlyArray<string>`,
|
|
48
|
+
* construct a type which maps the strings in `K` as keys to values of type `T`.
|
|
49
|
+
*
|
|
50
|
+
* Because we use types derived this way to construct an interface (`ConfigFlags`)
|
|
51
|
+
* for which we want optional keys, we make all the properties optional (w/ `'?'`)
|
|
52
|
+
* and possibly null.
|
|
53
|
+
*/
|
|
54
|
+
declare type ObjectFromKeys<K extends ReadonlyArray<string>, T> = {
|
|
55
|
+
[key in K[number]]?: T | null;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Type containing the possible Boolean configuration flags, to be included
|
|
59
|
+
* in ConfigFlags, below
|
|
60
|
+
*/
|
|
61
|
+
declare type BooleanConfigFlags = ObjectFromKeys<typeof BOOLEAN_CLI_ARGS, boolean>;
|
|
62
|
+
/**
|
|
63
|
+
* Type containing the possible String configuration flags, to be included
|
|
64
|
+
* in ConfigFlags, below
|
|
65
|
+
*/
|
|
66
|
+
declare type StringConfigFlags = ObjectFromKeys<typeof STRING_CLI_ARGS, string>;
|
|
67
|
+
/**
|
|
68
|
+
* Type containing the possible numeric configuration flags, to be included
|
|
69
|
+
* in ConfigFlags, below
|
|
70
|
+
*/
|
|
71
|
+
declare type NumberConfigFlags = ObjectFromKeys<typeof NUMBER_CLI_ARGS, number>;
|
|
72
|
+
/**
|
|
73
|
+
* Type containing the configuration flags which may be set to either string
|
|
74
|
+
* or number values.
|
|
75
|
+
*/
|
|
76
|
+
declare type StringNumberConfigFlags = ObjectFromKeys<typeof STRING_NUMBER_CLI_ARGS, string | number>;
|
|
77
|
+
/**
|
|
78
|
+
* Type containing the possible LogLevel configuration flags, to be included
|
|
79
|
+
* in ConfigFlags, below
|
|
80
|
+
*/
|
|
81
|
+
declare type LogLevelFlags = ObjectFromKeys<typeof LOG_LEVEL_CLI_ARGS, LogLevel>;
|
|
82
|
+
/**
|
|
83
|
+
* The configuration flags which can be set by the user on the command line.
|
|
84
|
+
* This interface captures both known arguments (which are enumerated and then
|
|
85
|
+
* parsed according to their types) and unknown arguments which the user may
|
|
86
|
+
* pass at the CLI.
|
|
87
|
+
*
|
|
88
|
+
* Note that this interface is constructed by extending `BooleanConfigFlags`,
|
|
89
|
+
* `StringConfigFlags`, etc. These types are in turn constructed from types
|
|
90
|
+
* extending `ReadonlyArray<string>` which we declare in another module. This
|
|
91
|
+
* allows us to record our known CLI arguments in one place, using a
|
|
92
|
+
* `ReadonlyArray<string>` to get both a type-level representation of what CLI
|
|
93
|
+
* options we support and a runtime list of strings which can be used to match
|
|
94
|
+
* on actual flags passed by the user.
|
|
95
|
+
*/
|
|
96
|
+
export interface ConfigFlags extends BooleanConfigFlags, StringConfigFlags, NumberConfigFlags, StringNumberConfigFlags, LogLevelFlags {
|
|
97
|
+
task?: TaskCommand | null;
|
|
98
|
+
args?: string[];
|
|
99
|
+
knownArgs?: string[];
|
|
100
|
+
unknownArgs?: string[];
|
|
101
|
+
}
|
|
102
|
+
export {};
|