@arcgis/lumina-compiler 5.2.0-next.1 → 5.2.0-next.100

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 (105) hide show
  1. package/LICENSE.md +4 -2
  2. package/README.md +2 -2
  3. package/dist/context/index.d.ts +167 -296
  4. package/dist/context/types.d.ts +18 -34
  5. package/dist/defaultAssetsUrl.d.ts +6 -6
  6. package/dist/dependencies/discover.d.ts +43 -35
  7. package/dist/dependencies/updateLumina.d.ts +10 -11
  8. package/dist/docs/vsCodeCustomData/types.d.ts +5 -42
  9. package/dist/docs/webTypes/types.d.ts +5 -76
  10. package/dist/index.d.ts +20 -20
  11. package/dist/index.js +1796 -1599
  12. package/dist/jsxToLitHtml/config.d.ts +93 -121
  13. package/dist/{logger-C9XakOcA.js → logger-edpIalAo.js} +1 -1
  14. package/dist/options.d.ts +675 -0
  15. package/dist/puppeteerTesting/index.d.ts +18 -11
  16. package/dist/puppeteerTesting/index.js +105 -8
  17. package/dist/puppeteerTesting/puppeteer/element.d.ts +250 -217
  18. package/dist/puppeteerTesting/puppeteer/events.d.ts +15 -21
  19. package/dist/puppeteerTesting/puppeteer/page.d.ts +8 -5
  20. package/dist/puppeteerTesting/puppeteer/types.d.ts +130 -132
  21. package/dist/puppeteerTesting/vitest/matchers/index.d.ts +33 -30
  22. package/dist/testing/index.d.ts +4 -11
  23. package/dist/testing/mount.d.ts +113 -93
  24. package/dist/testing/wrapController.d.ts +5 -11
  25. package/dist/useLumina.d.ts +5 -2
  26. package/package.json +23 -12
  27. package/dist/context/logger.d.ts +0 -8
  28. package/dist/context/typeScript.d.ts +0 -6
  29. package/dist/context/utils.d.ts +0 -4
  30. package/dist/dependencies/arcgisCore.d.ts +0 -30
  31. package/dist/dependencies/index.d.ts +0 -12
  32. package/dist/dependencies/loaders.d.ts +0 -5
  33. package/dist/dependencies/lumina.d.ts +0 -3
  34. package/dist/dependencies/stencil.d.ts +0 -17
  35. package/dist/dependencies/testSetupFiles.d.ts +0 -13
  36. package/dist/dependencies/utils.d.ts +0 -15
  37. package/dist/docs/config.d.ts +0 -9
  38. package/dist/docs/index.d.ts +0 -10
  39. package/dist/docs/stencilDocsJson.d.ts +0 -130
  40. package/dist/docs/types.d.ts +0 -1
  41. package/dist/docs/vsCodeCustomData/index.d.ts +0 -16
  42. package/dist/docs/vsCodeCustomData/utils.d.ts +0 -3
  43. package/dist/docs/webTypes/description.d.ts +0 -2
  44. package/dist/docs/webTypes/index.d.ts +0 -19
  45. package/dist/docs/webTypes/utils.d.ts +0 -6
  46. package/dist/entrypoints/addNonLazyImports.d.ts +0 -13
  47. package/dist/entrypoints/config.d.ts +0 -17
  48. package/dist/entrypoints/dtsUtils.d.ts +0 -19
  49. package/dist/entrypoints/findUtils.d.ts +0 -6
  50. package/dist/entrypoints/handleComponentImports.d.ts +0 -13
  51. package/dist/entrypoints/resolveTagName.d.ts +0 -18
  52. package/dist/jsxToLitHtml/autoAddNothing.d.ts +0 -8
  53. package/dist/jsxToLitHtml/comments.d.ts +0 -19
  54. package/dist/jsxToLitHtml/convertProps.d.ts +0 -10
  55. package/dist/jsxToLitHtml/imports.d.ts +0 -27
  56. package/dist/jsxToLitHtml/importsConfig.d.ts +0 -17
  57. package/dist/jsxToLitHtml/index.d.ts +0 -20
  58. package/dist/jsxToLitHtml/inferPropType.d.ts +0 -40
  59. package/dist/jsxToLitHtml/insertRepeatCall.d.ts +0 -51
  60. package/dist/jsxToLitHtml/jsxVisitor.d.ts +0 -15
  61. package/dist/jsxToLitHtml/templateParts.d.ts +0 -17
  62. package/dist/jsxToLitHtml/throwOnImportingExternalized.d.ts +0 -10
  63. package/dist/jsxToLitHtml/types.d.ts +0 -74
  64. package/dist/jsxToLitHtml/utils.d.ts +0 -14
  65. package/dist/loader/css.d.ts +0 -20
  66. package/dist/loader/extractor.d.ts +0 -2
  67. package/dist/loader/index.d.ts +0 -21
  68. package/dist/loader/lazy.d.ts +0 -21
  69. package/dist/loader/storybookApiJson.d.ts +0 -6
  70. package/dist/plugins/buildCdn.d.ts +0 -73
  71. package/dist/plugins/buildWebApp.d.ts +0 -3
  72. package/dist/plugins/buildWrappers.d.ts +0 -4
  73. package/dist/plugins/configureVite.d.ts +0 -20
  74. package/dist/plugins/externalizeDependencies.d.ts +0 -30
  75. package/dist/plugins/handleDynamicAssets.d.ts +0 -8
  76. package/dist/plugins/handleStaticAssets.d.ts +0 -9
  77. package/dist/plugins/loadLitCss.d.ts +0 -127
  78. package/dist/plugins/printTotalBuildSize.d.ts +0 -7
  79. package/dist/plugins/provideAssets.d.ts +0 -35
  80. package/dist/plugins/setAssetsPath.d.ts +0 -10
  81. package/dist/plugins/updatePackageJson.d.ts +0 -14
  82. package/dist/publicTypes.d.ts +0 -653
  83. package/dist/puppeteerTesting/globalSetup.d.ts +0 -73
  84. package/dist/puppeteerTesting/injected.d.ts +0 -8
  85. package/dist/puppeteerTesting/puppeteer/browser.d.ts +0 -6
  86. package/dist/puppeteerTesting/vitest/matchers/attributes.d.ts +0 -4
  87. package/dist/puppeteerTesting/vitest/matchers/classList.d.ts +0 -4
  88. package/dist/puppeteerTesting/vitest/matchers/events.d.ts +0 -7
  89. package/dist/puppeteerTesting/vitest/matchers/text.d.ts +0 -2
  90. package/dist/puppeteerTesting/vitest/matchers/utils.d.ts +0 -1
  91. package/dist/puppeteerTesting/vitest/runner.d.ts +0 -19
  92. package/dist/puppeteerTesting/vitest/setupFile.d.ts +0 -1
  93. package/dist/puppeteerTesting/vitest/types.d.ts +0 -6
  94. package/dist/testing/failOnConsole.d.ts +0 -6
  95. package/dist/testing/setupFile.d.ts +0 -1
  96. package/dist/testing/snapshotSerializer.d.ts +0 -12
  97. package/dist/tests/utils.d.ts +0 -4
  98. package/dist/transformers/customElementDeclaration.d.ts +0 -2
  99. package/dist/transformers/index.d.ts +0 -20
  100. package/dist/transformers/injectRuntimeOptions.d.ts +0 -18
  101. package/dist/transformers/liftDecorators.d.ts +0 -21
  102. package/dist/transformers/members.d.ts +0 -10
  103. package/dist/transformers/property.d.ts +0 -10
  104. package/dist/transformers/propertyOptions.d.ts +0 -110
  105. package/dist/transformers/utils.d.ts +0 -9
package/LICENSE.md CHANGED
@@ -1,12 +1,14 @@
1
1
  # Licensing
2
2
 
3
- COPYRIGHT © Esri
3
+ COPYRIGHT Esri
4
4
 
5
5
  All rights reserved under the copyright laws of the United States and applicable international laws, treaties, and conventions.
6
6
 
7
- This material is licensed for use under the [Esri Master License Agreement (MLA)](https://www.esri.com/content/dam/esrisites/en-us/media/legal/ma-full/ma-full.pdf), and is bound by the terms of that agreement.
7
+ This material is licensed for use under the Esri Master License Agreement (MLA), and is bound by the terms of that agreement.
8
8
  You may redistribute and use this code without modification, provided you adhere to the terms of the MLA and include this copyright notice.
9
9
 
10
+ See use restrictions at https://www.esri.com/content/dam/esrisites/en-us/media/legal/ma-full/ma-full.pdf.
11
+
10
12
  For additional information, contact:
11
13
  Environmental Systems Research Institute, Inc.
12
14
  Attn: Contracts and Legal Services Department
package/README.md CHANGED
@@ -8,5 +8,5 @@ It is not intended to be used directly, but rather used as a dependency by other
8
8
 
9
9
  ## License
10
10
 
11
- This package is licensed under the terms described in the `LICENSE.md` file, located in the root of the package, and at https://js.arcgis.com/5.1/LICENSE.txt.
12
- For third party notices, see https://js.arcgis.com/5.1/third-party-notices.txt.
11
+ This package is licensed under the terms described in the `LICENSE.md` file, located in the root of the package, and at https://js.arcgis.com/5.2/LICENSE.txt.
12
+ For third party notices, see https://js.arcgis.com/5.2/third-party-notices.txt.
@@ -1,296 +1,167 @@
1
- import { ConfigEnv, Plugin, ResolvedConfig, ViteDevServer } from 'vite';
2
- import { default as ts } from 'typescript';
3
- import { ApiCustomElementDeclaration, ApiJson } from '@arcgis/api-extractor/apiJson';
4
- import { LuminaOptions, AssetSpec, AssetTransformer, ProvideAssetsOptions, LintingOptions } from '../publicTypes.ts';
5
- import { DocsType } from '../docs/types.ts';
6
- import { ContextDirectories } from './types.ts';
7
- import { makeLoaders, computeServeOnlyDependencies } from '../dependencies/loaders.ts';
8
- import { CustomElementInterdependencies } from '../entrypoints/config.ts';
9
- import { getLocalDefinedComponentsFromApiJson } from '../entrypoints/resolveTagName.ts';
10
- import { unsafeGetUndocumentedPrinter } from '@arcgis/api-extractor/utils/internalTypeScriptApis';
11
- import { ApiExtractor } from '@arcgis/api-extractor/extractor/ApiExtractor';
12
- import { ApiExtractorPluginConfig } from '@arcgis/api-extractor/vite/plugin';
13
- /**
14
- * A compiler state and context object that is shared across plugins.
15
- */
16
- export declare class CompilerContext {
17
- /**
18
- * TypeScript source file instances created in serve mode
19
- *
20
- * @private
21
- */
22
- private readonly _typeScriptSourceFiles;
23
- /**
24
- * A promise for after tsconfig.json and api-extractor.config.ts are loaded
25
- * and list of files in current project are resolved.
26
- *
27
- * @private
28
- */
29
- configsPromise: Promise<void>;
30
- /**
31
- * Whether minification is enabled for transformed JSX (lit-html templates)
32
- * and generated component code.
33
- */
34
- shouldMinify: boolean;
35
- /**
36
- * Like this.shouldMinify, but true when in test mode. Reasons:
37
- * - If accessing .textContent, the whitespace amount differs between minified
38
- * and non-minified lit-html templates. In Stencil's JSX this was not the
39
- * case. To ease migration of tests, we minify lit-html in tests too.
40
- * - From the above, you can see that minification does change semantics in
41
- * some cases. To have tests be truer to the real world, we minify in tests.
42
- *
43
- * Also, true during build as per
44
- * https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/2084
45
- */
46
- shouldMinifyJsx: boolean;
47
- /**
48
- *
49
- * A vite plugin that sets the initial context information based on Vite
50
- * environment
51
- *
52
- * @private
53
- */
54
- readonly _plugin: Plugin;
55
- /**
56
- * List of directories of common interest to the compiler
57
- */
58
- dir: ContextDirectories;
59
- apiExtractor: ApiExtractor | undefined;
60
- /**
61
- * @private
62
- */
63
- apiExtractorPluginConfig: ApiExtractorPluginConfig;
64
- /**
65
- * The api.json stores information about the structure of all components in
66
- * the package (their properties, methods, events, JSDoc and etc).
67
- *
68
- * You can augment the api.json generation using the `apiJson` option in
69
- * `useLumina()`
70
- */
71
- apiJson: ApiJson;
72
- /**
73
- * A flattened api.json listing all components in this package.
74
- */
75
- apiJsonComponents: ApiCustomElementDeclaration[];
76
- /**
77
- * Like this.apiJson, but also contains members decorated with the `@private`
78
- * JSDoc tag.
79
- */
80
- privateApiJson: ApiJson;
81
- /**
82
- * Resolves once api.json is first generated during a given build run.
83
- * @private
84
- */
85
- apiJsonDeferred: PromiseWithResolvers<void> | undefined;
86
- /**
87
- * In some test environments, api.json will never be produced.
88
- */
89
- apiJsonEnabled: boolean;
90
- /**
91
- * Cached result of getLocalDefinedComponentsFromApiJson() call
92
- *
93
- * @private
94
- */
95
- _localDefinedComponents?: ReturnType<typeof getLocalDefinedComponentsFromApiJson>;
96
- /**
97
- * The environment that Vite is running in
98
- *
99
- * By default, `npx vite` will run in `development` mode. and `npx vite build`
100
- * will run in `production` mode. However, you can do a development-mode build
101
- * using `npx vite build --mode development`
102
- *
103
- * - By default, source maps are generated only in development builds.
104
- * - Minification happens in production builds.
105
- */
106
- environment: "development" | "production";
107
- /**
108
- * It is a best practice to keep local build behavior as similar as possible
109
- * to CI build. Thus, only use this option if some behavior really
110
- * needs to be different in the CI.
111
- *
112
- * For example, `@arcgis/lumina-compiler` will by default automatically update
113
- * your package's package.json if it is missing some properties. However, this
114
- * behavior is disabled on the CI machine.
115
- *
116
- * @default Boolean(process.env.CI)
117
- */
118
- readonly isInCi: boolean;
119
- /**
120
- * It is a best practice to keep production behavior as similar as possible
121
- * to test environment. Thus, only use this option if some behavior really
122
- * needs to be different in test environment.
123
- *
124
- * For example, `@arcgis/lumina-compiler` will by default automatically update
125
- * your package's package.json if it is missing some properties. However, this
126
- * behavior is disabled in test environment.
127
- *
128
- * Test environment is detected in the following cases:
129
- * - Running in test mode (`npx vite build --mode test`). In such case
130
- * CompilerContext.environment will still be set to `development`
131
- * - Running in vitest - a test runner for Vite (`npx vitest`)
132
- * - Running vitest performance benchmark (`npx vitest benchmark`)
133
- */
134
- isInTest: boolean;
135
- /**
136
- * If running inside of Vitest as part of Puppeteer test integration
137
- */
138
- isInPuppeteerTestBackEnd: boolean;
139
- /**
140
- * If running in a Vite instance created by Vitest Puppeteer integration.
141
- */
142
- isInPuppeteerTestFrontEnd: boolean;
143
- isInBuildWatch: boolean;
144
- /**
145
- * Whether Vite build/serve is running inside of Storybook.
146
- */
147
- isInStorybook: boolean;
148
- /**
149
- * Whether HMR is enabled during the current Vite run
150
- */
151
- hmrEnabled: boolean;
152
- /**
153
- * Vite can be run in two modes:
154
- * - Serve the project (with watching for changes and hot module reloading).
155
- * This is the case when you run Vite as `npx vite`
156
- * - Build the project (with bundling and optimizations).
157
- * This is the case when you run Vite as `npx vite build`
158
- *
159
- * `@arcgis/lumina-compiler` does not know what environment Vite is running
160
- * in until the `apply()` Vite plugin hook is called by Vite. That means, you
161
- * should not try to read this property before the `apply()` hook is called.
162
- */
163
- viteCommand: ConfigEnv["command"];
164
- /**
165
- * Whether to extract full API information, with type-checking. This is the
166
- * case during build or when running under Storybook. Otherwise, the dev
167
- * server keeps API extraction to bare minimum to reduce needless overhead.
168
- * Only the information necessary for the dev server to lazy load is
169
- * extracted.
170
- */
171
- isFullApiExtraction: boolean;
172
- readonly banner: string;
173
- /**
174
- * Options passed to `useLumina()`
175
- */
176
- readonly options: LuminaOptions;
177
- /**
178
- * Resolved file names for documentation files
179
- *
180
- * @private
181
- */
182
- readonly _documentationFileNames: Record<DocsType, string | undefined>;
183
- /**
184
- * Resolved Vite configuration
185
- */
186
- viteConfig: ResolvedConfig;
187
- /**
188
- * Vite's dev server. Set only if Vite is running in serve mode
189
- */
190
- server: ViteDevServer;
191
- /**
192
- * Whether configServer() hook has already been called
193
- *
194
- * @private
195
- */
196
- _serverConfigured: boolean;
197
- /**
198
- * Assets pending to be served
199
- *
200
- * @private
201
- */
202
- assetsToProvide: ProvideAssetsOptions[] | undefined;
203
- /**
204
- * A promise that resolves to list of file names that declare one or more
205
- * components. This promise only represents the initial scan and is not updated
206
- * in watch or serve mode.
207
- */
208
- componentFilesPromise: Promise<string[]>;
209
- /**
210
- * Style for hiding custom elements before they are loaded. This is appended
211
- * to the global stylesheet.
212
- *
213
- * @private
214
- */
215
- _globalHydratedCssString: string;
216
- /**
217
- * Contents of the bundled global CSS file. The string is JSON-encoded so that
218
- * it can be injected into a JavaScript file as a string literal.
219
- *
220
- * @private
221
- */
222
- _globalCssString?: string;
223
- /**
224
- * Cached result of makeLoaders() call
225
- *
226
- * @private
227
- */
228
- _loadersCache?: ReturnType<typeof makeLoaders>;
229
- /**
230
- * Cached result of computeServeOnlyDependencies() call
231
- *
232
- * @private
233
- */
234
- _serveOnlyDependencies?: ReturnType<typeof computeServeOnlyDependencies>;
235
- /**
236
- * Data structure that stores references between class components and between
237
- * functional components.
238
- * This is used in build mode only.
239
- *
240
- * @private
241
- */
242
- _customElementDependencies: CustomElementInterdependencies;
243
- /**
244
- * Cached result of getPrinter() call. Cached to not needlessly create and
245
- * throw away a printer instance for each transformed file.
246
- *
247
- * @private
248
- */
249
- _typeScriptPrinter: ReturnType<typeof unsafeGetUndocumentedPrinter>;
250
- private _silencedRules;
251
- /**
252
- * Promise that resolves once src/lumina.ts is updated
253
- * @private
254
- */
255
- _updateLuminaTsPromise?: Promise<void>;
256
- /** @private */
257
- _originalRollupInputOptions?: Record<string, string> | undefined;
258
- constructor(options: LuminaOptions);
259
- private _inferBuildSetup;
260
- /**
261
- * Get TypeScript ts.SourceFile based on file name and code. Reuses existing
262
- * source file instance if already created one for that file, and code has not
263
- * changed.
264
- */
265
- getSourceFile(fileName: string, code: string): ts.SourceFile;
266
- /**
267
- * A utility for making Vite copy assets to the output folder during build or
268
- * making Vite serve them when running in serve mode
269
- *
270
- * @example
271
- * ```ts
272
- * // vite.config.ts
273
- * import { defineConfig } from "vite";
274
- * import { useLumina } from "@arcgis/lumina-compiler";
275
- *
276
- * export default defineConfig((env) => {
277
- * const lumina = useLumina();
278
- *
279
- * lumina.context.provideAssets([
280
- * {
281
- * type: "dynamic",
282
- * source: () => new Date().toString(),
283
- * destination: "build_date.txt",
284
- * },
285
- * ]);
286
- *
287
- * return {
288
- * plugins: [lumina],
289
- * };
290
- * });
291
- * ```
292
- */
293
- provideAssets(assets: AssetSpec[], transformers?: AssetTransformer[], apply?: CompilerContext["viteCommand"]): void;
294
- logLintWarning(error: string): void;
295
- logLintError(rule: keyof LintingOptions["silence"], absoluteFilePath: string, error: string): void;
296
- }
1
+ import type { ConfigEnv } from "vite";
2
+ import type { ApiCustomElementDeclaration, ApiJson } from "@arcgis/api-extractor/apiJson";
3
+ import type { LuminaOptions, AssetSpec, AssetTransformer } from "../options.js";
4
+ import type { ContextDirectories } from "./types.js";
5
+ import type { ApiExtractor } from "@arcgis/api-extractor/extractor/ApiExtractor";
6
+
7
+ /** A compiler state and context object that is shared across plugins. */
8
+ export abstract class CompilerContext {
9
+ /**
10
+ * Core paths selected while exposing ESM modules from Vite's development server.
11
+ *
12
+ * @internal
13
+ */
14
+ _localCdnCore?: {
15
+ readonly packageLocation: string;
16
+ readonly sourceLocation?: string;
17
+ };
18
+ apiExtractor?: ApiExtractor;
19
+ /**
20
+ * The api.json stores information about the structure of all components in
21
+ * the package (their properties, methods, events, JSDoc and etc).
22
+ *
23
+ * You can augment the api.json generation using the `apiJson` option in
24
+ * `useLumina()`
25
+ */
26
+ apiJson: ApiJson;
27
+ /** A flattened api.json listing all components in this package. */
28
+ apiJsonComponents: ApiCustomElementDeclaration[];
29
+ /** In some test environments, api.json will never be produced. */
30
+ apiJsonEnabled: boolean;
31
+ /** List of directories of common interest to the compiler */
32
+ dir: ContextDirectories;
33
+ /**
34
+ * The environment that Vite is running in
35
+ *
36
+ * By default, `npx vite` will run in `development` mode. and `npx vite build`
37
+ * will run in `production` mode. However, you can do a development-mode build
38
+ * using `npx vite build --mode development`
39
+ *
40
+ * - By default, source maps are generated only in development builds.
41
+ * - Minification happens in production builds.
42
+ */
43
+ environment: "development" | "production";
44
+ /** Whether HMR is enabled during the current Vite run */
45
+ hmrEnabled: boolean;
46
+ /**
47
+ * Whether to extract full API information, with type-checking. This is the
48
+ * case during build or when running under Storybook. Otherwise, the dev
49
+ * server keeps API extraction to bare minimum to reduce needless overhead.
50
+ * Only the information necessary for the dev server to lazy load is
51
+ * extracted.
52
+ */
53
+ isFullApiExtraction: boolean;
54
+ /** True in `vite build --watch` mode. */
55
+ isInBuildWatch: boolean;
56
+ /**
57
+ * It is a best practice to keep local build behavior as similar as possible
58
+ * to CI build. Thus, only use this option if some behavior really
59
+ * needs to be different in the CI.
60
+ *
61
+ * For example, `@arcgis/lumina-compiler` will by default automatically update
62
+ * your package's package.json if it is missing some properties. However, this
63
+ * behavior is disabled on the CI machine.
64
+ *
65
+ * @default Boolean(process.env.CI)
66
+ */
67
+ readonly isInCi: boolean;
68
+ /**
69
+ * If running inside of Vitest as part of Puppeteer test integration
70
+ *
71
+ * @deprecated
72
+ * For new projects, use Vitest browser mode instead of Puppeteer.
73
+ * See documentation: https://webgis.esri.com/references/lumina/testing
74
+ */
75
+ isInPuppeteerTestBackEnd: boolean;
76
+ /** If running in a Vite instance created by Vitest Puppeteer integration. */
77
+ isInPuppeteerTestFrontEnd: boolean;
78
+ /** Whether Vite build/serve is running inside of Storybook. */
79
+ isInStorybook: boolean;
80
+ /**
81
+ * It is a best practice to keep production behavior as similar as possible
82
+ * to test environment. Thus, only use this option if some behavior really
83
+ * needs to be different in test environment.
84
+ *
85
+ * For example, `@arcgis/lumina-compiler` will by default automatically update
86
+ * your package's package.json if it is missing some properties. However, this
87
+ * behavior is disabled in test environment.
88
+ *
89
+ * Test environment is detected in the following cases:
90
+ * - Running in test mode (`npx vite build --mode test`). In such case
91
+ * CompilerContext.environment will still be set to `development`
92
+ * - Running in vitest - a test runner for Vite (`npx vitest`)
93
+ * - Running vitest performance benchmark (`npx vitest benchmark`)
94
+ */
95
+ isInTest: boolean;
96
+ /** Options passed to `useLumina()` */
97
+ readonly options: LuminaOptions;
98
+ /**
99
+ * Like this.apiJson, but also contains members decorated with the `@private`
100
+ * JSDoc tag.
101
+ */
102
+ privateApiJson: ApiJson;
103
+ /**
104
+ * Whether minification is enabled for transformed JSX (lit-html templates)
105
+ * and generated component code.
106
+ *
107
+ * @internal
108
+ */
109
+ shouldMinify: boolean;
110
+ /**
111
+ * Like this.shouldMinify, but true when in test mode. Reasons:
112
+ * - If accessing .textContent, the whitespace amount differs between minified
113
+ * and non-minified lit-html templates. In Stencil's JSX this was not the
114
+ * case. To ease migration of tests, we minify lit-html in tests too.
115
+ * - From the above, you can see that minification does change semantics in
116
+ * some cases. To have tests be truer to the real world, we minify in tests.
117
+ *
118
+ * Also, true during build as per
119
+ * https://devtopia.esri.com/WebGIS/webgis-sdk/issues/2084
120
+ *
121
+ * @internal
122
+ */
123
+ shouldMinifyJsx: boolean;
124
+ /**
125
+ * Vite can be run in two modes:
126
+ * - Serve the project (with watching for changes and hot module reloading).
127
+ * This is the case when you run Vite as `npx vite`
128
+ * - Build the project (with bundling and optimizations).
129
+ * This is the case when you run Vite as `npx vite build`
130
+ *
131
+ * `@arcgis/lumina-compiler` does not know what environment Vite is running
132
+ * in until the `apply()` Vite plugin hook is called by Vite. That means, you
133
+ * should not try to read this property before the `apply()` hook is called.
134
+ */
135
+ viteCommand: ConfigEnv["command"];
136
+ /**
137
+ * A utility for making Vite copy assets to the output folder during build or
138
+ * making Vite serve them when running in serve mode
139
+ *
140
+ * @param assets
141
+ * @param transformers
142
+ * @param apply
143
+ * @example
144
+ * ```ts
145
+ * // vite.config.ts
146
+ * import { defineConfig } from "vite";
147
+ * import { useLumina } from "@arcgis/lumina-compiler";
148
+ *
149
+ * export default defineConfig((env) => {
150
+ * const lumina = useLumina();
151
+ *
152
+ * lumina.context.provideAssets([
153
+ * {
154
+ * type: "dynamic",
155
+ * source: () => new Date().toString(),
156
+ * destination: "build_date.txt",
157
+ * },
158
+ * ]);
159
+ *
160
+ * return {
161
+ * plugins: [lumina],
162
+ * };
163
+ * });
164
+ * ```
165
+ */
166
+ provideAssets(assets: AssetSpec[], transformers?: AssetTransformer[], apply?: CompilerContext["viteCommand"]): void;
167
+ }
@@ -1,34 +1,18 @@
1
- export type ContextDirectories = {
2
- /**
3
- * The project root directory. Usually equals to process.cwd() + '/'
4
- */
5
- root: string;
6
- /**
7
- * The source directory. Usually equals dir.root + `src/`
8
- */
9
- src: string;
10
- /**
11
- * The components directory. Usually equals dir.src + `components/`
12
- */
13
- srcComponents: string;
14
- /**
15
- * The root-relative path to the dist directory. Usually 'dist/'
16
- */
17
- relativeDist: string;
18
- /**
19
- * The output directory. Usually equals dir.root + `dist/`
20
- */
21
- dist: string;
22
- /**
23
- * The CDN output directory. Usually equals dir.output + `cdn/`
24
- */
25
- distCdn: string;
26
- /**
27
- * The components output directory. Usually equals dir.output + `components/`
28
- */
29
- distComponents: string;
30
- /**
31
- * The assets output directory. Usually equals dir.output + `cdn/assets/`
32
- */
33
- distCdnAssets: string;
34
- };
1
+ export interface ContextDirectories {
2
+ /** The project root directory. Usually equals to process.cwd() + '/' */
3
+ root: string;
4
+ /** The source directory. Usually equals dir.root + `src/` */
5
+ src: string;
6
+ /** The components directory. Usually equals dir.src + `components/` */
7
+ srcComponents: string;
8
+ /** The root-relative path to the dist directory. Usually 'dist/' */
9
+ relativeDist: string;
10
+ /** The output directory. Usually equals dir.root + `dist/` */
11
+ dist: string;
12
+ /** The CDN output directory. Usually equals dir.output + `cdn/` */
13
+ distCdn: string;
14
+ /** The components output directory. Usually equals dir.output + `components/` */
15
+ distComponents: string;
16
+ /** The assets output directory. Usually equals dir.output + `cdn/assets/` */
17
+ distCdnAssets: string;
18
+ }
@@ -2,14 +2,14 @@
2
2
  * Generates a URL like this from the provided package json:
3
3
  * `https://js.arcgis.com/<simplified-package-name>/<released-verion>/`
4
4
  *
5
- * @example
6
- * `https://js.arcgis.com/map-components/4.30/`
7
- *
8
- * @remarks
9
5
  * If package version number includes "next", `jsdev.arcgis.com` CDN is used
10
6
  * instead of `js.arcgis.com`.
7
+ *
8
+ * @param packageJson
9
+ * @param preferNext
10
+ * @example `https://js.arcgis.com/map-components/4.30/`
11
11
  */
12
- export declare function inferCdnUrl(packageJson?: {
12
+ export function inferCdnUrl(packageJson?: {
13
13
  name: string;
14
14
  version: string;
15
- }, preferNext?: boolean): string;
15
+ }, preferNext?: boolean): string;