@arcgis/components-build-utils 5.2.0-next.3 → 5.2.0-next.31

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/vite.d.cts DELETED
@@ -1,101 +0,0 @@
1
- import { Plugin } from 'vite';
2
- import { default as dts } from 'vite-plugin-dts';
3
- import { PackageJson } from './packageJson.ts';
4
- /**
5
- * Vite preset for all our support packages:
6
- * - externalizes all non-dev-dependencies
7
- * - generates type declarations (using `vite-plugin-dts`)
8
- */
9
- export declare function vitePresetPlugin({ dtsOptions, externalize, bundleIn, isApplication, }?: DependencyManagementOptions & {
10
- /** Additional options for `vite-plugin-dts` */
11
- dtsOptions?: Parameters<typeof dts>[0] | false;
12
- }): [Plugin, Plugin, Promise<Plugin> | undefined];
13
- /**
14
- * Options for externalizing dependencies.
15
- */
16
- export type DependencyManagementOptions = {
17
- /**
18
- * Force bundle in these dependencies even if they are declared as
19
- * dependencies or peerDependencies.
20
- *
21
- * @example
22
- * This is desirable if you wish to control the version of a dependency or
23
- * need to post-process the dependency in some way. Usually, you will declare
24
- * such as a devDependency, but there is a use case for declaring it as a
25
- * dependency instead:
26
- *
27
- * - If TypeScript types from the bundled in dependencies are referenced in
28
- * the `.d.ts` files of your library, you will need to declare the package
29
- * as a `dependency`, so that it is still installed on the consumer's
30
- * computer so that TypeScript can correctly resolve the types of that
31
- * library.
32
- */
33
- readonly bundleIn?: (RegExp | string)[];
34
- /**
35
- * Force externalize these dependencies, even if they are declared as
36
- * devDependencies.
37
- *
38
- * @example
39
- * This is desirable if you are sure the end user will have these dependencies
40
- * available, yet do not wish to declare these as devDependencies for some
41
- * technical reasons.
42
- */
43
- readonly externalize?: (RegExp | string)[];
44
- /**
45
- * By default, this plugin errors if any devDependency is used in runtime code
46
- * to avoid bundling in dependencies in a library. In application packages,
47
- * bundling in everything is desirable, so enable this option.
48
- *
49
- * @default false
50
- */
51
- readonly isApplication?: boolean;
52
- };
53
- /**
54
- * By default, Rollup will bundle-in all dependencies.
55
- *
56
- * We change it as follows:
57
- * Externalize all packages that are defined as
58
- * "dependency" or "peerDependency" in the package.json.
59
- * If you wish to bundle-in some package, define it as a "devDependency".
60
- *
61
- * Bundling-in packages is not recommended because:
62
- * - it makes our build take longer
63
- * - it pushes larger packages to NPM
64
- * - user of our library is locked into the version of the package we bundled in
65
- * - if user has two packages using the same library, there will be two copies
66
- * served on the page
67
- * - It may break some libraries/prevent them from optimizing correctly
68
- * depending on the production/development mode, or prevent them from loading
69
- * correct code depending on browser/node.js environment.
70
- *
71
- * For example, see this statement from Lit:
72
- * https://lit.dev/docs/ssr/authoring/#:~:text=Don%27t%20bundle%20Lit,based%20on%20environment.
73
- *
74
- * @see {@link ./buildCdn.ts} for CDN dependency bundling details
75
- *
76
- * @remarks
77
- * If a dependency is both a peerDependency and a devDependency, it will still
78
- * be externalized (because all peerDependencies are externalized).
79
- */
80
- export declare function externalizeDependencies(options: DependencyManagementOptions): Plugin;
81
- interface PluginShape extends Plugin {
82
- resolveId: {
83
- filter: {
84
- id: {
85
- include: RegExp[];
86
- exclude: RegExp[] | undefined;
87
- };
88
- };
89
- handler: (id: string, importer: string | undefined, options: {
90
- isEntry: boolean;
91
- }) => false | undefined;
92
- };
93
- }
94
- declare function externalizeDependenciesImplementation(options: DependencyManagementOptions, packageJson: PackageJson): PluginShape;
95
- declare function matchesAny(id: string, patterns: readonly RegExp[]): boolean;
96
- export declare const exportsForTests: {
97
- stringToStartsWithGlob: (option: RegExp | string) => RegExp;
98
- externalizeDependenciesImplementation: typeof externalizeDependenciesImplementation;
99
- matchesAny: typeof matchesAny;
100
- };
101
- export {};
package/dist/vite.d.ts DELETED
@@ -1,101 +0,0 @@
1
- import { Plugin } from 'vite';
2
- import { default as dts } from 'vite-plugin-dts';
3
- import { PackageJson } from './packageJson.ts';
4
- /**
5
- * Vite preset for all our support packages:
6
- * - externalizes all non-dev-dependencies
7
- * - generates type declarations (using `vite-plugin-dts`)
8
- */
9
- export declare function vitePresetPlugin({ dtsOptions, externalize, bundleIn, isApplication, }?: DependencyManagementOptions & {
10
- /** Additional options for `vite-plugin-dts` */
11
- dtsOptions?: Parameters<typeof dts>[0] | false;
12
- }): [Plugin, Plugin, Promise<Plugin> | undefined];
13
- /**
14
- * Options for externalizing dependencies.
15
- */
16
- export type DependencyManagementOptions = {
17
- /**
18
- * Force bundle in these dependencies even if they are declared as
19
- * dependencies or peerDependencies.
20
- *
21
- * @example
22
- * This is desirable if you wish to control the version of a dependency or
23
- * need to post-process the dependency in some way. Usually, you will declare
24
- * such as a devDependency, but there is a use case for declaring it as a
25
- * dependency instead:
26
- *
27
- * - If TypeScript types from the bundled in dependencies are referenced in
28
- * the `.d.ts` files of your library, you will need to declare the package
29
- * as a `dependency`, so that it is still installed on the consumer's
30
- * computer so that TypeScript can correctly resolve the types of that
31
- * library.
32
- */
33
- readonly bundleIn?: (RegExp | string)[];
34
- /**
35
- * Force externalize these dependencies, even if they are declared as
36
- * devDependencies.
37
- *
38
- * @example
39
- * This is desirable if you are sure the end user will have these dependencies
40
- * available, yet do not wish to declare these as devDependencies for some
41
- * technical reasons.
42
- */
43
- readonly externalize?: (RegExp | string)[];
44
- /**
45
- * By default, this plugin errors if any devDependency is used in runtime code
46
- * to avoid bundling in dependencies in a library. In application packages,
47
- * bundling in everything is desirable, so enable this option.
48
- *
49
- * @default false
50
- */
51
- readonly isApplication?: boolean;
52
- };
53
- /**
54
- * By default, Rollup will bundle-in all dependencies.
55
- *
56
- * We change it as follows:
57
- * Externalize all packages that are defined as
58
- * "dependency" or "peerDependency" in the package.json.
59
- * If you wish to bundle-in some package, define it as a "devDependency".
60
- *
61
- * Bundling-in packages is not recommended because:
62
- * - it makes our build take longer
63
- * - it pushes larger packages to NPM
64
- * - user of our library is locked into the version of the package we bundled in
65
- * - if user has two packages using the same library, there will be two copies
66
- * served on the page
67
- * - It may break some libraries/prevent them from optimizing correctly
68
- * depending on the production/development mode, or prevent them from loading
69
- * correct code depending on browser/node.js environment.
70
- *
71
- * For example, see this statement from Lit:
72
- * https://lit.dev/docs/ssr/authoring/#:~:text=Don%27t%20bundle%20Lit,based%20on%20environment.
73
- *
74
- * @see {@link ./buildCdn.ts} for CDN dependency bundling details
75
- *
76
- * @remarks
77
- * If a dependency is both a peerDependency and a devDependency, it will still
78
- * be externalized (because all peerDependencies are externalized).
79
- */
80
- export declare function externalizeDependencies(options: DependencyManagementOptions): Plugin;
81
- interface PluginShape extends Plugin {
82
- resolveId: {
83
- filter: {
84
- id: {
85
- include: RegExp[];
86
- exclude: RegExp[] | undefined;
87
- };
88
- };
89
- handler: (id: string, importer: string | undefined, options: {
90
- isEntry: boolean;
91
- }) => false | undefined;
92
- };
93
- }
94
- declare function externalizeDependenciesImplementation(options: DependencyManagementOptions, packageJson: PackageJson): PluginShape;
95
- declare function matchesAny(id: string, patterns: readonly RegExp[]): boolean;
96
- export declare const exportsForTests: {
97
- stringToStartsWithGlob: (option: RegExp | string) => RegExp;
98
- externalizeDependenciesImplementation: typeof externalizeDependenciesImplementation;
99
- matchesAny: typeof matchesAny;
100
- };
101
- export {};