@arcgis/lumina-compiler 4.33.0-next.99 → 4.34.0-next.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.
@@ -6,6 +6,7 @@ import { ComponentPathMapping } from '../entrypoints/pathMapping';
6
6
  import { DocsType } from '../docs/types';
7
7
  import { ContextDirectories } from './types';
8
8
  import { makeLoaders, computeServeOnlyDependencies } from '../dependencies/loaders';
9
+ import { parseStoryFiles } from '../extractor/parseStoryFiles';
9
10
  import { CustomElementInterdependencies } from '../entrypoints/config';
10
11
  import { getCompilerOptionsForPrinter } from '../transformers';
11
12
  import { getPrinter } from '../transformers/internalTypeScriptApis';
@@ -250,7 +251,14 @@ export declare class CompilerContext {
250
251
  * A promise that resolves to list of file names that declare one or more
251
252
  * components
252
253
  */
253
- componentFilesPromise: Promise<string[]>;
254
+ componentFilesPromise: Promise<typeof this.componentFiles>;
255
+ /**
256
+ * A list of file names that declare one or more components
257
+ */
258
+ componentFiles: string[];
259
+ componentStoryFiles: string[];
260
+ componentStoriesPromise?: Promise<void>;
261
+ componentStories?: Awaited<ReturnType<typeof parseStoryFiles>>;
254
262
  /**
255
263
  * Style for hiding custom elements before they are loaded. This is appended
256
264
  * to the global stylesheet.
@@ -264,10 +272,6 @@ export declare class CompilerContext {
264
272
  * @private
265
273
  */
266
274
  _globalCssString?: string;
267
- /**
268
- * A list of file names that declare one or more components
269
- */
270
- componentFiles: string[];
271
275
  /**
272
276
  * Cached result of makeLoaders() call
273
277
  *
@@ -317,6 +321,8 @@ export declare class CompilerContext {
317
321
  * @private
318
322
  */
319
323
  _updateLuminaTsPromise?: Promise<void>;
324
+ normalizedDocumentationUrl: string;
325
+ alternativeDocumentationUrl: string;
320
326
  constructor(options: LuminaOptions);
321
327
  private _inferBuildSetup;
322
328
  /**
@@ -353,5 +359,6 @@ export declare class CompilerContext {
353
359
  * ```
354
360
  */
355
361
  provideAssets(assets: AssetSpec[], transformers?: AssetTransformer[], apply?: CompilerContext["viteCommand"]): void;
362
+ logLintWarning(error: string): void;
356
363
  logLintError(rule: keyof LintingOptions["silence"], absoluteFilePath: string, error: string): void;
357
364
  }
@@ -0,0 +1,8 @@
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;
@@ -1,6 +1,6 @@
1
- import { Package } from 'custom-elements-manifest/schema';
2
1
  import { ModulePath } from '../extractor/helpers/resolveType';
3
2
  import { WebTypes } from '../docs/webTypes/types';
3
+ import { ApiJson } from '@arcgis/api-extractor';
4
4
  export type ResolvedDependencyComponents = {
5
5
  readonly packageName: string;
6
6
  readonly type: "@arcgis/lumina" | "stencil" | "unknown";
@@ -53,7 +53,7 @@ export declare function findPackageComponents(packageName: string, cwd?: string)
53
53
  /**
54
54
  * Given the custom element manifest, find custom elements defined in it
55
55
  */
56
- export declare function manifestToDependencyComponents(manifest: Package, dependency: Omit<ModulePath, "moduleName"> & {
56
+ export declare function manifestToDependencyComponents(manifest: Partial<ApiJson>, dependency: Omit<ModulePath, "moduleName"> & {
57
57
  readonly getImportPath: (tagName: string) => string;
58
58
  }): ResolvedDependencyComponents["components"];
59
59
  export declare const webTypesToDependencyComponents: (webTypes: Partial<WebTypes>, dependency: Omit<ModulePath, "moduleName"> & {
@@ -2,8 +2,4 @@ import { CompilerContext } from '../context';
2
2
  import { ResolvedDependencyComponents } from './discover';
3
3
  import { DependencyInjectionResult } from './utils';
4
4
  export declare function makeLoaders(context: CompilerContext): Promise<DependencyInjectionResult[]>;
5
- export declare const silenceLitWarnings: {
6
- optimizableImports: never[];
7
- javascriptCode: string[];
8
- };
9
5
  export declare function computeServeOnlyDependencies(context: CompilerContext): Promise<readonly ResolvedDependencyComponents[]>;
@@ -1,14 +1,6 @@
1
1
  import { CompilerContext } from '../context';
2
- export declare const testLitSetupFileName = "/@arcgis/lumina-compiler/testLitSetupFile";
3
- /**
4
- * For browser tests, this file lazy-loads all dependencies, and then the
5
- * current package itself.
6
- * It also does misc test setup logic (mocking console, setting timeouts,
7
- * etc).
8
- */
9
2
  export declare const testSetupFileName = "/@arcgis/lumina-compiler/testSetupFile";
10
3
  export declare const testSetupFileNames: string[];
11
- export declare const litTestSetupFileContent: string;
12
4
  /**
13
5
  * Get the entrypoint code for lazy-loading all components and their
14
6
  * dependencies when running a web component test in the browser.
@@ -1,4 +1,3 @@
1
- import { ComponentCompilerTypeReferences } from '@stencil/core/internal';
2
1
  import { CompilerContext } from '../context';
3
2
  import { ApiDocsTag } from '@arcgis/api-extractor';
4
3
  /**
@@ -68,6 +67,11 @@ interface ComponentCompilerMethodComplexType {
68
67
  references: ComponentCompilerTypeReferences;
69
68
  return: string;
70
69
  }
70
+ type ComponentCompilerTypeReferences = Record<string, {
71
+ location: "global" | "import" | "local";
72
+ path?: string;
73
+ id: string;
74
+ }>;
71
75
  interface JsonDocsMethod {
72
76
  name: string;
73
77
  docs: string;
@@ -1,5 +1,5 @@
1
1
  import { default as ts } from 'typescript';
2
- import { ApiExtractor, ApiAttribute, ApiClassMethod, ApiCustomElementDeclaration, ApiCustomElementField, ApiCustomElementMember, ApiDeclaration, ApiEvent, ApiExport, ApiJson, ApiModule, ApiReference } from '@arcgis/api-extractor';
2
+ import { ApiExtractor, ApiAttribute, ApiClassMethod, ApiCustomElementDeclaration, ApiCustomElementField, ApiCustomElementMember, ApiDeclaration, ApiEvent, ApiExport, ApiJson, ApiModule, ApiReference, CopyDocDefinitions } from '@arcgis/api-extractor';
3
3
  import { CompilerContext } from '../context';
4
4
  export declare class LuminaApiExtractor extends ApiExtractor {
5
5
  context: CompilerContext;
@@ -10,6 +10,7 @@ export declare class LuminaApiExtractor extends ApiExtractor {
10
10
  protected indexedComponents: Map<string, ApiCustomElementDeclaration>;
11
11
  protected apiComponent: ApiCustomElementDeclaration;
12
12
  protected pairedSetter: ts.SetAccessorDeclaration | undefined;
13
+ protected copyDocDefinitions: CopyDocDefinitions | undefined;
13
14
  extract(files: readonly ts.SourceFile[]): ApiJson;
14
15
  protected extractModules(files: readonly ts.SourceFile[]): ApiModule[];
15
16
  protected extractDeclarations(module: ts.SourceFile): ApiDeclaration[];
@@ -27,6 +28,7 @@ export declare class LuminaApiExtractor extends ApiExtractor {
27
28
  * When doing full API extraction, extract additional details for a field.
28
29
  */
29
30
  protected extractComponentFieldDetails(node: ts.AccessorDeclaration | ts.PropertyDeclaration, property: ApiCustomElementField): void;
31
+ static loggedBooleanWarning: boolean;
30
32
  /**
31
33
  * Find the properties given to the `@property()` decorator.
32
34
  */
@@ -0,0 +1,2 @@
1
+ import { ApiDemo } from '@arcgis/api-extractor';
2
+ export declare function parseStoryFiles(files: string[], publicStoryUrlPrefix: string): Promise<Map<string, ApiDemo[]>>;
package/dist/index.d.ts CHANGED
@@ -24,6 +24,6 @@ export declare const exportsForCodemod: {
24
24
  mathMlElements: Set<string>;
25
25
  alwaysAttributes: Set<string>;
26
26
  nativeAlwaysAttributes: Set<string>;
27
- htmlAlwaysAttributes: Record<string, Set<string>>;
27
+ htmlAlwaysAttributes: Record<string, Set<string> | undefined>;
28
28
  isPropertyEscapeNeeded: (name: string) => boolean;
29
29
  };