@rindo/core 3.0.1 → 3.2.0

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.
Files changed (112) hide show
  1. package/cli/config-flags.d.ts +122 -122
  2. package/cli/index.cjs +2335 -2432
  3. package/cli/index.d.ts +19 -19
  4. package/cli/index.js +2336 -2433
  5. package/cli/package.json +1 -1
  6. package/compiler/package.json +1 -1
  7. package/compiler/rindo.d.ts +73 -73
  8. package/compiler/rindo.js +66180 -62899
  9. package/compiler/rindo.min.js +2 -2
  10. package/compiler/sys/in-memory-fs.d.ts +218 -218
  11. package/compiler/transpile.d.ts +32 -32
  12. package/dev-server/client/app-error.d.ts +18 -18
  13. package/dev-server/client/events.d.ts +6 -6
  14. package/dev-server/client/hmr-components.d.ts +1 -1
  15. package/dev-server/client/hmr-external-styles.d.ts +1 -1
  16. package/dev-server/client/hmr-images.d.ts +1 -1
  17. package/dev-server/client/hmr-inline-styles.d.ts +1 -1
  18. package/dev-server/client/hmr-util.d.ts +9 -9
  19. package/dev-server/client/hmr-window.d.ts +10 -10
  20. package/dev-server/client/index.d.ts +6 -6
  21. package/dev-server/client/index.js +781 -781
  22. package/dev-server/client/logger.d.ts +5 -5
  23. package/dev-server/client/package.json +1 -1
  24. package/dev-server/client/progress.d.ts +3 -3
  25. package/dev-server/client/status.d.ts +4 -4
  26. package/dev-server/connector.html +2 -2
  27. package/dev-server/index.d.ts +3 -3
  28. package/dev-server/index.js +228 -228
  29. package/dev-server/open-in-editor-api.js +1 -1
  30. package/dev-server/package.json +1 -1
  31. package/dev-server/server-process.js +1300 -1281
  32. package/dev-server/ws.js +1 -1
  33. package/dev-server/xdg-open +0 -0
  34. package/internal/app-data/index.cjs +88 -88
  35. package/internal/app-data/index.d.ts +4 -4
  36. package/internal/app-data/index.js +88 -88
  37. package/internal/app-data/package.json +1 -1
  38. package/internal/client/css-shim.js +1 -1
  39. package/internal/client/dom.js +1 -1
  40. package/internal/client/index.js +3380 -3380
  41. package/internal/client/package.json +1 -1
  42. package/internal/client/patch-browser.js +155 -155
  43. package/internal/client/patch-esm.js +25 -25
  44. package/internal/client/shadow-css.js +382 -382
  45. package/internal/hydrate/package.json +1 -1
  46. package/internal/index.d.ts +2 -2
  47. package/internal/index.js +1 -1
  48. package/internal/package.json +1 -1
  49. package/internal/rindo-private.d.ts +2289 -2268
  50. package/internal/rindo-public-compiler.d.ts +2429 -2356
  51. package/internal/rindo-public-docs.d.ts +139 -139
  52. package/internal/rindo-public-runtime.d.ts +1636 -1636
  53. package/internal/testing/package.json +1 -1
  54. package/mock-doc/index.cjs +4766 -4766
  55. package/mock-doc/index.d.ts +1006 -1006
  56. package/mock-doc/index.js +4766 -4766
  57. package/mock-doc/package.json +1 -1
  58. package/package.json +9 -9
  59. package/screenshot/connector-base.d.ts +42 -42
  60. package/screenshot/connector-local.d.ts +7 -7
  61. package/screenshot/index.d.ts +3 -3
  62. package/screenshot/index.js +615 -615
  63. package/screenshot/package.json +1 -1
  64. package/screenshot/pixel-match.d.ts +1 -1
  65. package/screenshot/pixel-match.js +14 -14
  66. package/screenshot/screenshot-compare.d.ts +3 -3
  67. package/screenshot/screenshot-fs.d.ts +15 -15
  68. package/sys/node/autoprefixer.js +2 -2
  69. package/sys/node/glob.js +1 -1
  70. package/sys/node/graceful-fs.js +1 -1
  71. package/sys/node/index.d.ts +22 -22
  72. package/sys/node/index.js +14 -8
  73. package/sys/node/node-fetch.js +1 -1
  74. package/sys/node/package.json +1 -1
  75. package/sys/node/prompts.js +1 -1
  76. package/sys/node/worker.js +1 -1
  77. package/testing/index.d.ts +12 -12
  78. package/testing/index.js +7 -3
  79. package/testing/jest/jest-config.d.ts +16 -16
  80. package/testing/jest/jest-environment.d.ts +15 -15
  81. package/testing/jest/jest-preprocessor.d.ts +59 -59
  82. package/testing/jest/jest-runner.d.ts +10 -10
  83. package/testing/jest/jest-screenshot.d.ts +2 -2
  84. package/testing/jest/jest-serializer.d.ts +4 -4
  85. package/testing/jest/jest-setup-test-framework.d.ts +1 -1
  86. package/testing/jest-preset.js +1 -1
  87. package/testing/matchers/attributes.d.ts +14 -14
  88. package/testing/matchers/class-list.d.ts +12 -12
  89. package/testing/matchers/events.d.ts +21 -21
  90. package/testing/matchers/html.d.ts +12 -12
  91. package/testing/matchers/index.d.ts +23 -23
  92. package/testing/matchers/screenshot.d.ts +5 -5
  93. package/testing/matchers/text.d.ts +4 -4
  94. package/testing/mock-fetch.d.ts +11 -11
  95. package/testing/mocks.d.ts +56 -56
  96. package/testing/package.json +1 -1
  97. package/testing/puppeteer/index.d.ts +2 -2
  98. package/testing/puppeteer/puppeteer-browser.d.ts +6 -6
  99. package/testing/puppeteer/puppeteer-declarations.d.ts +403 -403
  100. package/testing/puppeteer/puppeteer-element.d.ts +67 -67
  101. package/testing/puppeteer/puppeteer-emulate.d.ts +2 -2
  102. package/testing/puppeteer/puppeteer-events.d.ts +21 -21
  103. package/testing/puppeteer/puppeteer-page.d.ts +2 -2
  104. package/testing/puppeteer/puppeteer-screenshot.d.ts +4 -4
  105. package/testing/reset-build-conditionals.d.ts +2 -2
  106. package/testing/spec-page.d.ts +2 -2
  107. package/testing/test-transpile.d.ts +2 -2
  108. package/testing/testing-logger.d.ts +25 -25
  109. package/testing/testing-sys.d.ts +6 -6
  110. package/testing/testing-utils.d.ts +79 -79
  111. package/testing/testing.d.ts +2 -2
  112. package/dependencies.json +0 -120
@@ -1,122 +1,122 @@
1
- import type { LogLevel, TaskCommand } from '../internal/index';
2
- /**
3
- * All the Boolean options supported by the Rindo CLI
4
- */
5
- export declare const BOOLEAN_CLI_FLAGS: 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 Rindo CLI
8
- */
9
- export declare const NUMBER_CLI_FLAGS: readonly ["port", "maxConcurrency", "testTimeout"];
10
- /**
11
- * All the String options supported by the Rindo CLI
12
- */
13
- export declare const STRING_CLI_FLAGS: 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"];
14
- export declare const STRING_ARRAY_CLI_FLAGS: readonly ["collectCoverageOnlyFrom", "coveragePathIgnorePatterns", "coverageReporters", "moduleDirectories", "moduleFileExtensions", "modulePathIgnorePatterns", "modulePaths", "projects", "reporters", "roots", "selectProjects", "setupFiles", "setupFilesAfterEnv", "snapshotSerializers", "testMatch", "testPathIgnorePatterns", "testPathPattern", "testRegex", "transformIgnorePatterns", "unmockedModulePathPatterns", "watchPathIgnorePatterns"];
15
- /**
16
- * All the CLI arguments which may have string or number values
17
- *
18
- * `maxWorkers` is an argument which is used both by Rindo _and_ by Jest,
19
- * which means that we need to support parsing both string and number values.
20
- */
21
- export declare const STRING_NUMBER_CLI_FLAGS: readonly ["maxWorkers"];
22
- /**
23
- * All the LogLevel-type options supported by the Rindo CLI
24
- *
25
- * This is a bit silly since there's only one such argument atm,
26
- * but this approach lets us make sure that we're handling all
27
- * our arguments in a type-safe way.
28
- */
29
- export declare const LOG_LEVEL_CLI_FLAGS: readonly ["logLevel"];
30
- /**
31
- * A type which gives the members of a `ReadonlyArray<string>` as
32
- * an enum-like type which can be used for e.g. keys in a `Record`
33
- * (as in the `AliasMap` type below)
34
- */
35
- type ArrayValuesAsUnion<T extends ReadonlyArray<string>> = T[number];
36
- export type BooleanCLIFlag = ArrayValuesAsUnion<typeof BOOLEAN_CLI_FLAGS>;
37
- export type StringCLIFlag = ArrayValuesAsUnion<typeof STRING_CLI_FLAGS>;
38
- export type StringArrayCLIFlag = ArrayValuesAsUnion<typeof STRING_ARRAY_CLI_FLAGS>;
39
- export type NumberCLIFlag = ArrayValuesAsUnion<typeof NUMBER_CLI_FLAGS>;
40
- export type StringNumberCLIFlag = ArrayValuesAsUnion<typeof STRING_NUMBER_CLI_FLAGS>;
41
- export type LogCLIFlag = ArrayValuesAsUnion<typeof LOG_LEVEL_CLI_FLAGS>;
42
- export type KnownCLIFlag = BooleanCLIFlag | StringCLIFlag | StringArrayCLIFlag | NumberCLIFlag | StringNumberCLIFlag | LogCLIFlag;
43
- type AliasMap = Partial<Record<string, KnownCLIFlag>>;
44
- /**
45
- * For a small subset of CLI options we support a short alias e.g. `'h'` for `'help'`
46
- */
47
- export declare const CLI_FLAG_ALIASES: AliasMap;
48
- /**
49
- * A regular expression which can be used to match a CLI flag for one of our
50
- * short aliases.
51
- */
52
- export declare const CLI_FLAG_REGEX: RegExp;
53
- /**
54
- * Given two types `K` and `T` where `K` extends `ReadonlyArray<string>`,
55
- * construct a type which maps the strings in `K` as keys to values of type `T`.
56
- *
57
- * Because we use types derived this way to construct an interface (`ConfigFlags`)
58
- * for which we want optional keys, we make all the properties optional (w/ `'?'`)
59
- * and possibly null.
60
- */
61
- type ObjectFromKeys<K extends ReadonlyArray<string>, T> = {
62
- [key in K[number]]?: T | null;
63
- };
64
- /**
65
- * Type containing the possible Boolean configuration flags, to be included
66
- * in ConfigFlags, below
67
- */
68
- type BooleanConfigFlags = ObjectFromKeys<typeof BOOLEAN_CLI_FLAGS, boolean>;
69
- /**
70
- * Type containing the possible String configuration flags, to be included
71
- * in ConfigFlags, below
72
- */
73
- type StringConfigFlags = ObjectFromKeys<typeof STRING_CLI_FLAGS, string>;
74
- /**
75
- * Type containing the possible String Array configuration flags. This is
76
- * one of the 'constituent types' for `ConfigFlags`.
77
- */
78
- type StringArrayConfigFlags = ObjectFromKeys<typeof STRING_ARRAY_CLI_FLAGS, string[]>;
79
- /**
80
- * Type containing the possible numeric configuration flags, to be included
81
- * in ConfigFlags, below
82
- */
83
- type NumberConfigFlags = ObjectFromKeys<typeof NUMBER_CLI_FLAGS, number>;
84
- /**
85
- * Type containing the configuration flags which may be set to either string
86
- * or number values.
87
- */
88
- type StringNumberConfigFlags = ObjectFromKeys<typeof STRING_NUMBER_CLI_FLAGS, string | number>;
89
- /**
90
- * Type containing the possible LogLevel configuration flags, to be included
91
- * in ConfigFlags, below
92
- */
93
- type LogLevelFlags = ObjectFromKeys<typeof LOG_LEVEL_CLI_FLAGS, LogLevel>;
94
- /**
95
- * The configuration flags which can be set by the user on the command line.
96
- * This interface captures both known arguments (which are enumerated and then
97
- * parsed according to their types) and unknown arguments which the user may
98
- * pass at the CLI.
99
- *
100
- * Note that this interface is constructed by extending `BooleanConfigFlags`,
101
- * `StringConfigFlags`, etc. These types are in turn constructed from types
102
- * extending `ReadonlyArray<string>` which we declare in another module. This
103
- * allows us to record our known CLI arguments in one place, using a
104
- * `ReadonlyArray<string>` to get both a type-level representation of what CLI
105
- * options we support and a runtime list of strings which can be used to match
106
- * on actual flags passed by the user.
107
- */
108
- export interface ConfigFlags extends BooleanConfigFlags, StringConfigFlags, StringArrayConfigFlags, NumberConfigFlags, StringNumberConfigFlags, LogLevelFlags {
109
- task: TaskCommand | null;
110
- args: string[];
111
- knownArgs: string[];
112
- unknownArgs: string[];
113
- }
114
- /**
115
- * Helper function for initializing a `ConfigFlags` object. Provide any overrides
116
- * for default values and off you go!
117
- *
118
- * @param init an object with any overrides for default values
119
- * @returns a complete CLI flag object
120
- */
121
- export declare const createConfigFlags: (init?: Partial<ConfigFlags>) => ConfigFlags;
122
- export {};
1
+ import type { LogLevel, TaskCommand } from '../internal/index';
2
+ /**
3
+ * All the Boolean options supported by the Rindo CLI
4
+ */
5
+ export declare const BOOLEAN_CLI_FLAGS: 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 Rindo CLI
8
+ */
9
+ export declare const NUMBER_CLI_FLAGS: readonly ["port", "maxConcurrency", "testTimeout"];
10
+ /**
11
+ * All the String options supported by the Rindo CLI
12
+ */
13
+ export declare const STRING_CLI_FLAGS: 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"];
14
+ export declare const STRING_ARRAY_CLI_FLAGS: readonly ["collectCoverageOnlyFrom", "coveragePathIgnorePatterns", "coverageReporters", "moduleDirectories", "moduleFileExtensions", "modulePathIgnorePatterns", "modulePaths", "projects", "reporters", "roots", "selectProjects", "setupFiles", "setupFilesAfterEnv", "snapshotSerializers", "testMatch", "testPathIgnorePatterns", "testPathPattern", "testRegex", "transformIgnorePatterns", "unmockedModulePathPatterns", "watchPathIgnorePatterns"];
15
+ /**
16
+ * All the CLI arguments which may have string or number values
17
+ *
18
+ * `maxWorkers` is an argument which is used both by Rindo _and_ by Jest,
19
+ * which means that we need to support parsing both string and number values.
20
+ */
21
+ export declare const STRING_NUMBER_CLI_FLAGS: readonly ["maxWorkers"];
22
+ /**
23
+ * All the LogLevel-type options supported by the Rindo CLI
24
+ *
25
+ * This is a bit silly since there's only one such argument atm,
26
+ * but this approach lets us make sure that we're handling all
27
+ * our arguments in a type-safe way.
28
+ */
29
+ export declare const LOG_LEVEL_CLI_FLAGS: readonly ["logLevel"];
30
+ /**
31
+ * A type which gives the members of a `ReadonlyArray<string>` as
32
+ * an enum-like type which can be used for e.g. keys in a `Record`
33
+ * (as in the `AliasMap` type below)
34
+ */
35
+ type ArrayValuesAsUnion<T extends ReadonlyArray<string>> = T[number];
36
+ export type BooleanCLIFlag = ArrayValuesAsUnion<typeof BOOLEAN_CLI_FLAGS>;
37
+ export type StringCLIFlag = ArrayValuesAsUnion<typeof STRING_CLI_FLAGS>;
38
+ export type StringArrayCLIFlag = ArrayValuesAsUnion<typeof STRING_ARRAY_CLI_FLAGS>;
39
+ export type NumberCLIFlag = ArrayValuesAsUnion<typeof NUMBER_CLI_FLAGS>;
40
+ export type StringNumberCLIFlag = ArrayValuesAsUnion<typeof STRING_NUMBER_CLI_FLAGS>;
41
+ export type LogCLIFlag = ArrayValuesAsUnion<typeof LOG_LEVEL_CLI_FLAGS>;
42
+ export type KnownCLIFlag = BooleanCLIFlag | StringCLIFlag | StringArrayCLIFlag | NumberCLIFlag | StringNumberCLIFlag | LogCLIFlag;
43
+ type AliasMap = Partial<Record<string, KnownCLIFlag>>;
44
+ /**
45
+ * For a small subset of CLI options we support a short alias e.g. `'h'` for `'help'`
46
+ */
47
+ export declare const CLI_FLAG_ALIASES: AliasMap;
48
+ /**
49
+ * A regular expression which can be used to match a CLI flag for one of our
50
+ * short aliases.
51
+ */
52
+ export declare const CLI_FLAG_REGEX: RegExp;
53
+ /**
54
+ * Given two types `K` and `T` where `K` extends `ReadonlyArray<string>`,
55
+ * construct a type which maps the strings in `K` as keys to values of type `T`.
56
+ *
57
+ * Because we use types derived this way to construct an interface (`ConfigFlags`)
58
+ * for which we want optional keys, we make all the properties optional (w/ `'?'`)
59
+ * and possibly null.
60
+ */
61
+ type ObjectFromKeys<K extends ReadonlyArray<string>, T> = {
62
+ [key in K[number]]?: T | null;
63
+ };
64
+ /**
65
+ * Type containing the possible Boolean configuration flags, to be included
66
+ * in ConfigFlags, below
67
+ */
68
+ type BooleanConfigFlags = ObjectFromKeys<typeof BOOLEAN_CLI_FLAGS, boolean>;
69
+ /**
70
+ * Type containing the possible String configuration flags, to be included
71
+ * in ConfigFlags, below
72
+ */
73
+ type StringConfigFlags = ObjectFromKeys<typeof STRING_CLI_FLAGS, string>;
74
+ /**
75
+ * Type containing the possible String Array configuration flags. This is
76
+ * one of the 'constituent types' for `ConfigFlags`.
77
+ */
78
+ type StringArrayConfigFlags = ObjectFromKeys<typeof STRING_ARRAY_CLI_FLAGS, string[]>;
79
+ /**
80
+ * Type containing the possible numeric configuration flags, to be included
81
+ * in ConfigFlags, below
82
+ */
83
+ type NumberConfigFlags = ObjectFromKeys<typeof NUMBER_CLI_FLAGS, number>;
84
+ /**
85
+ * Type containing the configuration flags which may be set to either string
86
+ * or number values.
87
+ */
88
+ type StringNumberConfigFlags = ObjectFromKeys<typeof STRING_NUMBER_CLI_FLAGS, string | number>;
89
+ /**
90
+ * Type containing the possible LogLevel configuration flags, to be included
91
+ * in ConfigFlags, below
92
+ */
93
+ type LogLevelFlags = ObjectFromKeys<typeof LOG_LEVEL_CLI_FLAGS, LogLevel>;
94
+ /**
95
+ * The configuration flags which can be set by the user on the command line.
96
+ * This interface captures both known arguments (which are enumerated and then
97
+ * parsed according to their types) and unknown arguments which the user may
98
+ * pass at the CLI.
99
+ *
100
+ * Note that this interface is constructed by extending `BooleanConfigFlags`,
101
+ * `StringConfigFlags`, etc. These types are in turn constructed from types
102
+ * extending `ReadonlyArray<string>` which we declare in another module. This
103
+ * allows us to record our known CLI arguments in one place, using a
104
+ * `ReadonlyArray<string>` to get both a type-level representation of what CLI
105
+ * options we support and a runtime list of strings which can be used to match
106
+ * on actual flags passed by the user.
107
+ */
108
+ export interface ConfigFlags extends BooleanConfigFlags, StringConfigFlags, StringArrayConfigFlags, NumberConfigFlags, StringNumberConfigFlags, LogLevelFlags {
109
+ task: TaskCommand | null;
110
+ args: string[];
111
+ knownArgs: string[];
112
+ unknownArgs: string[];
113
+ }
114
+ /**
115
+ * Helper function for initializing a `ConfigFlags` object. Provide any overrides
116
+ * for default values and off you go!
117
+ *
118
+ * @param init an object with any overrides for default values
119
+ * @returns a complete CLI flag object
120
+ */
121
+ export declare const createConfigFlags: (init?: Partial<ConfigFlags>) => ConfigFlags;
122
+ export {};