@atlaspack/packager-js 2.18.3-typescript-1fd1095e8.0 → 2.18.3-typescript-e99c742e9.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/lib/CJSOutputFormat.d.ts +7 -0
- package/lib/DevPackager.d.ts +15 -0
- package/lib/ESMOutputFormat.d.ts +7 -0
- package/lib/GlobalOutputFormat.d.ts +7 -0
- package/lib/ScopeHoistingPackager.d.ts +65 -0
- package/lib/helpers.d.ts +11 -0
- package/lib/index.d.ts +3 -0
- package/lib/utils.d.ts +6 -0
- package/package.json +13 -13
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ScopeHoistingPackager, OutputFormat } from './ScopeHoistingPackager';
|
|
2
|
+
export declare class CJSOutputFormat implements OutputFormat {
|
|
3
|
+
packager: ScopeHoistingPackager;
|
|
4
|
+
constructor(packager: ScopeHoistingPackager);
|
|
5
|
+
buildBundlePrelude(): [string, number];
|
|
6
|
+
buildBundlePostlude(): [string, number];
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { BundleGraph, PluginOptions, NamedBundle } from '@atlaspack/types';
|
|
2
|
+
import SourceMap from '@parcel/source-map';
|
|
3
|
+
export declare class DevPackager {
|
|
4
|
+
options: PluginOptions;
|
|
5
|
+
bundleGraph: BundleGraph<NamedBundle>;
|
|
6
|
+
bundle: NamedBundle;
|
|
7
|
+
parcelRequireName: string;
|
|
8
|
+
constructor(options: PluginOptions, bundleGraph: BundleGraph<NamedBundle>, bundle: NamedBundle, parcelRequireName: string);
|
|
9
|
+
package(): Promise<{
|
|
10
|
+
contents: string;
|
|
11
|
+
map: SourceMap | null | undefined;
|
|
12
|
+
}>;
|
|
13
|
+
getPrefix(): string;
|
|
14
|
+
isEntry(): boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ScopeHoistingPackager, OutputFormat } from './ScopeHoistingPackager';
|
|
2
|
+
export declare class ESMOutputFormat implements OutputFormat {
|
|
3
|
+
packager: ScopeHoistingPackager;
|
|
4
|
+
constructor(packager: ScopeHoistingPackager);
|
|
5
|
+
buildBundlePrelude(): [string, number];
|
|
6
|
+
buildBundlePostlude(): [string, number];
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ScopeHoistingPackager, OutputFormat } from './ScopeHoistingPackager';
|
|
2
|
+
export declare class GlobalOutputFormat implements OutputFormat {
|
|
3
|
+
packager: ScopeHoistingPackager;
|
|
4
|
+
constructor(packager: ScopeHoistingPackager);
|
|
5
|
+
buildBundlePrelude(): [string, number];
|
|
6
|
+
buildBundlePostlude(): [string, number];
|
|
7
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Asset, BundleGraph, Dependency, PluginOptions, NamedBundle, PluginLogger } from '@atlaspack/types';
|
|
2
|
+
import SourceMap from '@parcel/source-map';
|
|
3
|
+
export interface OutputFormat {
|
|
4
|
+
buildBundlePrelude(): [string, number];
|
|
5
|
+
buildBundlePostlude(): [string, number];
|
|
6
|
+
}
|
|
7
|
+
export declare class ScopeHoistingPackager {
|
|
8
|
+
options: PluginOptions;
|
|
9
|
+
bundleGraph: BundleGraph<NamedBundle>;
|
|
10
|
+
bundle: NamedBundle;
|
|
11
|
+
parcelRequireName: string;
|
|
12
|
+
useAsyncBundleRuntime: boolean;
|
|
13
|
+
outputFormat: OutputFormat;
|
|
14
|
+
isAsyncBundle: boolean;
|
|
15
|
+
globalNames: ReadonlySet<string>;
|
|
16
|
+
assetOutputs: Map<string, {
|
|
17
|
+
code: string;
|
|
18
|
+
map: Buffer | null | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
exportedSymbols: Map<string, {
|
|
21
|
+
asset: Asset;
|
|
22
|
+
exportSymbol: string;
|
|
23
|
+
local: string;
|
|
24
|
+
exportAs: Array<string>;
|
|
25
|
+
}>;
|
|
26
|
+
externals: Map<string, Map<string, string>>;
|
|
27
|
+
topLevelNames: Map<string, number>;
|
|
28
|
+
seenAssets: Set<string>;
|
|
29
|
+
wrappedAssets: Set<string>;
|
|
30
|
+
hoistedRequires: Map<string, Map<string, string>>;
|
|
31
|
+
needsPrelude: boolean;
|
|
32
|
+
usedHelpers: Set<string>;
|
|
33
|
+
externalAssets: Set<Asset>;
|
|
34
|
+
logger: PluginLogger;
|
|
35
|
+
constructor(options: PluginOptions, bundleGraph: BundleGraph<NamedBundle>, bundle: NamedBundle, parcelRequireName: string, useAsyncBundleRuntime: boolean, logger: PluginLogger);
|
|
36
|
+
package(): Promise<{
|
|
37
|
+
contents: string;
|
|
38
|
+
map: SourceMap | null | undefined;
|
|
39
|
+
}>;
|
|
40
|
+
shouldBundleQueue(bundle: NamedBundle): boolean;
|
|
41
|
+
runWhenReady(bundle: NamedBundle, codeToRun: string): string;
|
|
42
|
+
loadAssets(): Promise<{
|
|
43
|
+
wrapped: Array<Asset>;
|
|
44
|
+
constant: Array<Asset>;
|
|
45
|
+
}>;
|
|
46
|
+
isReExported(asset: Asset): boolean;
|
|
47
|
+
buildExportedSymbols(): void;
|
|
48
|
+
getTopLevelName(name: string): string;
|
|
49
|
+
getPropertyAccess(obj: string, property: string): string;
|
|
50
|
+
visitAsset(asset: Asset): [string, SourceMap | null | undefined, number];
|
|
51
|
+
getAssetFilePath(asset: Asset): string;
|
|
52
|
+
buildAsset(asset: Asset, code: string, map?: Buffer | null): [string, SourceMap | null | undefined, number];
|
|
53
|
+
buildReplacements(asset: Asset, deps: Array<Dependency>): [Map<string, Array<Dependency>>, Map<string, string>];
|
|
54
|
+
addExternal(dep: Dependency, replacements?: Map<string, string>, referencedBundle?: NamedBundle): void;
|
|
55
|
+
isWrapped(resolved: Asset, parentAsset: Asset): boolean;
|
|
56
|
+
getSymbolResolution(parentAsset: Asset, resolved: Asset, imported: string, dep?: Dependency, replacements?: Map<string, string>): string;
|
|
57
|
+
getHoistedParcelRequires(parentAsset: Asset, dep: Dependency, resolved: Asset): [string, number];
|
|
58
|
+
buildAssetPrelude(asset: Asset, deps: Array<Dependency>, replacements: Map<string, string>): [string, number, string];
|
|
59
|
+
buildBundlePrelude(): [string, number];
|
|
60
|
+
needsDefaultInterop(asset: Asset): boolean;
|
|
61
|
+
shouldSkipAsset(asset: Asset): boolean;
|
|
62
|
+
isScriptEntry(asset: Asset): boolean;
|
|
63
|
+
buildFunctionExpression(args: Array<string>, expr: string): string;
|
|
64
|
+
hasConditionalDependency(): boolean;
|
|
65
|
+
}
|
package/lib/helpers.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Environment } from '@atlaspack/types';
|
|
2
|
+
export declare const prelude: (parcelRequireName: string) => string;
|
|
3
|
+
export declare const fnExpr: (env: Environment, params: Array<string>, body: Array<string>) => string;
|
|
4
|
+
export declare const bundleQueuePrelude: (env: Environment) => string;
|
|
5
|
+
export declare const helpers: {
|
|
6
|
+
readonly $parcel$export: "\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n";
|
|
7
|
+
readonly $parcel$exportWildcard: "\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule' || Object.prototype.hasOwnProperty.call(dest, key)) {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n }\n });\n });\n\n return dest;\n}\n";
|
|
8
|
+
readonly $parcel$interopDefault: "\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n";
|
|
9
|
+
readonly $parcel$global: (env: Environment) => string;
|
|
10
|
+
readonly $parcel$defineInteropFlag: "\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true, configurable: true});\n}\n";
|
|
11
|
+
};
|
package/lib/index.d.ts
ADDED
package/lib/utils.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BundleGraph, Dependency, NamedBundle } from '@atlaspack/types';
|
|
2
|
+
import type SourceMap from '@parcel/source-map';
|
|
3
|
+
export declare function replaceScriptDependencies(bundleGraph: BundleGraph<NamedBundle>, bundle: NamedBundle, code: string, map: SourceMap | null | undefined, parcelRequireName: string): string;
|
|
4
|
+
export declare function getSpecifier(dep: Dependency): string;
|
|
5
|
+
export declare function isValidIdentifier(id: string): boolean;
|
|
6
|
+
export declare function makeValidIdentifier(name: string): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/packager-js",
|
|
3
|
-
"version": "2.18.3-typescript-
|
|
3
|
+
"version": "2.18.3-typescript-e99c742e9.0",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -9,18 +9,19 @@
|
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "https://github.com/atlassian-labs/atlaspack.git"
|
|
11
11
|
},
|
|
12
|
-
"main": "lib/index.js",
|
|
13
|
-
"source": "src/index.ts",
|
|
12
|
+
"main": "./lib/index.js",
|
|
13
|
+
"source": "./src/index.ts",
|
|
14
|
+
"types": "./lib/index.d.ts",
|
|
14
15
|
"engines": {
|
|
15
16
|
"node": ">= 16.0.0"
|
|
16
17
|
},
|
|
17
18
|
"dependencies": {
|
|
18
|
-
"@atlaspack/diagnostic": "2.14.2-typescript-
|
|
19
|
-
"@atlaspack/feature-flags": "2.19.3-typescript-
|
|
20
|
-
"@atlaspack/plugin": "2.14.21-typescript-
|
|
21
|
-
"@atlaspack/rust": "3.4.2-typescript-
|
|
22
|
-
"@atlaspack/types": "2.15.11-typescript-
|
|
23
|
-
"@atlaspack/utils": "2.17.3-typescript-
|
|
19
|
+
"@atlaspack/diagnostic": "2.14.2-typescript-e99c742e9.0",
|
|
20
|
+
"@atlaspack/feature-flags": "2.19.3-typescript-e99c742e9.0",
|
|
21
|
+
"@atlaspack/plugin": "2.14.21-typescript-e99c742e9.0",
|
|
22
|
+
"@atlaspack/rust": "3.4.2-typescript-e99c742e9.0",
|
|
23
|
+
"@atlaspack/types": "2.15.11-typescript-e99c742e9.0",
|
|
24
|
+
"@atlaspack/utils": "2.17.3-typescript-e99c742e9.0",
|
|
24
25
|
"@parcel/source-map": "^2.1.1",
|
|
25
26
|
"globals": "^13.2.0",
|
|
26
27
|
"nullthrows": "^1.1.1",
|
|
@@ -28,8 +29,7 @@
|
|
|
28
29
|
},
|
|
29
30
|
"type": "commonjs",
|
|
30
31
|
"scripts": {
|
|
31
|
-
"check-ts": "tsc --
|
|
32
|
+
"check-ts": "tsc --emitDeclarationOnly --rootDir src"
|
|
32
33
|
},
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
}
|
|
34
|
+
"gitHead": "e99c742e92175ac411d807daf2ba45d5bacebb58"
|
|
35
|
+
}
|