@arcgis/lumina-compiler 4.31.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.
- package/LICENSE.md +13 -0
- package/README.md +21 -0
- package/dist/chunk-BQ4U6HQL.js +1 -0
- package/dist/chunk-JFKSI6I7.js +1 -0
- package/dist/context/index.d.ts +241 -0
- package/dist/context/types.d.ts +34 -0
- package/dist/context/utils.d.ts +23 -0
- package/dist/context/utils.spec.d.ts +1 -0
- package/dist/defaultAssetsUrl.d.ts +21 -0
- package/dist/defaultAssetsUrl.spec.d.ts +1 -0
- package/dist/dependencies/arcgisCore.d.ts +30 -0
- package/dist/dependencies/discover.d.ts +62 -0
- package/dist/dependencies/index.d.ts +11 -0
- package/dist/dependencies/lit.d.ts +2 -0
- package/dist/dependencies/loaders.d.ts +8 -0
- package/dist/dependencies/stencil.d.ts +6 -0
- package/dist/dependencies/testSetupFiles.d.ts +21 -0
- package/dist/dependencies/updateLumina.d.ts +8 -0
- package/dist/dependencies/updateLumina.spec.d.ts +1 -0
- package/dist/dependencies/utils.d.ts +23 -0
- package/dist/entrypoints/addNonLazyImports.d.ts +13 -0
- package/dist/entrypoints/config.d.ts +23 -0
- package/dist/entrypoints/dtsUtils.d.ts +22 -0
- package/dist/entrypoints/dtsUtils.spec.d.ts +1 -0
- package/dist/entrypoints/findUtils.d.ts +21 -0
- package/dist/entrypoints/findUtils.spec.d.ts +1 -0
- package/dist/entrypoints/handleComponentImports.d.ts +13 -0
- package/dist/entrypoints/pathMapping.d.ts +25 -0
- package/dist/entrypoints/resolveTagName.d.ts +14 -0
- package/dist/entrypoints/resolveTagName.spec.d.ts +1 -0
- package/dist/frameworkTypes/index.d.ts +15 -0
- package/dist/frameworkTypes/lumina.d.ts +5 -0
- package/dist/frameworkTypes/preact.d.ts +6 -0
- package/dist/frameworkTypes/react.d.ts +6 -0
- package/dist/frameworkTypes/stencil.d.ts +5 -0
- package/dist/frameworkTypes/utils.d.ts +8 -0
- package/dist/frameworkTypes/vanilla.d.ts +3 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +248 -0
- package/dist/jsxToLitHtml/autoAddNothing.d.ts +8 -0
- package/dist/jsxToLitHtml/comments.d.ts +19 -0
- package/dist/jsxToLitHtml/config.d.ts +148 -0
- package/dist/jsxToLitHtml/convertProps.d.ts +10 -0
- package/dist/jsxToLitHtml/escapeForTemplateLiteral.d.ts +45 -0
- package/dist/jsxToLitHtml/imports.d.ts +32 -0
- package/dist/jsxToLitHtml/index.d.ts +17 -0
- package/dist/jsxToLitHtml/inferPropType.d.ts +40 -0
- package/dist/jsxToLitHtml/insertRepeatCall.d.ts +49 -0
- package/dist/jsxToLitHtml/jsxVisitor.d.ts +11 -0
- package/dist/jsxToLitHtml/templateParts.d.ts +17 -0
- package/dist/jsxToLitHtml/throwOnImportingExternalized.d.ts +10 -0
- package/dist/jsxToLitHtml/types.d.ts +80 -0
- package/dist/jsxToLitHtml/utils.d.ts +14 -0
- package/dist/jsxToLitHtml/utils.spec.d.ts +1 -0
- package/dist/manifests/complexTypes/addComponentMetadata.d.ts +5 -0
- package/dist/manifests/complexTypes/addMethodMetadata.d.ts +6 -0
- package/dist/manifests/complexTypes/addPropMetadata.d.ts +8 -0
- package/dist/manifests/complexTypes/docsUtils.d.ts +18 -0
- package/dist/manifests/complexTypes/event.d.ts +9 -0
- package/dist/manifests/complexTypes/getComplexPropertyType.d.ts +11 -0
- package/dist/manifests/complexTypes/transformUtils.d.ts +130 -0
- package/dist/manifests/complexTypes/transformUtils.spec.d.ts +1 -0
- package/dist/manifests/complexTypes/typeToEnum.d.ts +14 -0
- package/dist/manifests/complexTypes/typeToEnum.spec.d.ts +1 -0
- package/dist/manifests/complexTypes/types.d.ts +135 -0
- package/dist/manifests/config.d.ts +2 -0
- package/dist/manifests/createManifest.d.ts +39 -0
- package/dist/manifests/customElementDecoratorPlugins.d.ts +58 -0
- package/dist/manifests/customElementDecoratorPlugins.spec.d.ts +1 -0
- package/dist/manifests/hideUntilHydrated.d.ts +15 -0
- package/dist/manifests/index.d.ts +12 -0
- package/dist/manifests/kebabCaseAttributes.d.ts +18 -0
- package/dist/manifests/lazy.d.ts +22 -0
- package/dist/manifests/lazy.spec.d.ts +1 -0
- package/dist/manifests/stencilManifest.d.ts +17 -0
- package/dist/manifests/storybookManifest.d.ts +6 -0
- package/dist/manifests/types.d.ts +1 -0
- package/dist/manifests/utils.d.ts +17 -0
- package/dist/plugins/buildCdn.d.ts +14 -0
- package/dist/plugins/buildStencilHydrate.d.ts +16 -0
- package/dist/plugins/buildWrappers.d.ts +3 -0
- package/dist/plugins/configureVite.d.ts +19 -0
- package/dist/plugins/externalizeDependencies.d.ts +34 -0
- package/dist/plugins/externalizeDependencies.spec.d.ts +1 -0
- package/dist/plugins/generateDocs.d.ts +10 -0
- package/dist/plugins/handleDynamicAssets.d.ts +3 -0
- package/dist/plugins/handleStaticAssets.d.ts +9 -0
- package/dist/plugins/loadLitCss.d.ts +89 -0
- package/dist/plugins/printTotalBuildSize.d.ts +7 -0
- package/dist/plugins/provideAssets.d.ts +53 -0
- package/dist/plugins/provideAssets.spec.d.ts +1 -0
- package/dist/plugins/setAssetsPath.d.ts +10 -0
- package/dist/plugins/updatePackageJson.d.ts +9 -0
- package/dist/plugins/updatePackageJson.spec.d.ts +1 -0
- package/dist/publicTypes.d.ts +626 -0
- package/dist/puppeteer-testing/globalSetup.d.ts +72 -0
- package/dist/puppeteer-testing/globalSetup.js +11 -0
- package/dist/puppeteer-testing/index.d.ts +9 -0
- package/dist/puppeteer-testing/index.js +6 -0
- package/dist/puppeteer-testing/injected.d.ts +8 -0
- package/dist/puppeteer-testing/puppeteer/browser.d.ts +6 -0
- package/dist/puppeteer-testing/puppeteer/element.d.ts +219 -0
- package/dist/puppeteer-testing/puppeteer/events.d.ts +21 -0
- package/dist/puppeteer-testing/puppeteer/page.d.ts +5 -0
- package/dist/puppeteer-testing/puppeteer/types.d.ts +124 -0
- package/dist/puppeteer-testing/vitest/matchers/attributes.d.ts +4 -0
- package/dist/puppeteer-testing/vitest/matchers/classList.d.ts +4 -0
- package/dist/puppeteer-testing/vitest/matchers/events.d.ts +7 -0
- package/dist/puppeteer-testing/vitest/matchers/index.d.ts +38 -0
- package/dist/puppeteer-testing/vitest/matchers/text.d.ts +2 -0
- package/dist/puppeteer-testing/vitest/matchers/utils.d.ts +1 -0
- package/dist/puppeteer-testing/vitest/runner.d.ts +15 -0
- package/dist/puppeteer-testing/vitest/setupFile.d.ts +1 -0
- package/dist/testing/index.d.ts +11 -0
- package/dist/testing/index.js +1 -0
- package/dist/testing/mount.d.ts +106 -0
- package/dist/testing/setupFile.d.ts +1 -0
- package/dist/testing/snapshotSerializer.d.ts +12 -0
- package/dist/testing/wrapController.d.ts +33 -0
- package/dist/tests/utils.d.ts +4 -0
- package/dist/transformers/guardAgainstInternalJsDoc.d.ts +11 -0
- package/dist/transformers/index.d.ts +22 -0
- package/dist/transformers/injectRuntimeOptions.d.ts +3 -0
- package/dist/transformers/internalTypeScriptApis.d.ts +29 -0
- package/dist/transformers/liftDecorators.d.ts +21 -0
- package/dist/transformers/members.d.ts +12 -0
- package/dist/transformers/property.d.ts +9 -0
- package/dist/transformers/propertyOptions.d.ts +111 -0
- package/dist/transformers/updateOriginalFile.d.ts +20 -0
- package/dist/transformers/utils.d.ts +14 -0
- package/dist/types/astTransformers.d.ts +3 -0
- package/dist/types/hideInternalLitElement.d.ts +9 -0
- package/dist/types/index.d.ts +18 -0
- package/dist/types/liftSetterTypes.d.ts +33 -0
- package/dist/types/textTransformers.d.ts +4 -0
- package/dist/types/transformComponentMembers.d.ts +10 -0
- package/dist/useLumina.d.ts +13 -0
- package/dist/utils/error.d.ts +4 -0
- package/dist/utils/packageJson.d.ts +24 -0
- package/dist/utils/path.d.ts +25 -0
- package/dist/utils/path.spec.d.ts +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type ts from "typescript";
|
|
2
|
+
import type { JsxContext } from "../jsxToLitHtml/types";
|
|
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[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { CompilerContext } from "../context";
|
|
2
|
+
import type { ComponentManifest } from "../manifests/utils";
|
|
3
|
+
/**
|
|
4
|
+
* A mapping between a path to a component folder in src/components and it's
|
|
5
|
+
* tag name.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```json
|
|
9
|
+
* {
|
|
10
|
+
* "root": {
|
|
11
|
+
* "": "arcgis-root",
|
|
12
|
+
* },
|
|
13
|
+
* "counter": {
|
|
14
|
+
* "": "arcgis-counter",
|
|
15
|
+
* "sub-counter": "arcgis-sub-counter",
|
|
16
|
+
* },
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export type ComponentPathMapping = Record<string, PathMappingInterface | string>;
|
|
21
|
+
interface PathMappingInterface extends ComponentPathMapping {
|
|
22
|
+
}
|
|
23
|
+
export declare function addComponentPathMapping(component: ComponentManifest, context: CompilerContext): string;
|
|
24
|
+
export declare function renameComponentFolder(filePath: string, pathBase: string, context: Pick<CompilerContext, "componentPathMapping">): string;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ResolvedDependencyComponent } from "../dependencies/discover";
|
|
2
|
+
import type { ModulePath } from "../manifests/complexTypes/transformUtils";
|
|
3
|
+
import type { ExtendedComponentManifest } from "../manifests/complexTypes/types";
|
|
4
|
+
import type { CompilerContext } from "../context";
|
|
5
|
+
/**
|
|
6
|
+
* Automatically add imports as appropriate for all referenced internally defined
|
|
7
|
+
* and externally defined custom elements
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveTagName(context: CompilerContext, tagName: string, fileName: string): ModulePath;
|
|
10
|
+
export declare function modulePathToString(resolvedPath: ModulePath, distRelativeCwd: string): string;
|
|
11
|
+
export declare function getLocalDefinedComponentsFromManifest(manifest: ExtendedComponentManifest): Readonly<Record<string, ResolvedDependencyComponent>>;
|
|
12
|
+
export declare const exportsForTests: {
|
|
13
|
+
modulePathToString: typeof modulePathToString;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CompilerContext } from "../context";
|
|
2
|
+
import type { Plugin } from "vite";
|
|
3
|
+
/**
|
|
4
|
+
* Generate component typings for vanilla JavaScript and JSX frameworks.
|
|
5
|
+
*
|
|
6
|
+
* Unfortunately, there are differences in how web components are interpreted
|
|
7
|
+
* across JSX libraries (differences in html attribute names like `class` vs
|
|
8
|
+
* `className`, event name case casting like `onArcgisClick` and
|
|
9
|
+
* `onarcgisClick`, ref typing like `HTMLElement|null` or
|
|
10
|
+
* `HTMLElement|undefined`, or `HTMLElement`, event callback typing and etc,
|
|
11
|
+
* like synthetic events or native events) that make it difficult to ship a
|
|
12
|
+
* "generic" typing that works for all JSX libraries out there, so we have to
|
|
13
|
+
* generate separate for each.
|
|
14
|
+
*/
|
|
15
|
+
export declare function generateFrameworkTypes(context: CompilerContext): Plugin;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ComponentManifest } from "../manifests/utils";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://github.com/preactjs/preact/issues/1180#issuecomment-643681851
|
|
4
|
+
* @see https://github.com/preactjs/preact/pull/1448/files
|
|
5
|
+
*/
|
|
6
|
+
export declare function generatePreactTypes(components: ComponentManifest[]): string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ComponentManifest } from "../manifests/utils";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://react.dev/blog/2024/04/25/react-19-upgrade-guide#the-jsx-namespace-in-typescript
|
|
4
|
+
* @see https://github.com/preactjs/preact/issues/1180#issuecomment-643681851
|
|
5
|
+
*/
|
|
6
|
+
export declare function generateReactTypes(components: ComponentManifest[]): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CompilerContext } from "../context";
|
|
2
|
+
import type { ExtendedManifestField } from "../manifests/complexTypes/types";
|
|
3
|
+
import type { ComponentManifest } from "../manifests/utils";
|
|
4
|
+
/** Generate a string for importing component types */
|
|
5
|
+
export declare const generateComponentTypeImports: (context: CompilerContext) => string;
|
|
6
|
+
export declare const isPropertyEscapeNeeded: (name: string) => boolean;
|
|
7
|
+
export declare const maybeEscapePropertyName: (name: string) => string;
|
|
8
|
+
export declare function getComponentExtend(name: string, members?: ComponentManifest["members"] & Partial<ExtendedManifestField>): readonly [extend: string, helperTypes: string];
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export { useLumina } from "./useLumina";
|
|
2
|
+
export * from "./publicTypes";
|
|
3
|
+
export { inferCdnUrl } from "./defaultAssetsUrl";
|
|
4
|
+
export type { CompilerContext } from "./context";
|
|
5
|
+
export type { ExtendedComponentManifest } from "./manifests/complexTypes/types";
|
|
6
|
+
import { initializeComponentDependencies } from "./dependencies/discover";
|
|
7
|
+
import { updateLuminaTs } from "./dependencies/updateLumina";
|
|
8
|
+
import { findDeclaredComponents } from "./manifests/customElementDecoratorPlugins";
|
|
9
|
+
/**
|
|
10
|
+
* These are exposed only for usage by the @arcgis/stencil-to-lumina codemod
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare const exportsForCodemod: {
|
|
15
|
+
initializeComponentDependencies: typeof initializeComponentDependencies;
|
|
16
|
+
updateLuminaTs: typeof updateLuminaTs;
|
|
17
|
+
propertyToAttributeMappings: {
|
|
18
|
+
common: import("./jsxToLitHtml/config").ElementPropertyToAttributeMappings;
|
|
19
|
+
perElement: Record<string, import("./jsxToLitHtml/config").ElementPropertyToAttributeMappings | undefined>;
|
|
20
|
+
};
|
|
21
|
+
findDeclaredComponents: typeof findDeclaredComponents;
|
|
22
|
+
nativeEvents: Set<string>;
|
|
23
|
+
svgElements: Set<string>;
|
|
24
|
+
mathMlElements: Set<string>;
|
|
25
|
+
alwaysAttributes: Set<string>;
|
|
26
|
+
nativeAlwaysAttributes: Set<string>;
|
|
27
|
+
htmlAlwaysAttributes: Record<string, Set<string>>;
|
|
28
|
+
isPropertyEscapeNeeded: (name: string) => boolean;
|
|
29
|
+
};
|