@arcgis/lumina-compiler 4.34.0-next.5 → 4.34.0-next.50
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/context/index.d.ts +2 -1
- package/dist/dependencies/updateLumina.d.ts +3 -3
- package/dist/entrypoints/resolveTagName.d.ts +1 -1
- package/dist/index.js +1320 -1422
- package/dist/jsxToLitHtml/importsConfig.d.ts +10 -0
- package/dist/plugins/loadLitCss.d.ts +1 -0
- package/dist/publicTypes.d.ts +15 -57
- package/dist/puppeteerTesting/vitest/matchers/index.d.ts +12 -12
- package/dist/testing/vitestTypes.d.ts +8 -0
- package/dist/transformers/injectRuntimeOptions.d.ts +2 -2
- package/dist/transformers/internalTypeScriptApis.d.ts +4 -1
- package/package.json +20 -17
- package/dist/jsxToLitHtml/escapeForTemplateLiteral.d.ts +0 -45
- package/dist/plugins/buildStencilHydrate.d.ts +0 -16
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JsxImportName } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Most Lit API's are re-exported from multiple packages. Because only Lit
|
|
4
|
+
* package is declared as an explicit dependency, Lumina's auto-inserted imports
|
|
5
|
+
* should only import from the Lit package (from the first import path in the
|
|
6
|
+
* lists below). However, to avoid double-importing things if the file already
|
|
7
|
+
* imports these APIs from another package, we need to check for all the places
|
|
8
|
+
* that export these APIs (the 2nd+ items in the lists below).
|
|
9
|
+
*/
|
|
10
|
+
export declare const dynamicallyInsertedImportsByName: Record<JsxImportName, string[]>;
|
|
@@ -84,3 +84,4 @@ export declare const globalCssFlag = "?global";
|
|
|
84
84
|
* will be inlined as base64 to simplify our life.
|
|
85
85
|
*/
|
|
86
86
|
export declare const loadLitCss: (context: CompilerContext) => Plugin;
|
|
87
|
+
export declare function viteCssModuleToLit(code: string, withHmr: boolean, minify: boolean, isLayered: boolean): string;
|
package/dist/publicTypes.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ import { Plugin } from 'vite';
|
|
|
3
3
|
import { build as esbuildBuild } from 'esbuild';
|
|
4
4
|
import { CompilerContext } from './context';
|
|
5
5
|
import { PluginOptions as VitePluginDtsOptions } from 'vite-plugin-dts';
|
|
6
|
-
import { ExternalsOptions as RollupPluginNodeExternalsOptions } from 'rollup-plugin-node-externals';
|
|
7
6
|
import { WebTypesOptions } from './docs/webTypes/types';
|
|
8
7
|
import { VsCodeDocOptions } from './docs/vsCodeCustomData/types';
|
|
8
|
+
import { DependencyManagementOptions as BaseDependencyManagementOptions } from '@arcgis/components-build-utils';
|
|
9
9
|
import { ApiJson, ApiModule, CopyDocDefinitions } from '@arcgis/api-extractor';
|
|
10
10
|
import { LuminaApiExtractor } from './extractor/extractor';
|
|
11
11
|
/**
|
|
@@ -113,7 +113,6 @@ export type BuildOptions = {
|
|
|
113
113
|
* Wrappers to generate.
|
|
114
114
|
*/
|
|
115
115
|
readonly wrappers?: WrappersOptions[];
|
|
116
|
-
readonly ssr?: SsrOptions;
|
|
117
116
|
};
|
|
118
117
|
export type BuildCdnOptions = {
|
|
119
118
|
/**
|
|
@@ -168,32 +167,6 @@ export type CdnChunk = {
|
|
|
168
167
|
* https://devtopia.esri.com/WebGIS/arcgis-web-components/discussions/1281
|
|
169
168
|
*/
|
|
170
169
|
export type WrappersOptions = React18WrapperOptions;
|
|
171
|
-
export type SsrOptions = {
|
|
172
|
-
/**
|
|
173
|
-
* Emit output compatible with Stencil's dist-hydrate-script build.
|
|
174
|
-
*
|
|
175
|
-
* @deprecated
|
|
176
|
-
* This option should be used to smooth the migration path from Stencil.
|
|
177
|
-
* You should instruct your SSR users to migrate to Lit's SSR implementation,
|
|
178
|
-
* and then stop using this option.
|
|
179
|
-
*
|
|
180
|
-
* @see https://stenciljs.com/docs/hydrate-app
|
|
181
|
-
* @see https://lit.dev/docs/ssr/overview/
|
|
182
|
-
*/
|
|
183
|
-
readonly stencilCompatibility?: {
|
|
184
|
-
/**
|
|
185
|
-
* @default false
|
|
186
|
-
*/
|
|
187
|
-
enabled?: boolean;
|
|
188
|
-
/**
|
|
189
|
-
* By default, the hydrate directory is output to package root, outside
|
|
190
|
-
* of dist.
|
|
191
|
-
*
|
|
192
|
-
* @default "hydrate"
|
|
193
|
-
*/
|
|
194
|
-
path?: string;
|
|
195
|
-
};
|
|
196
|
-
};
|
|
197
170
|
/**
|
|
198
171
|
* Options for creating React 18 wrapper.
|
|
199
172
|
*
|
|
@@ -211,46 +184,31 @@ export type React18WrapperOptions = {
|
|
|
211
184
|
/**
|
|
212
185
|
* Options for externalizing dependencies.
|
|
213
186
|
*
|
|
214
|
-
* Reuse the options from rollup-plugin-node-externals, but rename two options for clarity.
|
|
215
|
-
* - `include` is renamed to `externalize` to make it clear that these are externalized
|
|
216
|
-
* - `exclude` is renamed to `bundleIn` to make it clear that these are bundled in
|
|
217
|
-
*
|
|
218
|
-
* @see https://www.npmjs.com/package/rollup-plugin-node-externals
|
|
219
|
-
*
|
|
220
187
|
* @remarks
|
|
221
188
|
* If Vite is running under Storybook, these options are ignored. This is
|
|
222
189
|
* because in Storybook build, unlike in a library build, we want to bundle in
|
|
223
190
|
* all dependencies (with exception of @arcgis/core and web component
|
|
224
191
|
* dependencies, which are loaded using the ESM CDN).
|
|
225
192
|
*/
|
|
226
|
-
export type DependencyManagementOptions =
|
|
193
|
+
export type DependencyManagementOptions = BaseDependencyManagementOptions & {
|
|
227
194
|
/**
|
|
228
|
-
*
|
|
229
|
-
*
|
|
195
|
+
* By default, Lumina will error if it encounters usage of an unknown custom
|
|
196
|
+
* element. This setting allows to silence such error if you are manually
|
|
197
|
+
* importing some custom elements.
|
|
230
198
|
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
* such
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
* - If TypeScript types from the bundled in dependencies are referenced in
|
|
238
|
-
* the `.d.ts` files of your library, you will need to declare the package
|
|
239
|
-
* as a `dependency`, so that it is still installed on the consumer's
|
|
240
|
-
* computer so that TypeScript can correctly resolve the types of that
|
|
241
|
-
* library.
|
|
242
|
-
*/
|
|
243
|
-
readonly bundleIn?: NonNullable<RollupPluginNodeExternalsOptions>["exclude"];
|
|
244
|
-
/**
|
|
245
|
-
* Force externalize these dependencies, even if they are declared as
|
|
246
|
-
* devDependencies.
|
|
199
|
+
* > [!IMPORTANT]
|
|
200
|
+
* >
|
|
201
|
+
* > This option is an escape hatch. Build-time optimizations are not applied
|
|
202
|
+
* > to such custom elements. Additionally, you assume the responsibility for
|
|
203
|
+
* > correctly loading the web component in lazy, non-lazy and CDN builds.
|
|
247
204
|
*
|
|
248
205
|
* @example
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
|
-
*
|
|
206
|
+
* ```ts
|
|
207
|
+
* // Silence errors for unknown custom elements that start with "fluent-"
|
|
208
|
+
* silenceUnknownJsxElementUsage: (tagName) => tagName.startsWith("fluent-")
|
|
209
|
+
* ```
|
|
252
210
|
*/
|
|
253
|
-
readonly
|
|
211
|
+
readonly silenceUnknownJsxElementUsage?: (tagName: string, fileName: string, context: CompilerContext) => boolean;
|
|
254
212
|
};
|
|
255
213
|
export type ServeEnvironmentOptions = {
|
|
256
214
|
/**
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export declare const expectExtend: {
|
|
2
|
-
toEqualAttribute: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
3
|
-
toEqualAttributes: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
4
|
-
toEqualText: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
5
|
-
toHaveAttribute: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
6
|
-
toHaveClass: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
2
|
+
toEqualAttribute: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState, any[]>;
|
|
3
|
+
toEqualAttributes: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState, any[]>;
|
|
4
|
+
toEqualText: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState, any[]>;
|
|
5
|
+
toHaveAttribute: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState, any[]>;
|
|
6
|
+
toHaveClass: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState, any[]>;
|
|
7
7
|
toHaveClasses: (element: unknown, expectClassNames: string[]) => import('@vitest/expect').SyncExpectationResult;
|
|
8
|
-
toMatchClasses: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
9
|
-
toHaveReceivedEvent: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
10
|
-
toHaveReceivedEventTimes: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
11
|
-
toHaveReceivedEventDetail: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
12
|
-
toHaveFirstReceivedEventDetail: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
13
|
-
toHaveLastReceivedEventDetail: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
14
|
-
toHaveNthReceivedEventDetail: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
8
|
+
toMatchClasses: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState, any[]>;
|
|
9
|
+
toHaveReceivedEvent: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState, any[]>;
|
|
10
|
+
toHaveReceivedEventTimes: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState, any[]>;
|
|
11
|
+
toHaveReceivedEventDetail: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState, any[]>;
|
|
12
|
+
toHaveFirstReceivedEventDetail: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState, any[]>;
|
|
13
|
+
toHaveLastReceivedEventDetail: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState, any[]>;
|
|
14
|
+
toHaveNthReceivedEventDetail: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState, any[]>;
|
|
15
15
|
};
|
|
16
16
|
export interface PuppeteerMatchers<R = unknown> {
|
|
17
17
|
toEqualAttribute: (expectedAttribute: string, expectedValue: unknown) => R;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type VitestBrowserModeProvider = "playwright" | "preview" | "webdriverio" | (string & {}) | undefined;
|
|
2
|
+
export type VitestPartialConfig = {
|
|
3
|
+
globalSetup?: string[] | string;
|
|
4
|
+
runner?: string;
|
|
5
|
+
include?: string[];
|
|
6
|
+
environment?: "edge-runtime" | "happy-dom" | "jsdom" | "node" | (Record<never, never> & string);
|
|
7
|
+
forceRerunTriggers?: string[];
|
|
8
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { SourceDescription } from 'rollup';
|
|
2
1
|
import { CompilerContext } from '../context';
|
|
3
|
-
|
|
2
|
+
import { TransformResult } from 'vite';
|
|
3
|
+
export declare function injectRuntimeOptions(runtimeTsCode: string, context: CompilerContext): TransformResult;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { SourceMap } from 'rollup';
|
|
2
1
|
import { default as ts } from 'typescript';
|
|
2
|
+
import { TransformResult } from 'vite';
|
|
3
|
+
type SourceMap = Extract<NonNullable<TransformResult["map"]>, {
|
|
4
|
+
file: string;
|
|
5
|
+
}>;
|
|
3
6
|
export type UndocumentedTypeScript = {
|
|
4
7
|
readonly createSourceMapGenerator?: (host: ts.CompilerHost, basename: string, sourceRoot: string, dirname: string, compilerOptions: ts.CompilerOptions) => SourceMapGenerator;
|
|
5
8
|
readonly createTextWriter?: (newLine: string) => EmitTextWriter;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/lumina-compiler",
|
|
3
|
-
"version": "4.34.0-next.
|
|
3
|
+
"version": "4.34.0-next.50",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -18,25 +18,28 @@
|
|
|
18
18
|
],
|
|
19
19
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@arcgis/api-extractor": "4.34.0-next.
|
|
22
|
-
"@arcgis/components-build-utils": "4.34.0-next.
|
|
23
|
-
"@arcgis/components-utils": "4.34.0-next.
|
|
24
|
-
"chalk": "^5.
|
|
25
|
-
"esbuild": "^0.25.
|
|
26
|
-
"glob": "^11.0.
|
|
27
|
-
"js-beautify": "^1.15.
|
|
28
|
-
"mime-types": "^
|
|
29
|
-
"rollup": "^4.40.2",
|
|
30
|
-
"rollup-plugin-node-externals": "^8.0.0",
|
|
31
|
-
"sass-embedded": "^1.79.3",
|
|
21
|
+
"@arcgis/api-extractor": "4.34.0-next.50",
|
|
22
|
+
"@arcgis/components-build-utils": "4.34.0-next.50",
|
|
23
|
+
"@arcgis/components-utils": "4.34.0-next.50",
|
|
24
|
+
"chalk": "^5.4.1",
|
|
25
|
+
"esbuild": "^0.25.5",
|
|
26
|
+
"glob": "^11.0.3",
|
|
27
|
+
"js-beautify": "^1.15.4",
|
|
28
|
+
"mime-types": "^3.0.1",
|
|
32
29
|
"tslib": "^2.8.1",
|
|
33
|
-
"
|
|
34
|
-
"vite": "^6.3.4",
|
|
35
|
-
"vite-plugin-dts": "^4.5.3",
|
|
36
|
-
"vitest": "^3.1.3",
|
|
30
|
+
"vite-plugin-dts": "^4.5.4",
|
|
37
31
|
"vitest-fail-on-console": "^0.7.1"
|
|
38
32
|
},
|
|
39
33
|
"peerDependencies": {
|
|
40
|
-
"@arcgis/lumina": "~4.34.0-next.
|
|
34
|
+
"@arcgis/lumina": "~4.34.0-next.50",
|
|
35
|
+
"lit": "^3.3.0",
|
|
36
|
+
"typescript": "~5.8.3",
|
|
37
|
+
"vite": "^7.0.0",
|
|
38
|
+
"vitest": "^3.2.4"
|
|
39
|
+
},
|
|
40
|
+
"peerDependenciesMeta": {
|
|
41
|
+
"vitest": {
|
|
42
|
+
"optional": true
|
|
43
|
+
}
|
|
41
44
|
}
|
|
42
45
|
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is a workaround for a TypeScript bug:
|
|
3
|
-
* https://github.com/microsoft/TypeScript/issues/59150
|
|
4
|
-
*
|
|
5
|
-
* Once that bug is fixed, the code can be simplified like so:
|
|
6
|
-
* - This file can be removed
|
|
7
|
-
* - For each place where `escapeBackticks` or `escapeForTemplateLiteral` was
|
|
8
|
-
* used and the result was passed as the 1st AND 2nd parameter to one of
|
|
9
|
-
* ts.factory.createNoSubstitutionTemplateLiteral,
|
|
10
|
-
* ts.factory.createTemplateHead, ts.factory.createTemplateMiddle, or
|
|
11
|
-
* ts.factory.createTemplateTail, change those places like so:
|
|
12
|
-
* - DO NOT call `escapeBackticks` or `escapeForTemplateLiteral` anymore -
|
|
13
|
-
* pass the value as is.
|
|
14
|
-
* - DO NOT provide the 2nd parameter to the factory function.
|
|
15
|
-
* - If `escapeForTemplateLiteral` was used in some other place, it can
|
|
16
|
-
* potentially be replaced with a function like this:
|
|
17
|
-
* string=>escapeTemplateSubstitution(string).replaceAll('`','\`')
|
|
18
|
-
* (where escapeTemplateSubstitution is defined in the current file - move it)
|
|
19
|
-
*
|
|
20
|
-
* More details:
|
|
21
|
-
*
|
|
22
|
-
* In template literals, even though we *really* only need to escape ${ and
|
|
23
|
-
* backticks, we are escaping non-ASCII characters too as that improves scanner
|
|
24
|
-
* performance in JavaScript engines.
|
|
25
|
-
*
|
|
26
|
-
* This is what esbuild does (https://esbuild.github.io/api/#charset), what
|
|
27
|
-
* V8 recommends (https://v8.dev/blog/scanner) and what TypeScript does.
|
|
28
|
-
*
|
|
29
|
-
* The code in this file has been copied from TypeScript's code for escaping
|
|
30
|
-
* template literals (but simplified to remove dead branches and fix eslint
|
|
31
|
-
* warnings):
|
|
32
|
-
* https://github.com/microsoft/TypeScript/blob/3163fe7e3898c1f48cd9bc097b96e3426cd2a453/src/compiler/utilities.ts#L5918-L5986
|
|
33
|
-
*
|
|
34
|
-
* TypeScript can automatically escape template literals for us, but we opt out
|
|
35
|
-
* of that as, due to a bug, they also escape new line characters which is not
|
|
36
|
-
* good as it decreases readability when debugging code.
|
|
37
|
-
*
|
|
38
|
-
* TypeScript does not expose the template literal escaping utils so we had
|
|
39
|
-
* to copy the code here, but modify to not escape new lines.
|
|
40
|
-
*
|
|
41
|
-
*/
|
|
42
|
-
declare function escapeNonAsciiString(s: string): string;
|
|
43
|
-
export declare const escapeBackticks: typeof escapeNonAsciiString;
|
|
44
|
-
export declare const escapeTemplateSubstitution: (str: string) => string;
|
|
45
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Plugin } from 'vite';
|
|
2
|
-
import { CompilerContext } from '../context';
|
|
3
|
-
/**
|
|
4
|
-
* Emit output compatible with Stencil's dist-hydrate-script build.
|
|
5
|
-
*
|
|
6
|
-
* Based on https://github.com/ionic-team/stencil/blob/main/src/compiler/output-targets/dist-hydrate-script/write-hydrate-outputs.ts
|
|
7
|
-
*
|
|
8
|
-
* @deprecated
|
|
9
|
-
* This option should be used to smooth the migration path from Stencil.
|
|
10
|
-
* You should instruct your SSR users to migrate to Lit's SSR implementation,
|
|
11
|
-
* and then stop using this option.
|
|
12
|
-
*
|
|
13
|
-
* @see https://stenciljs.com/docs/hydrate-app
|
|
14
|
-
* @see https://lit.dev/docs/ssr/overview/
|
|
15
|
-
*/
|
|
16
|
-
export declare function buildStencilHydrate(context: CompilerContext): Plugin | undefined;
|