@arcgis/lumina-compiler 5.2.0-next.2 → 5.2.0-next.21
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 +158 -296
- package/dist/context/types.d.ts +18 -34
- package/dist/defaultAssetsUrl.d.ts +6 -6
- package/dist/dependencies/discover.d.ts +43 -35
- package/dist/dependencies/updateLumina.d.ts +10 -11
- package/dist/docs/vsCodeCustomData/types.d.ts +5 -42
- package/dist/docs/webTypes/types.d.ts +5 -76
- package/dist/index.d.ts +20 -20
- package/dist/index.js +12 -8
- package/dist/jsxToLitHtml/config.d.ts +93 -121
- package/dist/options.d.ts +675 -0
- package/dist/puppeteerTesting/index.d.ts +18 -11
- package/dist/puppeteerTesting/index.js +104 -7
- package/dist/puppeteerTesting/puppeteer/element.d.ts +250 -217
- package/dist/puppeteerTesting/puppeteer/events.d.ts +15 -21
- package/dist/puppeteerTesting/puppeteer/page.d.ts +8 -5
- package/dist/puppeteerTesting/puppeteer/types.d.ts +130 -132
- package/dist/puppeteerTesting/vitest/matchers/index.d.ts +33 -30
- package/dist/testing/index.d.ts +4 -11
- package/dist/testing/mount.d.ts +113 -93
- package/dist/testing/wrapController.d.ts +5 -11
- package/dist/useLumina.d.ts +5 -2
- package/package.json +15 -7
- package/dist/context/logger.d.ts +0 -8
- package/dist/context/typeScript.d.ts +0 -6
- package/dist/context/utils.d.ts +0 -4
- package/dist/dependencies/arcgisCore.d.ts +0 -30
- package/dist/dependencies/index.d.ts +0 -12
- package/dist/dependencies/loaders.d.ts +0 -5
- package/dist/dependencies/lumina.d.ts +0 -3
- package/dist/dependencies/stencil.d.ts +0 -17
- package/dist/dependencies/testSetupFiles.d.ts +0 -13
- package/dist/dependencies/utils.d.ts +0 -15
- package/dist/docs/config.d.ts +0 -9
- package/dist/docs/index.d.ts +0 -10
- package/dist/docs/stencilDocsJson.d.ts +0 -130
- package/dist/docs/types.d.ts +0 -1
- package/dist/docs/vsCodeCustomData/index.d.ts +0 -16
- package/dist/docs/vsCodeCustomData/utils.d.ts +0 -3
- package/dist/docs/webTypes/description.d.ts +0 -2
- package/dist/docs/webTypes/index.d.ts +0 -19
- package/dist/docs/webTypes/utils.d.ts +0 -6
- package/dist/entrypoints/addNonLazyImports.d.ts +0 -13
- package/dist/entrypoints/config.d.ts +0 -17
- package/dist/entrypoints/dtsUtils.d.ts +0 -19
- package/dist/entrypoints/findUtils.d.ts +0 -6
- package/dist/entrypoints/handleComponentImports.d.ts +0 -13
- package/dist/entrypoints/resolveTagName.d.ts +0 -18
- package/dist/jsxToLitHtml/autoAddNothing.d.ts +0 -8
- package/dist/jsxToLitHtml/comments.d.ts +0 -19
- package/dist/jsxToLitHtml/convertProps.d.ts +0 -10
- package/dist/jsxToLitHtml/imports.d.ts +0 -27
- package/dist/jsxToLitHtml/importsConfig.d.ts +0 -17
- package/dist/jsxToLitHtml/index.d.ts +0 -20
- package/dist/jsxToLitHtml/inferPropType.d.ts +0 -40
- package/dist/jsxToLitHtml/insertRepeatCall.d.ts +0 -51
- package/dist/jsxToLitHtml/jsxVisitor.d.ts +0 -15
- package/dist/jsxToLitHtml/templateParts.d.ts +0 -17
- package/dist/jsxToLitHtml/throwOnImportingExternalized.d.ts +0 -10
- package/dist/jsxToLitHtml/types.d.ts +0 -74
- package/dist/jsxToLitHtml/utils.d.ts +0 -14
- package/dist/loader/css.d.ts +0 -20
- package/dist/loader/extractor.d.ts +0 -2
- package/dist/loader/index.d.ts +0 -21
- package/dist/loader/lazy.d.ts +0 -21
- package/dist/loader/storybookApiJson.d.ts +0 -6
- package/dist/plugins/buildCdn.d.ts +0 -73
- package/dist/plugins/buildWebApp.d.ts +0 -3
- package/dist/plugins/buildWrappers.d.ts +0 -4
- package/dist/plugins/configureVite.d.ts +0 -20
- package/dist/plugins/externalizeDependencies.d.ts +0 -30
- package/dist/plugins/handleDynamicAssets.d.ts +0 -8
- package/dist/plugins/handleStaticAssets.d.ts +0 -9
- package/dist/plugins/loadLitCss.d.ts +0 -127
- package/dist/plugins/printTotalBuildSize.d.ts +0 -7
- package/dist/plugins/provideAssets.d.ts +0 -35
- package/dist/plugins/setAssetsPath.d.ts +0 -10
- package/dist/plugins/updatePackageJson.d.ts +0 -14
- package/dist/publicTypes.d.ts +0 -653
- package/dist/puppeteerTesting/globalSetup.d.ts +0 -73
- package/dist/puppeteerTesting/injected.d.ts +0 -8
- package/dist/puppeteerTesting/puppeteer/browser.d.ts +0 -6
- package/dist/puppeteerTesting/vitest/matchers/attributes.d.ts +0 -4
- package/dist/puppeteerTesting/vitest/matchers/classList.d.ts +0 -4
- package/dist/puppeteerTesting/vitest/matchers/events.d.ts +0 -7
- package/dist/puppeteerTesting/vitest/matchers/text.d.ts +0 -2
- package/dist/puppeteerTesting/vitest/matchers/utils.d.ts +0 -1
- package/dist/puppeteerTesting/vitest/runner.d.ts +0 -19
- package/dist/puppeteerTesting/vitest/setupFile.d.ts +0 -1
- package/dist/puppeteerTesting/vitest/types.d.ts +0 -6
- package/dist/testing/failOnConsole.d.ts +0 -6
- package/dist/testing/setupFile.d.ts +0 -1
- package/dist/testing/snapshotSerializer.d.ts +0 -12
- package/dist/tests/utils.d.ts +0 -4
- package/dist/transformers/customElementDeclaration.d.ts +0 -2
- package/dist/transformers/index.d.ts +0 -20
- package/dist/transformers/injectRuntimeOptions.d.ts +0 -18
- package/dist/transformers/liftDecorators.d.ts +0 -21
- package/dist/transformers/members.d.ts +0 -10
- package/dist/transformers/property.d.ts +0 -10
- package/dist/transformers/propertyOptions.d.ts +0 -110
- package/dist/transformers/utils.d.ts +0 -9
package/dist/useLumina.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { LuminaPlugins, LuminaOptions } from
|
|
1
|
+
import type { LuminaPlugins, LuminaOptions } from "./options.js";
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Auto-configure Vite for a Lit web component project.
|
|
4
5
|
*
|
|
@@ -9,5 +10,7 @@ import { LuminaPlugins, LuminaOptions } from './publicTypes.ts';
|
|
|
9
10
|
* - Separate bundle for each component to bundle only the necessary code
|
|
10
11
|
* - Generates types, docs, and api.json for web components
|
|
11
12
|
* - Generates a CDN build
|
|
13
|
+
*
|
|
14
|
+
* @param options
|
|
12
15
|
*/
|
|
13
|
-
export
|
|
16
|
+
export function useLumina(options?: LuminaOptions): LuminaPlugins;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/lumina-compiler",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.21",
|
|
4
4
|
"description": "Compiler for WebGIS web components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -12,6 +12,12 @@
|
|
|
12
12
|
"./puppeteerTesting": "./dist/puppeteerTesting/index.js",
|
|
13
13
|
"./puppeteerTesting/globalSetup": "./dist/puppeteerTesting/globalSetup.js",
|
|
14
14
|
"./puppeteerTesting/runner": "./dist/puppeteerTesting/vitest/runner.js",
|
|
15
|
+
"./docs/vsCodeCustomData/types": {
|
|
16
|
+
"types": "./dist/docs/vsCodeCustomData/types.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"./docs/webTypes/types": {
|
|
19
|
+
"types": "./dist/docs/webTypes/types.d.ts"
|
|
20
|
+
},
|
|
15
21
|
"./package.json": "./package.json"
|
|
16
22
|
},
|
|
17
23
|
"files": [
|
|
@@ -19,25 +25,27 @@
|
|
|
19
25
|
],
|
|
20
26
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
21
27
|
"dependencies": {
|
|
22
|
-
"@vitest/expect": "^4.1.6",
|
|
23
|
-
"@vitest/runner": "^4.1.6",
|
|
24
28
|
"esbuild": "~0.28.0",
|
|
25
29
|
"js-beautify": "^1.15.4",
|
|
26
30
|
"mime-types": "^3.0.1",
|
|
27
31
|
"tinyglobby": "^0.2.15",
|
|
28
32
|
"tslib": "^2.8.1",
|
|
29
|
-
"@arcgis/api-extractor": "5.2.0-next.
|
|
30
|
-
"@arcgis/components-build-utils": "5.2.0-next.
|
|
31
|
-
"@arcgis/toolkit": "~5.2.0-next.
|
|
33
|
+
"@arcgis/api-extractor": "5.2.0-next.21",
|
|
34
|
+
"@arcgis/components-build-utils": "5.2.0-next.21",
|
|
35
|
+
"@arcgis/toolkit": "~5.2.0-next.21"
|
|
32
36
|
},
|
|
33
37
|
"peerDependencies": {
|
|
34
38
|
"lit": "^3.3.0",
|
|
39
|
+
"puppeteer": "^24.30.0",
|
|
35
40
|
"typescript": "~6.0.2",
|
|
36
41
|
"vite": "^7.3.2",
|
|
37
42
|
"vitest": "^4.1.6",
|
|
38
|
-
"@arcgis/lumina": "~5.2.0-next.
|
|
43
|
+
"@arcgis/lumina": "~5.2.0-next.21"
|
|
39
44
|
},
|
|
40
45
|
"peerDependenciesMeta": {
|
|
46
|
+
"puppeteer": {
|
|
47
|
+
"optional": true
|
|
48
|
+
},
|
|
41
49
|
"vitest": {
|
|
42
50
|
"optional": true
|
|
43
51
|
}
|
package/dist/context/logger.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { createLogger } from 'vite';
|
|
2
|
-
export declare const logger: {
|
|
3
|
-
initialize(logger: ReturnType<typeof createLogger>, root: string): void;
|
|
4
|
-
info(scope: string, message: string, file?: string): void;
|
|
5
|
-
warn(scope: string, message: string, file?: string): void;
|
|
6
|
-
error(scope: string, message: string, file?: string): void;
|
|
7
|
-
};
|
|
8
|
-
export declare function formatError<T extends Error | string>(scope: string, messageOrError: T, file?: string): T;
|
package/dist/context/utils.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare function inferPreamble(packageJson?: import('@arcgis/components-build-utils').PackageJson): string;
|
|
2
|
-
export declare const preambleToComment: (preamble: string) => string;
|
|
3
|
-
export declare const throwOnReadBeforeSet: (createdDuring: string) => PropertyDecorator;
|
|
4
|
-
export declare function normalizeDocumentationFileName(fileName: string): string;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { DependencyInjectionMode, DependencyInjectionResult } from './utils.ts';
|
|
2
|
-
export declare const hasCore: boolean;
|
|
3
|
-
/**
|
|
4
|
-
* Thanks to Vite's dependency pre-bundling, we do not have to use the CDN
|
|
5
|
-
* during local development, but can instead consume the pre-bundled
|
|
6
|
-
* `@arcgis/core` from the node_modules directory.
|
|
7
|
-
*
|
|
8
|
-
* This has benefits:
|
|
9
|
-
* - using the ESM CDN involves making a lot of network requests, often for
|
|
10
|
-
* small files. With pre-bundling, performance can be improved
|
|
11
|
-
* - by using `@arcgis/core` from node_modules, the dev server is guaranteed to
|
|
12
|
-
* use the version of `@arcgis/core` that the package.json specifies. Where as
|
|
13
|
-
* the CDN could be out of date, or point to `next` (which is somewhat
|
|
14
|
-
* ambiguous around release time)
|
|
15
|
-
* - by using `@arcgis/core` from node_modules, you can edit the package in
|
|
16
|
-
* node_modules to quickly preview the result of your edits. This is useful
|
|
17
|
-
* if you are debugging a bug and not yet sure if the bug is with your package
|
|
18
|
-
* or with `@arcgis/core`. More on this:
|
|
19
|
-
* https://vitejs.dev/guide/dep-pre-bundling#browser-cache
|
|
20
|
-
*
|
|
21
|
-
* In builds, all dependencies are externalized so this is not a concern.
|
|
22
|
-
*
|
|
23
|
-
* In storybook builds, we use the ESM CDN. Reasons:
|
|
24
|
-
* - dependency pre-bundling is not available in build mode, only in serve mode
|
|
25
|
-
* - bundling `@arcgis/core` makes the build output huge, creating logistical
|
|
26
|
-
* challenges around deploying many preview branches
|
|
27
|
-
* - for external users, having both storybook and docs use the ESM CDN means
|
|
28
|
-
* they benefit from caching the ESM CDN across both sites
|
|
29
|
-
*/
|
|
30
|
-
export declare function produceArcgisCoreTags(baseUrl: string, mode: DependencyInjectionMode, preferNext: boolean): Promise<DependencyInjectionResult[]>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IndexHtmlTransformContext, Plugin } from 'vite';
|
|
2
|
-
import { CompilerContext } from '../context/index.ts';
|
|
3
|
-
export declare const doLoadersApply: (context: CompilerContext, htmlContext?: IndexHtmlTransformContext) => boolean;
|
|
4
|
-
/**
|
|
5
|
-
* In serve mode, augment index.html by adding the necessary script tags for
|
|
6
|
-
* each web component dependency.
|
|
7
|
-
*
|
|
8
|
-
* In case of Storybook, we apply this plugin to iframe.html, not just in serve
|
|
9
|
-
* mode, but also in build mode.
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
export declare const provideDependencySupport: (context: CompilerContext) => Plugin;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { CompilerContext } from '../context/index.ts';
|
|
2
|
-
import { ResolvedDependencyComponents } from './discover.ts';
|
|
3
|
-
import { DependencyInjectionResult } from './utils.ts';
|
|
4
|
-
export declare function makeLoaders(context: CompilerContext): Promise<DependencyInjectionResult[]>;
|
|
5
|
-
export declare function computeServeOnlyDependencies(context: CompilerContext): Promise<readonly ResolvedDependencyComponents[]>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { DependencyInjectionMode, DependencyInjectionResult } from './utils.ts';
|
|
2
|
-
import { ResolvedDependencyComponents } from './discover.ts';
|
|
3
|
-
export declare function makeLuminaLoader(baseUrl: string, dependency: ResolvedDependencyComponents, mode: DependencyInjectionMode, index: number, preferNext: boolean): Promise<DependencyInjectionResult>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { DependencyInjectionMode, DependencyInjectionResult } from './utils.ts';
|
|
2
|
-
import { ResolvedDependencyComponents } from './discover.ts';
|
|
3
|
-
export declare function makeStencilLoader(baseUrl: string, dependency: ResolvedDependencyComponents, mode: DependencyInjectionMode, index: number, preferNext: boolean): Promise<DependencyInjectionResult[]>;
|
|
4
|
-
export declare function findCdnFiles(packageDirectory: string): Promise<{
|
|
5
|
-
readonly cdnName: string;
|
|
6
|
-
readonly hasCss: boolean;
|
|
7
|
-
} | undefined>;
|
|
8
|
-
export type StencilLazyLoadingData = LazyBundleRuntimeData[];
|
|
9
|
-
type LazyBundleRuntimeData = [string, ComponentRuntimeMetaCompact[]];
|
|
10
|
-
type ComponentRuntimeMetaCompact = [
|
|
11
|
-
number,
|
|
12
|
-
/** tagname */
|
|
13
|
-
string,
|
|
14
|
-
/** members */
|
|
15
|
-
Record<string, [number, string?]>?
|
|
16
|
-
];
|
|
17
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CompilerContext } from '../context/index.ts';
|
|
2
|
-
export declare const testSetupFileRegex: RegExp;
|
|
3
|
-
export declare const testSetupFileNames: string[];
|
|
4
|
-
/**
|
|
5
|
-
* Get the entrypoint code for lazy-loading all components and their
|
|
6
|
-
* dependencies when running a web component test in the browser.
|
|
7
|
-
*
|
|
8
|
-
* Lazy loading is critical for performance. Since each test runs in isolation,
|
|
9
|
-
* we wouldn't want to load all possible components in each test (and tracking
|
|
10
|
-
* precisely which components were used is tricky and bug prone - i.e won't
|
|
11
|
-
* catch dynamic references).
|
|
12
|
-
*/
|
|
13
|
-
export declare function buildTestSetupFile(context: CompilerContext): Promise<string>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { HtmlTagDescriptor } from 'vite';
|
|
2
|
-
export type DependencyInjectionMode = "cdn" | "lazyNpm";
|
|
3
|
-
export type DependencyInjectionResult = HtmlTagDescriptor | {
|
|
4
|
-
cssHref: string;
|
|
5
|
-
id?: string;
|
|
6
|
-
} | {
|
|
7
|
-
optimizableImports: string[];
|
|
8
|
-
javascriptCode: string[];
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* The `baseUrl` should be set to `context.viteConfig.base`
|
|
12
|
-
* Vite always normalized `base` to end with `/`, and, if in serve mode, to not
|
|
13
|
-
* include domain name
|
|
14
|
-
*/
|
|
15
|
-
export declare const toFsUrl: (baseUrl: string, absolutePath: string) => string;
|
package/dist/docs/config.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CompilerContext } from '../context/index.ts';
|
|
2
|
-
import { DocsType } from './types.ts';
|
|
3
|
-
export declare const defaultDocsFileNames: Record<DocsType, string>;
|
|
4
|
-
/**
|
|
5
|
-
* Minify docs .json files to reduce node_modules size (otherwise they account
|
|
6
|
-
* for 50% of component package size). Don't minify if Lumina is running in AWC's
|
|
7
|
-
* test package to allow for build snapshot diffs
|
|
8
|
-
*/
|
|
9
|
-
export declare const getDocsFileIndent: (context: CompilerContext) => 2 | undefined;
|
package/dist/docs/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CompilerContext } from '../context/index.ts';
|
|
2
|
-
import { Plugin } from 'vite';
|
|
3
|
-
/**
|
|
4
|
-
* Generate JSON component metadata in 4 formats
|
|
5
|
-
* - community standard
|
|
6
|
-
* - Stencil-like format
|
|
7
|
-
* - VS Code standard
|
|
8
|
-
* - JetBrains standard
|
|
9
|
-
*/
|
|
10
|
-
export declare function generateDocs(context: CompilerContext): Plugin;
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { CompilerContext } from '../context/index.ts';
|
|
2
|
-
import { ApiDocsTag } from '@arcgis/api-extractor/apiJson';
|
|
3
|
-
/**
|
|
4
|
-
* To avoid having a dependency on Stencil, we inline Stencil types rather than
|
|
5
|
-
* importing them.
|
|
6
|
-
*/
|
|
7
|
-
interface JsonDocs {
|
|
8
|
-
deprecation?: string;
|
|
9
|
-
components: JsonDocsComponent[];
|
|
10
|
-
timestamp: string;
|
|
11
|
-
compiler: {
|
|
12
|
-
name: string;
|
|
13
|
-
version: string;
|
|
14
|
-
typescriptVersion: string;
|
|
15
|
-
};
|
|
16
|
-
typeLibrary: Record<string, never>;
|
|
17
|
-
}
|
|
18
|
-
interface JsonDocsComponent {
|
|
19
|
-
filePath?: string;
|
|
20
|
-
encapsulation: "none" | "scoped" | "shadow";
|
|
21
|
-
tag: string;
|
|
22
|
-
readme: string;
|
|
23
|
-
docs: string;
|
|
24
|
-
docsTags: ApiDocsTag[];
|
|
25
|
-
overview?: string;
|
|
26
|
-
usage: Record<string, string>;
|
|
27
|
-
props: JsonDocsProp[];
|
|
28
|
-
methods: JsonDocsMethod[];
|
|
29
|
-
events: JsonDocsEvent[];
|
|
30
|
-
listeners: never[];
|
|
31
|
-
styles: {
|
|
32
|
-
name: string;
|
|
33
|
-
docs: string;
|
|
34
|
-
annotation: string;
|
|
35
|
-
mode: string | undefined;
|
|
36
|
-
}[];
|
|
37
|
-
slots: {
|
|
38
|
-
name: string;
|
|
39
|
-
docs: string;
|
|
40
|
-
}[];
|
|
41
|
-
parts: {
|
|
42
|
-
name: string;
|
|
43
|
-
docs: string;
|
|
44
|
-
}[];
|
|
45
|
-
dependents: string[];
|
|
46
|
-
dependencies: string[];
|
|
47
|
-
dependencyGraph: Record<string, never>;
|
|
48
|
-
deprecation?: string;
|
|
49
|
-
}
|
|
50
|
-
interface JsonDocsEvent {
|
|
51
|
-
event: string;
|
|
52
|
-
bubbles: boolean;
|
|
53
|
-
cancelable: boolean;
|
|
54
|
-
composed: boolean;
|
|
55
|
-
complexType: ComplexType;
|
|
56
|
-
docs: string;
|
|
57
|
-
docsTags: ApiDocsTag[];
|
|
58
|
-
deprecation?: string;
|
|
59
|
-
detail: string;
|
|
60
|
-
}
|
|
61
|
-
interface ComponentCompilerMethodComplexType {
|
|
62
|
-
signature: string;
|
|
63
|
-
parameters: {
|
|
64
|
-
name: string;
|
|
65
|
-
type: string;
|
|
66
|
-
docs: string;
|
|
67
|
-
}[];
|
|
68
|
-
references: ComponentCompilerTypeReferences;
|
|
69
|
-
return: string;
|
|
70
|
-
}
|
|
71
|
-
type ComponentCompilerTypeReferences = Record<string, {
|
|
72
|
-
location: "global" | "import" | "local";
|
|
73
|
-
path?: string;
|
|
74
|
-
id: string;
|
|
75
|
-
}>;
|
|
76
|
-
interface JsonDocsMethod {
|
|
77
|
-
name: string;
|
|
78
|
-
docs: string;
|
|
79
|
-
docsTags: ApiDocsTag[];
|
|
80
|
-
deprecation?: string;
|
|
81
|
-
signature: string;
|
|
82
|
-
returns: {
|
|
83
|
-
type: string;
|
|
84
|
-
docs: string;
|
|
85
|
-
};
|
|
86
|
-
parameters: ComponentCompilerMethodComplexType["parameters"];
|
|
87
|
-
complexType: ComponentCompilerMethodComplexType;
|
|
88
|
-
}
|
|
89
|
-
interface ComplexType {
|
|
90
|
-
original: string;
|
|
91
|
-
resolved: string;
|
|
92
|
-
references: ComponentCompilerTypeReferences;
|
|
93
|
-
}
|
|
94
|
-
interface JsonDocsProp {
|
|
95
|
-
name: string;
|
|
96
|
-
complexType?: ComplexType;
|
|
97
|
-
type: string;
|
|
98
|
-
mutable: boolean;
|
|
99
|
-
attr?: string;
|
|
100
|
-
reflectToAttr: boolean;
|
|
101
|
-
docs: string;
|
|
102
|
-
docsTags: ApiDocsTag[];
|
|
103
|
-
default?: string;
|
|
104
|
-
deprecation?: string;
|
|
105
|
-
values: {
|
|
106
|
-
value?: string;
|
|
107
|
-
type: string;
|
|
108
|
-
}[];
|
|
109
|
-
optional: boolean;
|
|
110
|
-
required: boolean;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Create a stencil-compatible docs.json file describing the library components.
|
|
114
|
-
*
|
|
115
|
-
* While custom-elements-manifest is the most popular community standard and is
|
|
116
|
-
* natively supported by Storybook and other tools, Esri has several internal
|
|
117
|
-
* tools that expect the Stencil-style docs.json.
|
|
118
|
-
* Since they are similar in content, generating a Stencil-compatible docs.json
|
|
119
|
-
* will smooth the migration path.
|
|
120
|
-
*
|
|
121
|
-
* REFACTOR: drop support for stencil compatible docs.json at some point
|
|
122
|
-
*
|
|
123
|
-
* @remarks
|
|
124
|
-
* To make it easier for people to diff the docs.json before and after migration
|
|
125
|
-
* to Lit, we make sure that the order of properties matches what Stencil
|
|
126
|
-
* generates:
|
|
127
|
-
* https://github.com/ionic-team/stencil/blob/9f5f9cdd023b8c8dfb5417a1a970605ba724ae28/src/compiler/docs/generate-doc-data.ts#L98
|
|
128
|
-
*/
|
|
129
|
-
export declare const generateStencilDocsJson: (context: CompilerContext) => JsonDocs;
|
|
130
|
-
export {};
|
package/dist/docs/types.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type DocsType = "apiJson" | "stencilLikeDocsJson" | "vsCodeCss" | "vsCodeHtml" | "webTypes";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { VsCodeHtmlDocs, VsCodeCssDocs } from './types.ts';
|
|
2
|
-
import { ApiCustomElementDeclaration } from '@arcgis/api-extractor/apiJson';
|
|
3
|
-
/**
|
|
4
|
-
* Originally based on
|
|
5
|
-
* https://github.com/break-stuff/cem-tools/tree/main/packages/vs-code-integration
|
|
6
|
-
*
|
|
7
|
-
* Moved in house mainly because of
|
|
8
|
-
* https://github.com/prettier/prettier-synchronized/issues/22
|
|
9
|
-
* That issue affects all debuggers, not just VS Code, and since the cause is
|
|
10
|
-
* in the global scope, it affects the program even if generateWebTypes wasn't
|
|
11
|
-
* called.
|
|
12
|
-
*
|
|
13
|
-
* But also there are several other quality issues with the original plugin.
|
|
14
|
-
*/
|
|
15
|
-
export declare const generateVsCodeHtmlCustomData: (components: ApiCustomElementDeclaration[]) => VsCodeHtmlDocs;
|
|
16
|
-
export declare const generateVsCodeCssCustomData: (components: ApiCustomElementDeclaration[]) => VsCodeCssDocs;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { WebTypesOptions, WebTypes } from './types.ts';
|
|
2
|
-
import { ApiCustomElementDeclaration } from '@arcgis/api-extractor/apiJson';
|
|
3
|
-
/**
|
|
4
|
-
* Originally based on
|
|
5
|
-
* https://github.com/break-stuff/cem-tools/tree/main/packages/jet-brains-integration
|
|
6
|
-
*
|
|
7
|
-
* Moved in house mainly because of
|
|
8
|
-
* https://github.com/prettier/prettier-synchronized/issues/22
|
|
9
|
-
* That issue affects all debuggers, not just VS Code, and since the cause is
|
|
10
|
-
* in the global scope, it affects the program even if generateWebTypes wasn't
|
|
11
|
-
* called.
|
|
12
|
-
*
|
|
13
|
-
* But also there are several other quality issues with the original plugin,
|
|
14
|
-
* including:
|
|
15
|
-
* - https://github.com/break-stuff/cem-tools/issues/151
|
|
16
|
-
* - https://github.com/break-stuff/cem-tools/issues/141
|
|
17
|
-
* - https://github.com/break-stuff/cem-tools/issues/112
|
|
18
|
-
*/
|
|
19
|
-
export declare function generateWebTypes(components: ApiCustomElementDeclaration[], options: WebTypesOptions): WebTypes;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ApiCustomElementDeclaration } from '@arcgis/api-extractor/apiJson';
|
|
2
|
-
import { WebTypesAttribute, WebTypesCssProperty, WebTypesPseudoElement } from './types.ts';
|
|
3
|
-
export declare const getCssPropertyList: (components: ApiCustomElementDeclaration[]) => WebTypesCssProperty[];
|
|
4
|
-
export declare const getCssPartList: (components: ApiCustomElementDeclaration[]) => WebTypesPseudoElement[];
|
|
5
|
-
export declare function getComponentAttributes(component: ApiCustomElementDeclaration): WebTypesAttribute[];
|
|
6
|
-
export declare const formatDescription: (description?: string, deprecated?: boolean | string) => string;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Plugin } from 'vite';
|
|
2
|
-
import { CompilerContext } from '../context/index.ts';
|
|
3
|
-
/**
|
|
4
|
-
* When component is imported in a non-lazy-loading way, we need to make sure
|
|
5
|
-
* the component file has explicit import statements for all web component it
|
|
6
|
-
* depends on - this ensures dependencies get bundled correctly.
|
|
7
|
-
*
|
|
8
|
-
* However, in lazy-loading mode, we don't need to do this because all dependent
|
|
9
|
-
* components are assumed to be lazy-loadable too.
|
|
10
|
-
*
|
|
11
|
-
* This plugin creates an index.js for each component for non-lazy-loading mode.
|
|
12
|
-
*/
|
|
13
|
-
export declare const addNonLazyImports: (context: CompilerContext) => Plugin;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare const customElementEntrypointName = "customElement.js";
|
|
2
|
-
export type CustomElementInterdependencies = Record<string, {
|
|
3
|
-
/**
|
|
4
|
-
* All local or foreign custom elements referenced in current file.
|
|
5
|
-
*
|
|
6
|
-
* If this is a component entrypoint file, these imports will be added to
|
|
7
|
-
* the component-name/index.js file so that non-lazy esm usages would
|
|
8
|
-
* include this import.
|
|
9
|
-
* If this is not an entrypoint file (i.e a util functional component), then
|
|
10
|
-
* the referencedBy array will be used to find the entrypoint files that
|
|
11
|
-
* referenced this file (directly or indirectly), and any import specifiers
|
|
12
|
-
* will be added to those components instead of this file.
|
|
13
|
-
*/
|
|
14
|
-
referencedTagNames: string[];
|
|
15
|
-
referencedDeferredTagNames: string[];
|
|
16
|
-
readonly referencedBy: string[];
|
|
17
|
-
}>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { path } from '@arcgis/components-build-utils';
|
|
2
|
-
import { CompilerContext } from '../context/index.ts';
|
|
3
|
-
/**
|
|
4
|
-
* Rewrite references to `./components/component-folder-name/component-file-name.js` with
|
|
5
|
-
* `./components/component-tag-name/customElement.js` in `.js` and `.d.ts` files.
|
|
6
|
-
*
|
|
7
|
-
* @remarks
|
|
8
|
-
* Assuming content includes POSIX paths only (as that's what import specifiers
|
|
9
|
-
* in ECMAScript use)
|
|
10
|
-
*/
|
|
11
|
-
export declare const rewriteComponentImportSpecifiers: (code: string, context: Pick<CompilerContext, "apiExtractor" | "dir">, cwd: string, originalCwd: string) => string;
|
|
12
|
-
/**
|
|
13
|
-
* The result of relative() is a path that does not start with `./`.
|
|
14
|
-
* In import statements the path must begin with ../ or ./ to be interpreted as
|
|
15
|
-
* a relative path rather than a package name.
|
|
16
|
-
* This function makes sure that the result of relative() is normalized to start
|
|
17
|
-
* with `./` or `../`
|
|
18
|
-
*/
|
|
19
|
-
export declare const toRelativeImportSpecifier: (typeof path)["relative"];
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { default as ts } from 'typescript';
|
|
2
|
-
import { JsxContext } from '../jsxToLitHtml/types.ts';
|
|
3
|
-
/**
|
|
4
|
-
* Instead of adding imports to the component source file, take note of imports
|
|
5
|
-
* that need to be added and have addNonLazyImports() add them to component's
|
|
6
|
-
* component-name/index.js (rather than component-name/customElement.js)
|
|
7
|
-
*
|
|
8
|
-
* Since component-name/index.js file is only imported in non-lazy builds, it
|
|
9
|
-
* will make sure to bundle-in used components. In lazy builds, it is expected
|
|
10
|
-
* that "defineCustomElements()" of some sort is called separately to load the
|
|
11
|
-
* components this file depends on.
|
|
12
|
-
*/
|
|
13
|
-
export declare function handleComponentImports(context: JsxContext): ts.ImportDeclaration[];
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ResolvedDependencyComponent } from '../dependencies/discover.ts';
|
|
2
|
-
import { CompilerContext } from '../context/index.ts';
|
|
3
|
-
/**
|
|
4
|
-
* Automatically add imports as appropriate for all referenced internally defined
|
|
5
|
-
* and externally defined custom elements
|
|
6
|
-
*/
|
|
7
|
-
export declare function resolveTagName(context: CompilerContext, tagName: string, fileName: string): {
|
|
8
|
-
packageName: string | undefined;
|
|
9
|
-
modulePath: string;
|
|
10
|
-
} | undefined;
|
|
11
|
-
export declare function modulePathToString(resolvedPath: {
|
|
12
|
-
packageName: string | undefined;
|
|
13
|
-
modulePath: string;
|
|
14
|
-
}, distRelativeCwd: string): string;
|
|
15
|
-
export declare function getLocalDefinedComponentsFromApiJson(context: Pick<CompilerContext, "_localDefinedComponents" | "privateApiJson" | "viteCommand">): Readonly<Record<string, ResolvedDependencyComponent>>;
|
|
16
|
-
export declare const exportsForTests: {
|
|
17
|
-
modulePathToString: typeof modulePathToString;
|
|
18
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { TemplatePart } from './templateParts.ts';
|
|
2
|
-
import { JsxContext } from './types.ts';
|
|
3
|
-
/**
|
|
4
|
-
* If JSX prop value could possibly be `undefined`, we add `?? nothing` to it.
|
|
5
|
-
*
|
|
6
|
-
* See comment on ElementPropertyToAttributeMappings.stringified for reason why.
|
|
7
|
-
*/
|
|
8
|
-
export declare function autoAddNullishFallback(part: TemplatePart, context: JsxContext, defaultValue?: string): TemplatePart;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { default as ts } from 'typescript';
|
|
2
|
-
import { JsxContext } from './types.ts';
|
|
3
|
-
import { TemplatePart } from './templateParts.ts';
|
|
4
|
-
/**
|
|
5
|
-
* Extract comments and whitespace from a node (called "trivia" in TypeScript)
|
|
6
|
-
*/
|
|
7
|
-
export declare const getNodeTrivia: (node: ts.Node, context: Pick<JsxContext, "sourceFile">) => string;
|
|
8
|
-
/**
|
|
9
|
-
* Attach trivia comments to a node.
|
|
10
|
-
*
|
|
11
|
-
* @remarks
|
|
12
|
-
* Does not attach whitespace as doing so in TypeScript AST is much harder than
|
|
13
|
-
* it seems. There is one hacky workaround, but I could easily see it break
|
|
14
|
-
* something: https://stackoverflow.com/a/69240365/8584605
|
|
15
|
-
*/
|
|
16
|
-
export declare function attachComments<T extends ts.Node>(triviaText: string, node: T): T;
|
|
17
|
-
export declare const findCommentRanges: (trivia: string) => ts.CommentRange[];
|
|
18
|
-
/** Convert trivia into parts that can be converted to template expressions */
|
|
19
|
-
export declare function triviaToTemplateParts(trivia: string): TemplatePart[];
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { default as ts } from 'typescript';
|
|
2
|
-
import { TemplatePart } from './templateParts.ts';
|
|
3
|
-
import { JsxContext } from './types.ts';
|
|
4
|
-
import { JsxPropType } from './inferPropType.ts';
|
|
5
|
-
import { dynamicHtmlSymbol, dynamicSvgSymbol } from './config.ts';
|
|
6
|
-
/**
|
|
7
|
-
* Handle the conversion for each JSX prop type
|
|
8
|
-
*/
|
|
9
|
-
export declare const convertProps: Record<JsxPropType, (context: JsxContext, initializer: ts.JsxAttributeValue | undefined, propName: string, tagName: string | typeof dynamicHtmlSymbol | typeof dynamicSvgSymbol) => TemplatePart[]>;
|
|
10
|
-
export declare function keyInitializerToExpression(initializer: ts.JsxAttributeValue | undefined, sourceFile: ts.SourceFile): ts.Expression;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { default as ts } from 'typescript';
|
|
2
|
-
import { JsxContext } from './types.ts';
|
|
3
|
-
/**
|
|
4
|
-
* This runs before we know what imports will be needed.
|
|
5
|
-
*
|
|
6
|
-
* 1. Go though all import paths and take note of them to inform us later if
|
|
7
|
-
* some custom element import still need or need not be added
|
|
8
|
-
* 2. Take note of all the existing Lit imports. Otherwise, when inserting
|
|
9
|
-
* imports, if we see that e.x "html" is not present in the "lit" import, we
|
|
10
|
-
* might import it again and fail to check that it might be imported further
|
|
11
|
-
* down from "lit-html".
|
|
12
|
-
* 3. Drop compiler-only imports that exist as runtime imports only for
|
|
13
|
-
* type checking or as compiler hints.
|
|
14
|
-
*/
|
|
15
|
-
export declare function trackExistingImports(context: JsxContext, importDeclaration: ts.ImportDeclaration): ts.ImportDeclaration | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* After we know what imports will be needed, if there already are some imports
|
|
18
|
-
* from the places we are looking for, augment those import declarations.
|
|
19
|
-
*
|
|
20
|
-
* In a step after this, if any imports will still be needed, we will add them.
|
|
21
|
-
*/
|
|
22
|
-
export declare function augmentExistingImports(this: JsxContext, node: ts.Statement): ts.Statement;
|
|
23
|
-
/**
|
|
24
|
-
* For each remaining needed import that is not already included, add an
|
|
25
|
-
* import declaration
|
|
26
|
-
*/
|
|
27
|
-
export declare function addMissingLitImports(context: JsxContext): ts.ImportDeclaration[];
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { JsxImportName } from './types.ts';
|
|
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[]>;
|
|
11
|
-
/**
|
|
12
|
-
* These runtime imports exist only for type checking or as compiler hints.
|
|
13
|
-
* The compiler refactors out their usages. Thus, we should also remove out
|
|
14
|
-
* their imports. This does not happen automatically if using TypeScript's
|
|
15
|
-
* strict verbatimModuleSyntax setting.
|
|
16
|
-
*/
|
|
17
|
-
export declare const compilerOnlyLuminaImports: Set<string>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { FileTransformer } from '../publicTypes.ts';
|
|
2
|
-
/**
|
|
3
|
-
* Let developers author components in JSX for better type checking and developer
|
|
4
|
-
* experience, but convert JSX to lit-html at build time for better performance.
|
|
5
|
-
*
|
|
6
|
-
* This TypeScript transformer converts JSX expressions to lit-html tagged
|
|
7
|
-
* literals, adding necessary imports in the process
|
|
8
|
-
*
|
|
9
|
-
* @remarks
|
|
10
|
-
* If you wish to explicitly opt-out of JSX to lit-html transform in a given
|
|
11
|
-
* file, you can do so by specifying a `@jsx` pragma at the top of the file.
|
|
12
|
-
* For example, to use React JSX in a file, add the following at the top:
|
|
13
|
-
* ```ts
|
|
14
|
-
* /** @jsx React.createElement *\/
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* Also, if you import JSX from non-Lumina library, the transform will also be
|
|
18
|
-
* disabled for that file.
|
|
19
|
-
*/
|
|
20
|
-
export declare const transformJsxToLitHtml: FileTransformer;
|