@arcgis/lumina-compiler 5.0.0-next.99 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +9 -5
- package/README.md +3 -4
- package/dist/context/index.d.ts +17 -100
- package/dist/context/typeScript.d.ts +1 -14
- package/dist/context/utils.d.ts +1 -1
- package/dist/dependencies/discover.d.ts +10 -8
- package/dist/dependencies/updateLumina.d.ts +2 -2
- package/dist/docs/config.d.ts +7 -0
- package/dist/docs/stencilDocsJson.d.ts +1 -1
- package/dist/docs/vsCodeCustomData/index.d.ts +1 -1
- package/dist/docs/vsCodeCustomData/utils.d.ts +1 -1
- package/dist/docs/webTypes/description.d.ts +1 -1
- package/dist/docs/webTypes/index.d.ts +1 -1
- package/dist/docs/webTypes/utils.d.ts +2 -2
- package/dist/entrypoints/dtsUtils.d.ts +1 -3
- package/dist/entrypoints/findUtils.d.ts +0 -10
- package/dist/entrypoints/resolveTagName.d.ts +8 -3
- package/dist/index.d.ts +0 -4
- package/dist/index.js +3532 -5374
- package/dist/loader/extractor.d.ts +2 -0
- package/dist/loader/index.d.ts +10 -2
- package/dist/loader/lazy.d.ts +2 -3
- package/dist/loader/storybookApiJson.d.ts +1 -1
- package/dist/{logger-hJvg0JOj.js → logger-63CXuX6h.js} +5 -6
- package/dist/plugins/updatePackageJson.d.ts +2 -2
- package/dist/publicTypes.d.ts +44 -90
- package/dist/puppeteerTesting/index.js +2 -2
- package/dist/transformers/customElementDeclaration.d.ts +2 -0
- package/dist/transformers/index.d.ts +0 -6
- package/dist/transformers/property.d.ts +2 -1
- package/dist/transformers/propertyOptions.d.ts +2 -3
- package/package.json +9 -8
- package/dist/entrypoints/pathMapping.d.ts +0 -24
- package/dist/extractor/LuminaApiExtractor.d.ts +0 -63
- package/dist/extractor/apiJsonUtils.d.ts +0 -5
- package/dist/extractor/declaration.d.ts +0 -7
- package/dist/extractor/helpers/cssDoc.d.ts +0 -11
- package/dist/extractor/helpers/event.d.ts +0 -8
- package/dist/extractor/helpers/method.d.ts +0 -4
- package/dist/extractor/helpers/property.d.ts +0 -4
- package/dist/extractor/helpers/resolveType.d.ts +0 -47
- package/dist/extractor/helpers/typeValue.d.ts +0 -60
- package/dist/extractor/index.d.ts +0 -14
- package/dist/extractor/parseStoryFiles.d.ts +0 -2
- package/dist/frameworkTypes/index.d.ts +0 -15
- package/dist/frameworkTypes/lumina.d.ts +0 -5
- package/dist/frameworkTypes/preact.d.ts +0 -7
- package/dist/frameworkTypes/preact10.d.ts +0 -10
- package/dist/frameworkTypes/react.d.ts +0 -6
- package/dist/frameworkTypes/stencil.d.ts +0 -5
- package/dist/frameworkTypes/utils.d.ts +0 -7
- package/dist/frameworkTypes/vanilla.d.ts +0 -3
- package/dist/types/astTransformers.d.ts +0 -3
- package/dist/types/hideInternalLitElement.d.ts +0 -11
- package/dist/types/index.d.ts +0 -18
- package/dist/types/liftSetterTypes.d.ts +0 -32
- package/dist/types/textTransformers.d.ts +0 -4
- package/dist/types/transformComponentMembers.d.ts +0 -10
package/LICENSE.md
CHANGED
|
@@ -4,10 +4,14 @@ 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), and is bound by the terms of that agreement.
|
|
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.
|
|
8
|
+
You may redistribute and use this code without modification, provided you adhere to the terms of the MLA and include this copyright notice.
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
For additional information, contact:
|
|
11
|
+
Environmental Systems Research Institute, Inc.
|
|
12
|
+
Attn: Contracts and Legal Services Department
|
|
13
|
+
380 New York Street
|
|
14
|
+
Redlands, California, USA 92373
|
|
15
|
+
USA
|
|
10
16
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
email: contracts@esri.com
|
|
17
|
+
email: legal@esri.com
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# ArcGIS Maps SDK for JavaScript -
|
|
1
|
+
# ArcGIS Maps SDK for JavaScript - Lumina Compiler
|
|
2
2
|
|
|
3
3
|
**No Esri Technical Support included.**
|
|
4
4
|
|
|
@@ -8,6 +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
|
-
|
|
12
|
-
|
|
13
|
-
This package is licensed under the terms described in the `LICENSE.md` file, located in the root of the package.
|
|
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.0/LICENSE.txt.
|
|
12
|
+
For third party notices, see https://js.arcgis.com/5.0/third-party-notices.txt.
|
package/dist/context/index.d.ts
CHANGED
|
@@ -1,49 +1,16 @@
|
|
|
1
1
|
import { ConfigEnv, Plugin, ResolvedConfig, ViteDevServer } from 'vite';
|
|
2
2
|
import { default as ts } from 'typescript';
|
|
3
|
-
import {
|
|
4
|
-
import { LuminaOptions, AssetSpec, AssetTransformer,
|
|
5
|
-
import { ComponentPathMapping } from '../entrypoints/pathMapping.ts';
|
|
3
|
+
import { ApiCustomElementDeclaration, ApiJson } from '@arcgis/api-extractor/apiJson';
|
|
4
|
+
import { LuminaOptions, AssetSpec, AssetTransformer, ProvideAssetsOptions, LintingOptions } from '../publicTypes.ts';
|
|
6
5
|
import { DocsType } from '../docs/types.ts';
|
|
7
6
|
import { ContextDirectories } from './types.ts';
|
|
8
7
|
import { makeLoaders, computeServeOnlyDependencies } from '../dependencies/loaders.ts';
|
|
9
|
-
import { parseStoryFiles } from '../extractor/parseStoryFiles.ts';
|
|
10
8
|
import { CustomElementInterdependencies } from '../entrypoints/config.ts';
|
|
11
|
-
import { getCompilerOptionsForPrinter } from '../transformers/index.ts';
|
|
12
9
|
import { getLocalDefinedComponentsFromApiJson } from '../entrypoints/resolveTagName.ts';
|
|
13
|
-
import {
|
|
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';
|
|
14
13
|
export declare class CompilerContext {
|
|
15
|
-
/**
|
|
16
|
-
* The path to the resolved TypeScript configuration
|
|
17
|
-
*/
|
|
18
|
-
typeScriptConfigPath: string;
|
|
19
|
-
/**
|
|
20
|
-
* The parsed TypeScript configuration
|
|
21
|
-
*/
|
|
22
|
-
typeScriptConfig: ts.CompilerOptions;
|
|
23
|
-
/**
|
|
24
|
-
* An instance of TypeScript program. Contains all .tsx source files present
|
|
25
|
-
* in the project.
|
|
26
|
-
*
|
|
27
|
-
* TypeScript program is created only in build mode and in storybook. It
|
|
28
|
-
* is not created in serve.
|
|
29
|
-
*/
|
|
30
|
-
typeScriptProgram?: ts.Program;
|
|
31
|
-
/**
|
|
32
|
-
* An instance of TypeScript type checker.
|
|
33
|
-
*
|
|
34
|
-
* TypeScript type checker is created only in build mode and in storybook. It
|
|
35
|
-
* is not created in serve.
|
|
36
|
-
*/
|
|
37
|
-
typeScriptTypeChecker?: ts.TypeChecker;
|
|
38
|
-
/**
|
|
39
|
-
* A TypeScript watcher program. Created only when running under Storybook in
|
|
40
|
-
* serve mode.
|
|
41
|
-
*/
|
|
42
|
-
typeScriptWatchProgram?: ts.WatchOfConfigFile<ts.BuilderProgram>;
|
|
43
|
-
/**
|
|
44
|
-
* An instance of TypeScript compiler host
|
|
45
|
-
*/
|
|
46
|
-
typeScriptHost: ts.CompilerHost;
|
|
47
14
|
/**
|
|
48
15
|
* TypeScript source file instances created in serve mode
|
|
49
16
|
*
|
|
@@ -51,13 +18,12 @@ export declare class CompilerContext {
|
|
|
51
18
|
*/
|
|
52
19
|
private readonly _typeScriptSourceFiles;
|
|
53
20
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* doing hot-module-reload until the TypeScript program is re-created.
|
|
21
|
+
* A promise for after tsconfig.json and api-extractor.config.ts are loaded
|
|
22
|
+
* and list of files in current project are resolved.
|
|
57
23
|
*
|
|
58
24
|
* @private
|
|
59
25
|
*/
|
|
60
|
-
|
|
26
|
+
configsPromise: Promise<void>;
|
|
61
27
|
/**
|
|
62
28
|
* Whether minification is enabled for transformed JSX (lit-html templates)
|
|
63
29
|
* and generated component code.
|
|
@@ -83,11 +49,15 @@ export declare class CompilerContext {
|
|
|
83
49
|
* @private
|
|
84
50
|
*/
|
|
85
51
|
readonly _plugin: Plugin;
|
|
86
|
-
private _startCollectingComponentStories;
|
|
87
52
|
/**
|
|
88
53
|
* List of directories of common interest to the compiler
|
|
89
54
|
*/
|
|
90
55
|
dir: ContextDirectories;
|
|
56
|
+
apiExtractor: ApiExtractor | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* @private
|
|
59
|
+
*/
|
|
60
|
+
apiExtractorPluginConfig: ApiExtractorPluginConfig;
|
|
91
61
|
/**
|
|
92
62
|
* The api.json stores information about the structure of all components in
|
|
93
63
|
* the package (their properties, methods, events, JSDoc and etc).
|
|
@@ -109,38 +79,17 @@ export declare class CompilerContext {
|
|
|
109
79
|
* Resolves once api.json is first generated during a given build run.
|
|
110
80
|
* @private
|
|
111
81
|
*/
|
|
112
|
-
apiJsonDeferred:
|
|
82
|
+
apiJsonDeferred: PromiseWithResolvers<void> | undefined;
|
|
113
83
|
/**
|
|
114
84
|
* In some test environments, api.json will never be produced.
|
|
115
85
|
*/
|
|
116
86
|
apiJsonEnabled: boolean;
|
|
117
|
-
/**
|
|
118
|
-
* @private
|
|
119
|
-
*/
|
|
120
|
-
_componentPathMapping: ComponentPathMapping;
|
|
121
87
|
/**
|
|
122
88
|
* Cached result of getLocalDefinedComponentsFromApiJson() call
|
|
123
89
|
*
|
|
124
90
|
* @private
|
|
125
91
|
*/
|
|
126
92
|
_localDefinedComponents?: ReturnType<typeof getLocalDefinedComponentsFromApiJson>;
|
|
127
|
-
/**
|
|
128
|
-
* Mapping of css files and which components they are imported in.
|
|
129
|
-
*
|
|
130
|
-
* @private
|
|
131
|
-
*/
|
|
132
|
-
readonly _cssImports: Map<string, Set<string> | undefined>;
|
|
133
|
-
/**
|
|
134
|
-
* Mapping of CSS file names to docs extracted from them.
|
|
135
|
-
*
|
|
136
|
-
* CSS files are read during the file transform stage, which is after the
|
|
137
|
-
* api.json is extracted. This unfortunately means that we have to mutate
|
|
138
|
-
* the api.json after the fact to add the CSS docs. Furthermore, when api.json
|
|
139
|
-
* is re-generated, we need to re-add the CSS docs previously extracted.
|
|
140
|
-
*
|
|
141
|
-
* @private
|
|
142
|
-
*/
|
|
143
|
-
_cssDocs?: Map<string, ApiCssCustomProperty[] | undefined>;
|
|
144
93
|
/**
|
|
145
94
|
* The environment that Vite is running in
|
|
146
95
|
*
|
|
@@ -218,15 +167,6 @@ export declare class CompilerContext {
|
|
|
218
167
|
*/
|
|
219
168
|
isFullApiExtraction: boolean;
|
|
220
169
|
readonly banner: string;
|
|
221
|
-
/**
|
|
222
|
-
* `@arcgis/lumina-compiler` plugins may register additional `.d.ts`
|
|
223
|
-
* transformers. For public consumption of Lumina, instead of using this
|
|
224
|
-
* option, use the `types.declarationTextTransformers` option on the
|
|
225
|
-
* `useLumina` Vite plugin.
|
|
226
|
-
*
|
|
227
|
-
* @private
|
|
228
|
-
*/
|
|
229
|
-
readonly _declarationTextTransformers: DeclarationTextTransformer[];
|
|
230
170
|
/**
|
|
231
171
|
* Options passed to `useLumina()`
|
|
232
172
|
*/
|
|
@@ -259,16 +199,10 @@ export declare class CompilerContext {
|
|
|
259
199
|
assetsToProvide: ProvideAssetsOptions[] | undefined;
|
|
260
200
|
/**
|
|
261
201
|
* A promise that resolves to list of file names that declare one or more
|
|
262
|
-
* components
|
|
202
|
+
* components. This promise only represents the initial scan and is not updated
|
|
203
|
+
* in watch or serve mode.
|
|
263
204
|
*/
|
|
264
|
-
componentFilesPromise: Promise<
|
|
265
|
-
/**
|
|
266
|
-
* A list of file names that declare one or more components
|
|
267
|
-
*/
|
|
268
|
-
componentFiles: string[];
|
|
269
|
-
componentStoryFiles: string[];
|
|
270
|
-
componentStoriesPromise?: Promise<void>;
|
|
271
|
-
componentStories?: Awaited<ReturnType<typeof parseStoryFiles>>;
|
|
205
|
+
componentFilesPromise: Promise<string[]>;
|
|
272
206
|
/**
|
|
273
207
|
* Style for hiding custom elements before they are loaded. This is appended
|
|
274
208
|
* to the global stylesheet.
|
|
@@ -303,12 +237,6 @@ export declare class CompilerContext {
|
|
|
303
237
|
* @private
|
|
304
238
|
*/
|
|
305
239
|
_customElementDependencies: CustomElementInterdependencies;
|
|
306
|
-
/**
|
|
307
|
-
* Result of getCompilerOptionsForPrinter() call.
|
|
308
|
-
*
|
|
309
|
-
* @private
|
|
310
|
-
*/
|
|
311
|
-
_compilerOptionsForPrinter: ReturnType<typeof getCompilerOptionsForPrinter>;
|
|
312
240
|
/**
|
|
313
241
|
* Cached result of getPrinter() call. Cached to not needlessly create and
|
|
314
242
|
* throw away a printer instance for each transformed file.
|
|
@@ -316,23 +244,12 @@ export declare class CompilerContext {
|
|
|
316
244
|
* @private
|
|
317
245
|
*/
|
|
318
246
|
_typeScriptPrinter: ReturnType<typeof unsafeGetUndocumentedPrinter>;
|
|
319
|
-
/**
|
|
320
|
-
* Cached RegExp for replacing occurrences of `ArcgisCounter["el"]` with
|
|
321
|
-
* `HtmlElementArcgisCounter`.
|
|
322
|
-
*
|
|
323
|
-
* @private
|
|
324
|
-
*/
|
|
325
|
-
_htmlElementReferencesReplacer?: {
|
|
326
|
-
regex: RegExp;
|
|
327
|
-
replacements: Record<string, string>;
|
|
328
|
-
};
|
|
329
247
|
private _silencedRules;
|
|
330
248
|
/**
|
|
331
249
|
* Promise that resolves once src/lumina.ts is updated
|
|
332
250
|
* @private
|
|
333
251
|
*/
|
|
334
252
|
_updateLuminaTsPromise?: Promise<void>;
|
|
335
|
-
private _didCallOptions;
|
|
336
253
|
/** @private */
|
|
337
254
|
_originalRollupInputOptions?: Record<string, string> | undefined;
|
|
338
255
|
constructor(options: LuminaOptions);
|
|
@@ -1,19 +1,6 @@
|
|
|
1
|
-
import { default as ts } from 'typescript';
|
|
2
1
|
import { CompilerContext } from './index.ts';
|
|
3
|
-
/**
|
|
4
|
-
* In build mode, vite-plugin-dts already parses tsconfig. However, it
|
|
5
|
-
* overwrites the resolved tsconfig.target with ESNext, which is not what we
|
|
6
|
-
* want (we need the real tsconfig.target for the CDN build). Thus, we have
|
|
7
|
-
* to resolve the tsconfig ahead of time manually.
|
|
8
|
-
*
|
|
9
|
-
* In dev server, practically the only use for a TypeScript config is the
|
|
10
|
-
* getPrinter() call. It's also used in ts.createSourceFile(), but looks
|
|
11
|
-
* like that can be safely called with the latest target.
|
|
12
|
-
*/
|
|
13
|
-
export declare function loadTypeScriptConfig(context: CompilerContext): void;
|
|
14
2
|
/**
|
|
15
3
|
* Convert TypeScript ECMA target version number into an ESBuild target version
|
|
16
4
|
* string
|
|
17
5
|
*/
|
|
18
|
-
export declare function resolveTargetVersion(
|
|
19
|
-
export declare function loadTypeScript(context: CompilerContext, withSourceMap: boolean): void;
|
|
6
|
+
export declare function resolveTargetVersion(context: CompilerContext): string;
|
package/dist/context/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function inferPreamble(packageJson?: import('@arcgis/components-build-utils').
|
|
1
|
+
export declare function inferPreamble(packageJson?: import('@arcgis/components-build-utils').PackageJson): string;
|
|
2
2
|
export declare const preambleToComment: (preamble: string) => string;
|
|
3
3
|
export declare const throwOnReadBeforeSet: (createdDuring: string) => PropertyDecorator;
|
|
4
4
|
export declare function normalizeDocumentationFileName(fileName: string): string;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ModulePath } from '../extractor/helpers/resolveType.ts';
|
|
1
|
+
import { PackageJson } from '@arcgis/components-build-utils';
|
|
3
2
|
import { WebTypes } from '../docs/webTypes/types.ts';
|
|
4
|
-
import { ApiJson } from '@arcgis/api-extractor';
|
|
3
|
+
import { ApiJson } from '@arcgis/api-extractor/apiJson';
|
|
5
4
|
import { LuminaOptions } from '../publicTypes.ts';
|
|
6
5
|
export type ResolvedDependencyComponents = {
|
|
7
6
|
readonly packageName: string;
|
|
@@ -9,9 +8,11 @@ export type ResolvedDependencyComponents = {
|
|
|
9
8
|
readonly components: Readonly<Record<string, ResolvedDependencyComponent>>;
|
|
10
9
|
readonly cdnUrl?: string;
|
|
11
10
|
readonly packageLocation: string;
|
|
12
|
-
readonly packageJson:
|
|
11
|
+
readonly packageJson: PackageJson;
|
|
13
12
|
};
|
|
14
|
-
export type ResolvedDependencyComponent =
|
|
13
|
+
export type ResolvedDependencyComponent = {
|
|
14
|
+
modulePath: string;
|
|
15
|
+
packageName: string | undefined;
|
|
15
16
|
/**
|
|
16
17
|
* If jsx property has a static value, and we see that an equivalent attribute
|
|
17
18
|
* exists, jsx property will be converted to an attribute rather than
|
|
@@ -58,11 +59,12 @@ export declare function findPackageComponents(packageName: string, cwd?: string)
|
|
|
58
59
|
/**
|
|
59
60
|
* Given the custom element manifest, find custom elements defined in it
|
|
60
61
|
*/
|
|
61
|
-
export declare function manifestToDependencyComponents(manifest: Partial<ApiJson>, dependency:
|
|
62
|
+
export declare function manifestToDependencyComponents(manifest: Partial<ApiJson>, dependency: {
|
|
63
|
+
readonly packageName: string | undefined;
|
|
62
64
|
readonly getImportPath: (tagName: string) => string;
|
|
63
65
|
}, computeRequiredProperties?: boolean): ResolvedDependencyComponents["components"];
|
|
64
|
-
export declare const webTypesToDependencyComponents: (webTypes: Partial<WebTypes>, dependency:
|
|
65
|
-
readonly
|
|
66
|
+
export declare const webTypesToDependencyComponents: (webTypes: Partial<WebTypes>, dependency: {
|
|
67
|
+
readonly packageName: string;
|
|
66
68
|
readonly getImportPath: (tagName: string) => string;
|
|
67
69
|
}) => ResolvedDependencyComponents["components"];
|
|
68
70
|
export declare const inferDependencyComponentModuleName: (usesExports: boolean, tagName: string) => string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ResolvedDependencyComponents } from './discover.ts';
|
|
2
2
|
export declare function updateLuminaTs(dependencies: readonly ResolvedDependencyComponents[], srcDir: string, hasCore: boolean,
|
|
3
3
|
/** Preserved positional argument for compatibility because codemod was passing it */
|
|
4
|
-
_unused?: never, packageJson?: import('@arcgis/components-build-utils').
|
|
5
|
-
declare function produceLuminaTs(dependencies: readonly ResolvedDependencyComponents[], hasCore: boolean, packageJson?: import('@arcgis/components-build-utils').
|
|
4
|
+
_unused?: never, packageJson?: import('@arcgis/components-build-utils').PackageJson): Promise<boolean>;
|
|
5
|
+
declare function produceLuminaTs(dependencies: readonly ResolvedDependencyComponents[], hasCore: boolean, packageJson?: import('@arcgis/components-build-utils').PackageJson): string;
|
|
6
6
|
export declare const exportsForTests: {
|
|
7
7
|
produceLuminaTs: typeof produceLuminaTs;
|
|
8
8
|
};
|
package/dist/docs/config.d.ts
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
|
+
import { CompilerContext } from '../context/index.ts';
|
|
1
2
|
import { DocsType } from './types.ts';
|
|
2
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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CompilerContext } from '../context/index.ts';
|
|
2
|
-
import { ApiDocsTag } from '@arcgis/api-extractor';
|
|
2
|
+
import { ApiDocsTag } from '@arcgis/api-extractor/apiJson';
|
|
3
3
|
/**
|
|
4
4
|
* To avoid having a dependency on Stencil, we inline Stencil types rather than
|
|
5
5
|
* importing them.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VsCodeHtmlDocs, VsCodeCssDocs } from './types.ts';
|
|
2
|
-
import { ApiCustomElementDeclaration } from '@arcgis/api-extractor';
|
|
2
|
+
import { ApiCustomElementDeclaration } from '@arcgis/api-extractor/apiJson';
|
|
3
3
|
/**
|
|
4
4
|
* Originally based on
|
|
5
5
|
* https://github.com/break-stuff/cem-tools/tree/main/packages/vs-code-integration
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { VsCodeTag } from './types.ts';
|
|
2
|
-
import { ApiCustomElementDeclaration } from '@arcgis/api-extractor';
|
|
2
|
+
import { ApiCustomElementDeclaration } from '@arcgis/api-extractor/apiJson';
|
|
3
3
|
export declare const getTagList: (components: ApiCustomElementDeclaration[]) => VsCodeTag[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiClassMember, ApiCssCustomProperty, ApiCssPart, ApiCustomElementDeclaration, ApiEvent, ApiSlot } from '@arcgis/api-extractor';
|
|
1
|
+
import { ApiClassMember, ApiCssCustomProperty, ApiCssPart, ApiCustomElementDeclaration, ApiEvent, ApiSlot } from '@arcgis/api-extractor/apiJson';
|
|
2
2
|
export declare function getComponentDetailsTemplate(component: ApiCustomElementDeclaration): string;
|
|
3
3
|
export declare const getSlotsTemplate: (slots?: ApiSlot[]) => string;
|
|
4
4
|
export declare const getEventsTemplate: (events?: ApiEvent[]) => string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WebTypesOptions, WebTypesElement, WebTypes } from './types.ts';
|
|
2
|
-
import { ApiCustomElementDeclaration } from '@arcgis/api-extractor';
|
|
2
|
+
import { ApiCustomElementDeclaration } from '@arcgis/api-extractor/apiJson';
|
|
3
3
|
/**
|
|
4
4
|
* Originally based on
|
|
5
5
|
* https://github.com/break-stuff/cem-tools/tree/main/packages/jet-brains-integration
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ApiCustomElementDeclaration } from '@arcgis/api-extractor';
|
|
1
|
+
import { ApiCustomElementDeclaration } from '@arcgis/api-extractor/apiJson';
|
|
2
2
|
import { WebTypesAttribute, WebTypesCssProperty, WebTypesPseudoElement } from './types.ts';
|
|
3
3
|
export declare const getCssPropertyList: (components: ApiCustomElementDeclaration[]) => WebTypesCssProperty[];
|
|
4
4
|
export declare const getCssPartList: (components: ApiCustomElementDeclaration[]) => WebTypesPseudoElement[];
|
|
5
|
-
export declare
|
|
5
|
+
export declare function getComponentAttributes(component: ApiCustomElementDeclaration): WebTypesAttribute[];
|
|
6
6
|
export declare const formatDescription: (description?: string, deprecated?: boolean | string) => string;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { DeclarationTextTransformer } from '../publicTypes.ts';
|
|
2
1
|
import { path } from '@arcgis/components-build-utils';
|
|
3
2
|
import { CompilerContext } from '../context/index.ts';
|
|
4
|
-
export declare const rewriteDtsComponentFileNames: DeclarationTextTransformer;
|
|
5
3
|
export declare const rePath: RegExp;
|
|
6
4
|
/**
|
|
7
5
|
* Rewrite references to `./components/component-folder-name/component-file-name.js` with
|
|
@@ -11,7 +9,7 @@ export declare const rePath: RegExp;
|
|
|
11
9
|
* Assuming content includes POSIX paths only (as that's what import specifiers
|
|
12
10
|
* in ECMAScript use)
|
|
13
11
|
*/
|
|
14
|
-
export declare const rewriteComponentImportSpecifiers: (code: string, context: Pick<CompilerContext, "
|
|
12
|
+
export declare const rewriteComponentImportSpecifiers: (code: string, context: Pick<CompilerContext, "apiExtractor" | "dir">, cwd: string, originalCwd: string) => string;
|
|
15
13
|
/**
|
|
16
14
|
* The result of relative() is a path that does not start with `./`.
|
|
17
15
|
* In import statements the path must begin with ../ or ./ to be interpreted as
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
import { CompilerContext } from '../context/index.ts';
|
|
2
1
|
/**
|
|
3
2
|
* @example
|
|
4
3
|
* `src/components/component-name/component-name.tsx` =>
|
|
5
4
|
* `./components/component-name/customElement`
|
|
6
5
|
*/
|
|
7
6
|
export declare const entrypointPathToDistPath: (sourceFileName: string, srcPath?: string) => string;
|
|
8
|
-
/**
|
|
9
|
-
* Finds all components in the src/components folder. With support for nested
|
|
10
|
-
* components (looking for .tsx files whose name matches their folder name)
|
|
11
|
-
*/
|
|
12
|
-
export declare const findComponentFiles: (context: CompilerContext, componentsDirectory: string, searchBase?: string) => Promise<string[]>;
|
|
13
|
-
/**
|
|
14
|
-
* Check if absolute file path looks like a component entrypoint
|
|
15
|
-
*/
|
|
16
|
-
export declare function pathIsEntrypoint(absolutePath: string, componentsFolder: string): boolean;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { ResolvedDependencyComponent } from '../dependencies/discover.ts';
|
|
2
|
-
import { ModulePath } from '../extractor/helpers/resolveType.ts';
|
|
3
2
|
import { CompilerContext } from '../context/index.ts';
|
|
4
3
|
/**
|
|
5
4
|
* Automatically add imports as appropriate for all referenced internally defined
|
|
6
5
|
* and externally defined custom elements
|
|
7
6
|
*/
|
|
8
|
-
export declare function resolveTagName(context: CompilerContext, tagName: string, fileName: string):
|
|
9
|
-
|
|
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;
|
|
10
15
|
export declare function getLocalDefinedComponentsFromApiJson(context: Pick<CompilerContext, "_localDefinedComponents" | "privateApiJson" | "viteCommand">): Readonly<Record<string, ResolvedDependencyComponent>>;
|
|
11
16
|
export declare const exportsForTests: {
|
|
12
17
|
modulePathToString: typeof modulePathToString;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { initializeComponentDependencies } from './dependencies/discover.ts';
|
|
2
2
|
import { updateLuminaTs } from './dependencies/updateLumina.ts';
|
|
3
|
-
import { findDeclaredComponent } from './extractor/declaration.ts';
|
|
4
3
|
export { useLumina } from './useLumina.ts';
|
|
5
4
|
export type * from './publicTypes.ts';
|
|
6
5
|
export { inferCdnUrl } from './defaultAssetsUrl.ts';
|
|
7
6
|
export type { CompilerContext } from './context/index.ts';
|
|
8
|
-
export { LuminaApiExtractor } from './extractor/LuminaApiExtractor.ts';
|
|
9
7
|
/**
|
|
10
8
|
* These are exposed only for usage by the @arcgis/stencil-to-lumina codemod
|
|
11
9
|
*
|
|
@@ -18,12 +16,10 @@ export declare const exportsForCodemod: {
|
|
|
18
16
|
readonly common: Required<import('./jsxToLitHtml/config.ts').ElementPropertyToAttributeMappings>;
|
|
19
17
|
readonly perElement: Record<string, import('./jsxToLitHtml/config.ts').ElementPropertyToAttributeMappings | undefined>;
|
|
20
18
|
};
|
|
21
|
-
findDeclaredComponent: typeof findDeclaredComponent;
|
|
22
19
|
nativeEvents: Set<string>;
|
|
23
20
|
svgElements: Set<string>;
|
|
24
21
|
mathMlElements: Set<string>;
|
|
25
22
|
alwaysAttributes: Set<string>;
|
|
26
23
|
nativeAlwaysAttributes: Set<string>;
|
|
27
24
|
htmlAlwaysAttributes: Record<string, Set<string> | undefined>;
|
|
28
|
-
isPropertyEscapeNeeded: (name: string) => boolean;
|
|
29
25
|
};
|