packtory 0.0.75 → 0.0.77
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/artifacts/artifacts-builder.d.ts +19 -0
- package/artifacts/artifacts-builder.d.ts.map +1 -1
- package/bundle-emitter/emitter.d.ts +7 -0
- package/bundle-emitter/emitter.d.ts.map +1 -1
- package/bundle-emitter/publication-outcome.d.ts +3 -0
- package/bundle-emitter/publication-outcome.d.ts.map +1 -1
- package/bundle-emitter/registry/package-metadata-fetcher.d.ts +9 -0
- package/bundle-emitter/registry/package-metadata-fetcher.d.ts.map +1 -1
- package/bundle-emitter/registry/registry-auth-config.d.ts +14 -0
- package/bundle-emitter/registry/registry-auth-config.d.ts.map +1 -1
- package/bundle-emitter/registry/registry-client.d.ts +10 -0
- package/bundle-emitter/registry/registry-client.d.ts.map +1 -1
- package/bundle-emitter/registry/tarball-integrity.d.ts +1 -0
- package/bundle-emitter/registry/tarball-integrity.d.ts.map +1 -1
- package/bundle-emitter/repository-coherence.d.ts +13 -0
- package/bundle-emitter/repository-coherence.d.ts.map +1 -0
- package/bundle-emitter/repository-url-normalizer.d.ts +2 -0
- package/bundle-emitter/repository-url-normalizer.d.ts.map +1 -0
- package/checks/check-runner.d.ts +12 -0
- package/checks/check-runner.d.ts.map +1 -1
- package/checks/rule.d.ts +37 -0
- package/checks/rule.d.ts.map +1 -1
- package/checks/rules/max-bundle-size.d.ts +10 -0
- package/checks/rules/max-bundle-size.d.ts.map +1 -1
- package/checks/rules/no-dev-dependency-imports.d.ts +7 -0
- package/checks/rules/no-dev-dependency-imports.d.ts.map +1 -1
- package/checks/rules/no-duplicated-files.d.ts +7 -0
- package/checks/rules/no-duplicated-files.d.ts.map +1 -1
- package/checks/rules/no-side-effects.d.ts +11 -0
- package/checks/rules/no-side-effects.d.ts.map +1 -1
- package/checks/rules/no-unused-bundle-dependencies.d.ts +4 -0
- package/checks/rules/no-unused-bundle-dependencies.d.ts.map +1 -1
- package/checks/rules/registry.d.ts +12 -0
- package/checks/rules/registry.d.ts.map +1 -1
- package/checks/rules/required-files.d.ts +11 -0
- package/checks/rules/required-files.d.ts.map +1 -1
- package/checks/rules/type-script-declaration-integrity.d.ts +6 -0
- package/checks/rules/type-script-declaration-integrity.d.ts.map +1 -1
- package/checks/rules/type-script-declaration-project.d.ts +27 -0
- package/checks/rules/type-script-declaration-project.d.ts.map +1 -1
- package/checks/rules/type-script-integrity.d.ts +18 -0
- package/checks/rules/type-script-integrity.d.ts.map +1 -1
- package/checks/rules/type-script-package-resolution.d.ts +24 -0
- package/checks/rules/type-script-package-resolution.d.ts.map +1 -1
- package/checks/rules/unique-target-paths.d.ts +4 -0
- package/checks/rules/unique-target-paths.d.ts.map +1 -1
- package/common/clock.d.ts +6 -0
- package/common/clock.d.ts.map +1 -1
- package/common/max-date.d.ts +2 -0
- package/common/max-date.d.ts.map +1 -0
- package/common/package-layout.d.ts +13 -0
- package/common/package-layout.d.ts.map +1 -0
- package/common/schema-validation.d.ts +14 -0
- package/common/schema-validation.d.ts.map +1 -0
- package/common/sort-values.d.ts +2 -0
- package/common/sort-values.d.ts.map +1 -0
- package/config/base-validations.d.ts +4 -0
- package/config/base-validations.d.ts.map +1 -0
- package/config/changelog-settings.d.ts +44 -0
- package/config/changelog-settings.d.ts.map +1 -1
- package/config/config.d.ts +6 -0
- package/config/config.d.ts.map +1 -1
- package/config/dead-code-elimination-settings.d.ts +1 -0
- package/config/dead-code-elimination-settings.d.ts.map +1 -1
- package/config/manual-versioning-settings.d.ts +11 -0
- package/config/manual-versioning-settings.d.ts.map +1 -1
- package/config/package-config.d.ts +5 -0
- package/config/package-config.d.ts.map +1 -1
- package/config/package-json.d.ts +2 -0
- package/config/package-json.d.ts.map +1 -1
- package/config/packtory-config-schema.d.ts +1459 -0
- package/config/packtory-config-schema.d.ts.map +1 -0
- package/config/publish-settings.d.ts +3 -0
- package/config/publish-settings.d.ts.map +1 -1
- package/config/registry-settings.d.ts +41 -0
- package/config/registry-settings.d.ts.map +1 -1
- package/config/validation.d.ts +15 -0
- package/config/validation.d.ts.map +1 -1
- package/config/versioning-settings.d.ts +17 -0
- package/config/versioning-settings.d.ts.map +1 -1
- package/dead-code-eliminator/analyzed-bundle.d.ts +9 -0
- package/dead-code-eliminator/analyzed-bundle.d.ts.map +1 -1
- package/dead-code-eliminator/eliminator.js +1 -1
- package/dead-code-eliminator/eliminator.js.map +1 -1
- package/dead-code-eliminator/source-map-recomposition.js +17 -12
- package/dead-code-eliminator/source-map-recomposition.js.map +1 -1
- package/dead-code-eliminator/transform/atom-translator.d.ts +20 -0
- package/dead-code-eliminator/transform/atom-translator.d.ts.map +1 -0
- package/dead-code-eliminator/transform/atom-translator.js +8 -0
- package/dead-code-eliminator/transform/atom-translator.js.map +1 -1
- package/dead-code-eliminator/transform/line-index.d.ts +9 -0
- package/dead-code-eliminator/transform/line-index.d.ts.map +1 -0
- package/dead-code-eliminator/transform/line-index.js +8 -14
- package/dead-code-eliminator/transform/line-index.js.map +1 -1
- package/dead-code-eliminator/transform/source-map-composer.js +32 -47
- package/dead-code-eliminator/transform/source-map-composer.js.map +1 -1
- package/dependency-scanner/dependency-graph.d.ts +31 -0
- package/dependency-scanner/dependency-graph.d.ts.map +1 -1
- package/dependency-scanner/external-dependencies.d.ts +1 -0
- package/dependency-scanner/external-dependencies.d.ts.map +1 -1
- package/dependency-scanner/scanner.d.ts +14 -0
- package/dependency-scanner/scanner.d.ts.map +1 -1
- package/dependency-scanner/source-file-references.d.ts +26 -0
- package/dependency-scanner/source-file-references.d.ts.map +1 -1
- package/dependency-scanner/source-map-file-locator.d.ts +7 -0
- package/dependency-scanner/source-map-file-locator.d.ts.map +1 -1
- package/dependency-scanner/typescript-compiler-options.d.ts +5 -0
- package/dependency-scanner/typescript-compiler-options.d.ts.map +1 -1
- package/dependency-scanner/typescript-file-host.d.ts +9 -0
- package/dependency-scanner/typescript-file-host.d.ts.map +1 -1
- package/dependency-scanner/typescript-project-analyzer.d.ts +14 -0
- package/dependency-scanner/typescript-project-analyzer.d.ts.map +1 -1
- package/directed-graph/graph.d.ts +27 -0
- package/directed-graph/graph.d.ts.map +1 -1
- package/file-manager/file-description.d.ts +1 -0
- package/file-manager/file-description.d.ts.map +1 -1
- package/file-manager/file-manager.d.ts +25 -0
- package/file-manager/file-manager.d.ts.map +1 -1
- package/git/current-git-head.d.ts +10 -0
- package/git/current-git-head.d.ts.map +1 -1
- package/linker/linked-bundle.d.ts +10 -0
- package/linker/linked-bundle.d.ts.map +1 -1
- package/linker/linked-bundle.js.map +1 -1
- package/linker/linker.d.ts +9 -0
- package/linker/linker.d.ts.map +1 -1
- package/linker/source-modifier/import-paths.js +51 -9
- package/linker/source-modifier/import-paths.js.map +1 -1
- package/linker/substitute-bundles.js +8 -4
- package/linker/substitute-bundles.js.map +1 -1
- package/linker/substituted-resource-graph.js +11 -1
- package/linker/substituted-resource-graph.js.map +1 -1
- package/pack-emitter/pack-emitter.d.ts +15 -0
- package/pack-emitter/pack-emitter.d.ts.map +1 -1
- package/package-surface/surface.d.ts +2 -0
- package/package-surface/surface.d.ts.map +1 -1
- package/package.json +29 -13
- package/packages/package-processor.composition.d.ts +31 -0
- package/packages/package-processor.composition.d.ts.map +1 -0
- package/packages/packtory.composition.d.ts +9 -0
- package/packages/packtory.composition.d.ts.map +1 -0
- package/packtory/changelog-source-attribution.d.ts +21 -0
- package/packtory/changelog-source-attribution.d.ts.map +1 -0
- package/packtory/generated-attribution-paths.d.ts +18 -0
- package/packtory/generated-attribution-paths.d.ts.map +1 -0
- package/packtory/map-config.d.ts +24 -0
- package/packtory/map-config.d.ts.map +1 -1
- package/packtory/options/prepare-package-options.d.ts +12 -0
- package/packtory/options/prepare-package-options.d.ts.map +1 -1
- package/packtory/options/setting-resolvers.d.ts +14 -0
- package/packtory/options/setting-resolvers.d.ts.map +1 -1
- package/packtory/package-processor-publish.d.ts +12 -0
- package/packtory/package-processor-publish.d.ts.map +1 -1
- package/packtory/package-processor.d.ts +25 -0
- package/packtory/package-processor.d.ts.map +1 -1
- package/packtory/packtory-results.d.ts +28 -0
- package/packtory/packtory-results.d.ts.map +1 -1
- package/packtory/packtory.d.ts +17 -0
- package/packtory/packtory.d.ts.map +1 -1
- package/packtory/partial-result.d.ts +12 -0
- package/packtory/partial-result.d.ts.map +1 -0
- package/packtory/published-release-state.d.ts +18 -0
- package/packtory/published-release-state.d.ts.map +1 -1
- package/packtory/resolved-package.d.ts +6 -0
- package/packtory/resolved-package.d.ts.map +1 -1
- package/packtory/scheduler.d.ts +41 -0
- package/packtory/scheduler.d.ts.map +1 -1
- package/progress/progress-broadcaster.d.ts +9 -0
- package/progress/progress-broadcaster.d.ts.map +1 -1
- package/published-package/published-package.d.ts +2 -0
- package/published-package/published-package.d.ts.map +1 -1
- package/report/aggregator/report-types.d.ts +21 -0
- package/report/aggregator/report-types.d.ts.map +1 -1
- package/report/preview/preview-document-diff.d.ts +5 -0
- package/report/preview/preview-document-diff.d.ts.map +1 -1
- package/report/release-diff/file-set-diff.d.ts +2 -0
- package/report/release-diff/file-set-diff.d.ts.map +1 -1
- package/resource-resolver/resolved-bundle.d.ts +14 -0
- package/resource-resolver/resolved-bundle.d.ts.map +1 -1
- package/resource-resolver/resource-resolve-options.d.ts +5 -0
- package/resource-resolver/resource-resolve-options.d.ts.map +1 -1
- package/resource-resolver/resource-resolver.d.ts +10 -0
- package/resource-resolver/resource-resolver.d.ts.map +1 -1
- package/sbom/license-resolver.d.ts +11 -0
- package/sbom/license-resolver.d.ts.map +1 -1
- package/sbom/sbom-file.d.ts +8 -0
- package/sbom/sbom-file.d.ts.map +1 -1
- package/sbom/sbom-serializer.d.ts +5 -0
- package/sbom/sbom-serializer.d.ts.map +1 -1
- package/sbom.cdx.json +5 -5
- package/tar/tarball-builder.d.ts +8 -0
- package/tar/tarball-builder.d.ts.map +1 -1
- package/vendor-materializer/vendor-entry.d.ts +9 -0
- package/vendor-materializer/vendor-entry.d.ts.map +1 -1
- package/vendor-materializer/vendor-materializer.d.ts +32 -0
- package/vendor-materializer/vendor-materializer.d.ts.map +1 -1
- package/version-manager/manager.d.ts +4 -0
- package/version-manager/manager.d.ts.map +1 -1
- package/version-manager/versioned-bundle.d.ts +2 -0
- package/version-manager/versioned-bundle.d.ts.map +1 -1
- package/zip/zip-builder.d.ts +17 -0
- package/zip/zip-builder.d.ts.map +1 -1
|
@@ -1,3 +1,29 @@
|
|
|
1
1
|
import { type SourceFile, type StringLiteral } from 'ts-morph';
|
|
2
|
+
export declare const moduleReferenceKind: {
|
|
3
|
+
readonly externalPackage: "external-package";
|
|
4
|
+
readonly generatedManifest: "generated-manifest";
|
|
5
|
+
readonly localAsset: "local-asset";
|
|
6
|
+
readonly localCode: "local-code";
|
|
7
|
+
};
|
|
8
|
+
type ExternalReference = {
|
|
9
|
+
readonly kind: typeof moduleReferenceKind.externalPackage;
|
|
10
|
+
readonly packageName: string;
|
|
11
|
+
};
|
|
12
|
+
type ManifestReference = {
|
|
13
|
+
readonly kind: typeof moduleReferenceKind.generatedManifest;
|
|
14
|
+
readonly filePath: string;
|
|
15
|
+
};
|
|
16
|
+
type AssetReference = {
|
|
17
|
+
readonly kind: typeof moduleReferenceKind.localAsset;
|
|
18
|
+
readonly filePath: string;
|
|
19
|
+
};
|
|
20
|
+
type CodeReference = {
|
|
21
|
+
readonly kind: typeof moduleReferenceKind.localCode;
|
|
22
|
+
readonly filePath: string;
|
|
23
|
+
};
|
|
24
|
+
export type ModuleReference = AssetReference | CodeReference | ExternalReference | ManifestReference;
|
|
25
|
+
export declare function resolveSourceFileForLiteral(literal: StringLiteral, containingSourceFile: Readonly<SourceFile>): Readonly<SourceFile | undefined>;
|
|
26
|
+
export declare function getImportMetaResolveLiterals(sourceFile: Readonly<SourceFile>): readonly StringLiteral[];
|
|
27
|
+
export declare function getReferencedModules(sourceFile: Readonly<SourceFile>, packageJsonPath: string): readonly Readonly<ModuleReference>[];
|
|
2
28
|
export {};
|
|
3
29
|
//# sourceMappingURL=source-file-references.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-file-references.d.ts","sourceRoot":"","sources":["../../../../source/dependency-scanner/source-file-references.ts"],"names":[],"mappings":"AAGA,OAAO,EAKH,KAAK,UAAU,EACf,KAAK,aAAa,EACrB,MAAM,UAAU"}
|
|
1
|
+
{"version":3,"file":"source-file-references.d.ts","sourceRoot":"","sources":["../../../../source/dependency-scanner/source-file-references.ts"],"names":[],"mappings":"AAGA,OAAO,EAKH,KAAK,UAAU,EACf,KAAK,aAAa,EACrB,MAAM,UAAU,CAAC;AAGlB,eAAO,MAAM,mBAAmB;;;;;CAKtB,CAAC;AAEX,KAAK,iBAAiB,GAAG;IACrB,QAAQ,CAAC,IAAI,EAAE,OAAO,mBAAmB,CAAC,eAAe,CAAC;IAC1D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACrB,QAAQ,CAAC,IAAI,EAAE,OAAO,mBAAmB,CAAC,iBAAiB,CAAC;IAC5D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,KAAK,cAAc,GAAG;IAClB,QAAQ,CAAC,IAAI,EAAE,OAAO,mBAAmB,CAAC,UAAU,CAAC;IACrD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,KAAK,aAAa,GAAG;IACjB,QAAQ,CAAC,IAAI,EAAE,OAAO,mBAAmB,CAAC,SAAS,CAAC;IACpD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG,aAAa,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;AA0FrG,wBAAgB,2BAA2B,CACvC,OAAO,EAAE,aAAa,EACtB,oBAAoB,EAAE,QAAQ,CAAC,UAAU,CAAC,GAC3C,QAAQ,CAAC,UAAU,GAAG,SAAS,CAAC,CAUlC;AA2FD,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,SAAS,aAAa,EAAE,CASvG;AAED,wBAAgB,oBAAoB,CAChC,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,EAChC,eAAe,EAAE,MAAM,GACxB,SAAS,QAAQ,CAAC,eAAe,CAAC,EAAE,CAgBtC"}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import { Maybe } from 'true-myth';
|
|
2
2
|
import type { FileManager } from '../file-manager/file-manager.ts';
|
|
3
|
+
export type SourceMapFileLocatorDependencies = {
|
|
4
|
+
readonly fileManager: FileManager;
|
|
5
|
+
};
|
|
6
|
+
export type SourceMapFileLocator = {
|
|
7
|
+
locate: (sourceFile: string, sourcesFolder: string) => Promise<Maybe<string>>;
|
|
8
|
+
};
|
|
9
|
+
export declare function createSourceMapFileLocator(dependencies: Readonly<SourceMapFileLocatorDependencies>): SourceMapFileLocator;
|
|
3
10
|
//# sourceMappingURL=source-map-file-locator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-map-file-locator.d.ts","sourceRoot":"","sources":["../../../../source/dependency-scanner/source-map-file-locator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW;
|
|
1
|
+
{"version":3,"file":"source-map-file-locator.d.ts","sourceRoot":"","sources":["../../../../source/dependency-scanner/source-map-file-locator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEnE,MAAM,MAAM,gCAAgC,GAAG;IAC3C,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAC/B,MAAM,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;CACjF,CAAC;AA8CF,wBAAgB,0BAA0B,CACtC,YAAY,EAAE,QAAQ,CAAC,gCAAgC,CAAC,GACzD,oBAAoB,CAiCtB"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import { type CompilerOptions } from 'ts-morph';
|
|
2
2
|
import type { MainPackageJson } from '../config/package-json.ts';
|
|
3
|
+
export type AnalyzationOptions = {
|
|
4
|
+
readonly resolveDeclarationFiles: boolean;
|
|
5
|
+
readonly mainPackageJson: MainPackageJson;
|
|
6
|
+
};
|
|
7
|
+
export declare function analyzationOptionsToCompilerOptions(options: AnalyzationOptions): CompilerOptions;
|
|
3
8
|
//# sourceMappingURL=typescript-compiler-options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-compiler-options.d.ts","sourceRoot":"","sources":["../../../../source/dependency-scanner/typescript-compiler-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,eAAe,EAAE,MAAM,UAAU;
|
|
1
|
+
{"version":3,"file":"typescript-compiler-options.d.ts","sourceRoot":"","sources":["../../../../source/dependency-scanner/typescript-compiler-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAClF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,MAAM,MAAM,kBAAkB,GAAG;IAC7B,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC;IAC1C,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;CAC7C,CAAC;AAEF,wBAAgB,mCAAmC,CAAC,OAAO,EAAE,kBAAkB,GAAG,eAAe,CAsBhG"}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
import type { FileSystemHost } from 'ts-morph';
|
|
2
2
|
import type { MainPackageJson } from '../config/package-json.ts';
|
|
3
|
+
export type FileSystemAdaptersDependencies = {
|
|
4
|
+
readonly fileSystemHost: FileSystemHost;
|
|
5
|
+
};
|
|
6
|
+
export type FileSystemAdapters = {
|
|
7
|
+
readonly fileSystemHostWithoutFilter: FileSystemHost;
|
|
8
|
+
readonly fileSystemHostFilteringDeclarationFiles: FileSystemHost;
|
|
9
|
+
readonly withVirtualPackageJson: (fileSystemHost: FileSystemHost, folder: string, mainPackageJson: MainPackageJson) => FileSystemHost;
|
|
10
|
+
};
|
|
11
|
+
export declare function createFileSystemAdapters(dependencies: FileSystemAdaptersDependencies): FileSystemAdapters;
|
|
3
12
|
//# sourceMappingURL=typescript-file-host.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-file-host.d.ts","sourceRoot":"","sources":["../../../../source/dependency-scanner/typescript-file-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU;
|
|
1
|
+
{"version":3,"file":"typescript-file-host.d.ts","sourceRoot":"","sources":["../../../../source/dependency-scanner/typescript-file-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAMjE,MAAM,MAAM,8BAA8B,GAAG;IACzC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC7B,QAAQ,CAAC,2BAA2B,EAAE,cAAc,CAAC;IACrD,QAAQ,CAAC,uCAAuC,EAAE,cAAc,CAAC;IACjE,QAAQ,CAAC,sBAAsB,EAAE,CAC7B,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,eAAe,KAC/B,cAAc,CAAC;CACvB,CAAC;AAgDF,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,8BAA8B,GAAG,kBAAkB,CAQzG"}
|
|
@@ -2,4 +2,18 @@ import type { Project as _Project, SourceFile } from 'ts-morph';
|
|
|
2
2
|
import type { ModuleReference } from './source-file-references.ts';
|
|
3
3
|
import { type AnalyzationOptions } from './typescript-compiler-options.ts';
|
|
4
4
|
import type { FileSystemAdapters } from './typescript-file-host.ts';
|
|
5
|
+
export type TypescriptProjectAnalyzerDependencies = {
|
|
6
|
+
readonly Project: typeof _Project;
|
|
7
|
+
readonly fileSystemAdapters: FileSystemAdapters;
|
|
8
|
+
getReferencedModules: (sourceFile: Readonly<SourceFile>, packageJsonPath: string) => readonly Readonly<ModuleReference>[];
|
|
9
|
+
};
|
|
10
|
+
export type TypescriptProject = {
|
|
11
|
+
getReferencedModules: (containingSourceFilePath: string) => readonly Readonly<ModuleReference>[];
|
|
12
|
+
getProject: () => _Project;
|
|
13
|
+
};
|
|
14
|
+
export type TypescriptProjectAnalyzer = {
|
|
15
|
+
analyzeProject: (folder: string, options: AnalyzationOptions) => TypescriptProject;
|
|
16
|
+
};
|
|
17
|
+
export declare function getSourcePathFromSourceFile(sourceFile: Readonly<SourceFile>): string;
|
|
18
|
+
export declare function createTypescriptProjectAnalyzer(dependencies: TypescriptProjectAnalyzerDependencies): TypescriptProjectAnalyzer;
|
|
5
19
|
//# sourceMappingURL=typescript-project-analyzer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-project-analyzer.d.ts","sourceRoot":"","sources":["../../../../source/dependency-scanner/typescript-project-analyzer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,IAAI,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU;
|
|
1
|
+
{"version":3,"file":"typescript-project-analyzer.d.ts","sourceRoot":"","sources":["../../../../source/dependency-scanner/typescript-project-analyzer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,IAAI,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAuC,KAAK,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAChH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,MAAM,MAAM,qCAAqC,GAAG;IAChD,QAAQ,CAAC,OAAO,EAAE,OAAO,QAAQ,CAAC;IAClC,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAChD,oBAAoB,EAAE,CAClB,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,EAChC,eAAe,EAAE,MAAM,KACtB,SAAS,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC5B,oBAAoB,EAAE,CAAC,wBAAwB,EAAE,MAAM,KAAK,SAAS,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;IACjG,UAAU,EAAE,MAAM,QAAQ,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACpC,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,KAAK,iBAAiB,CAAC;CACtF,CAAC;AAEF,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,MAAM,CAEpF;AAED,wBAAgB,+BAA+B,CAC3C,YAAY,EAAE,qCAAqC,GACpD,yBAAyB,CAsC3B"}
|
|
@@ -1,2 +1,29 @@
|
|
|
1
|
+
type GraphNodeId = number | string;
|
|
2
|
+
type GraphNode<TId extends GraphNodeId, TData> = {
|
|
3
|
+
readonly id: TId;
|
|
4
|
+
readonly data: TData;
|
|
5
|
+
readonly adjacentNodeIds: ReadonlySet<TId>;
|
|
6
|
+
readonly incomingEdges: number;
|
|
7
|
+
};
|
|
8
|
+
type GraphEdge<TId extends GraphNodeId> = {
|
|
9
|
+
readonly from: TId;
|
|
10
|
+
readonly to: TId;
|
|
11
|
+
};
|
|
12
|
+
type Visitor<TId extends GraphNodeId, TData> = (node: Readonly<GraphNode<TId, TData>>) => void;
|
|
13
|
+
export type DirectedGraph<TId extends GraphNodeId, TData> = {
|
|
14
|
+
addNode: (id: TId, data: TData) => void;
|
|
15
|
+
connect: (edge: Readonly<GraphEdge<TId>>) => void;
|
|
16
|
+
disconnect: (edge: Readonly<GraphEdge<TId>>) => void;
|
|
17
|
+
hasNode: (id: TId) => boolean;
|
|
18
|
+
hasConnection: (edge: Readonly<GraphEdge<TId>>) => boolean;
|
|
19
|
+
visitBreadthFirstSearch: (startId: TId, visitor: Visitor<TId, TData>) => void;
|
|
20
|
+
detectCycles: () => readonly (readonly TId[])[];
|
|
21
|
+
isCyclic: () => boolean;
|
|
22
|
+
getTopologicalGenerations: () => readonly (readonly TId[])[];
|
|
23
|
+
reverse: () => DirectedGraph<TId, TData>;
|
|
24
|
+
getAdjacentIds: (id: TId) => ReadonlySet<TId>;
|
|
25
|
+
traverse: (visitor: Visitor<TId, TData>) => void;
|
|
26
|
+
};
|
|
27
|
+
export declare function createDirectedGraph<TId extends GraphNodeId, TData>(): DirectedGraph<TId, TData>;
|
|
1
28
|
export {};
|
|
2
29
|
//# sourceMappingURL=graph.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../../source/directed-graph/graph.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../../source/directed-graph/graph.ts"],"names":[],"mappings":"AAEA,KAAK,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnC,KAAK,SAAS,CAAC,GAAG,SAAS,WAAW,EAAE,KAAK,IAAI;IAC7C,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC;IACjB,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,eAAe,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;IAC3C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAClC,CAAC;AAKF,KAAK,SAAS,CAAC,GAAG,SA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,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,IAAI,CAAC;CACpD,CAAC;AAoRF,wBAAgB,mBAAmB,CAAC,GAAG,SAAS,WAAW,EAAE,KAAK,KAAK,aAAa,CAAC,GAAG,EAAE,KAAK,CAAC,CA+E/F"}
|
|
@@ -9,5 +9,6 @@ export type TransferableFileDescription = BaseDescription & {
|
|
|
9
9
|
readonly sourceFilePath: string;
|
|
10
10
|
readonly targetFilePath: string;
|
|
11
11
|
};
|
|
12
|
+
export declare function createFileDescription(filePath: string, content?: string, isExecutable?: boolean): FileDescription;
|
|
12
13
|
export {};
|
|
13
14
|
//# sourceMappingURL=file-description.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-description.d.ts","sourceRoot":"","sources":["../../../../source/file-manager/file-description.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG;IACnB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;CAClC;
|
|
1
|
+
{"version":3,"file":"file-description.d.ts","sourceRoot":"","sources":["../../../../source/file-manager/file-description.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG;IACnB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG;IAC5C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,eAAe,GAAG;IACxD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACnC,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,SAAK,EAAE,YAAY,UAAQ,GAAG,eAAe,CAE3G"}
|
|
@@ -1,4 +1,29 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import type { TransferableFileDescription } from './file-description.ts';
|
|
3
|
+
export type FileManagerDependencies = {
|
|
4
|
+
readonly hostFileSystem: typeof fs.promises;
|
|
5
|
+
};
|
|
6
|
+
type FileOrFolderReadability = {
|
|
7
|
+
readonly isReadable: boolean;
|
|
8
|
+
};
|
|
9
|
+
type DirectoryEntry = {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly isDirectory: boolean;
|
|
12
|
+
readonly isSymbolicLink: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type FileManager = {
|
|
15
|
+
checkReadability: (fileOrFolderPath: string) => Promise<FileOrFolderReadability>;
|
|
16
|
+
readFile: (filePath: string) => Promise<string>;
|
|
17
|
+
readFileBytes: (filePath: string) => Promise<Buffer>;
|
|
18
|
+
writeFile: (filePath: string, content: string) => Promise<void>;
|
|
19
|
+
writeBinaryFile: (filePath: string, content: Buffer) => Promise<void>;
|
|
20
|
+
setExecutable: (filePath: string, executable: boolean) => Promise<void>;
|
|
21
|
+
copyFile: (from: string, to: string) => Promise<void>;
|
|
22
|
+
copyFileBytes: (from: string, to: string) => Promise<void>;
|
|
23
|
+
listDirectoryEntries: (directoryPath: string) => Promise<readonly DirectoryEntry[]>;
|
|
24
|
+
getRealPath: (filePath: string) => Promise<string>;
|
|
25
|
+
getTransferableFileDescriptionFromPath: (sourceFilePath: string, targetFilePath: string) => Promise<TransferableFileDescription>;
|
|
26
|
+
};
|
|
27
|
+
export declare function createFileManager(dependencies: FileManagerDependencies): FileManager;
|
|
3
28
|
export {};
|
|
4
29
|
//# sourceMappingURL=file-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-manager.d.ts","sourceRoot":"","sources":["../../../../source/file-manager/file-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS;
|
|
1
|
+
{"version":3,"file":"file-manager.d.ts","sourceRoot":"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AAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3D,oBAAoB,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,cAAc,EAAE,CAAC,CAAC;IACpF,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACnD,sCAAsC,EAAE,CACpC,cAAc,EAAE,MAAM,EACtB,cAAc,EAAE,MAAM,KACrB,OAAO,CAAC,2BAA2B,CAAC,CAAC;CAC7C,CAAC;AAKF,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,uBAAuB,GAAG,WAAW,CAkGpF"}
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
+
type GitCommandRunner = (command: string, commandArguments: readonly string[]) => Promise<{
|
|
2
|
+
readonly stdout: string;
|
|
3
|
+
readonly stderr: string;
|
|
4
|
+
}>;
|
|
5
|
+
export type CurrentGitHeadReader = () => Promise<string | undefined>;
|
|
6
|
+
type CurrentGitHeadReaderDependencies = {
|
|
7
|
+
readonly runGitCommand: GitCommandRunner;
|
|
8
|
+
readonly repositoryFolder: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function createCurrentGitHeadReader(dependencies: CurrentGitHeadReaderDependencies): CurrentGitHeadReader;
|
|
1
11
|
export {};
|
|
2
12
|
//# sourceMappingURL=current-git-head.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"current-git-head.d.ts","sourceRoot":"","sources":["../../../../source/git/current-git-head.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"current-git-head.d.ts","sourceRoot":"","sources":["../../../../source/git/current-git-head.ts"],"names":[],"mappings":"AAAA,KAAK,gBAAgB,GAAG,CACpB,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,SAAS,MAAM,EAAE,KAClC,OAAO,CAAC;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CAAE,CAAC,CAAC;AAEpE,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;AAMrE,KAAK,gCAAgC,GAAG;IACpC,QAAQ,CAAC,aAAa,EAAE,gBAAgB,CAAC;IACzC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACrC,CAAC;AA4BF,wBAAgB,0BAA0B,CAAC,YAAY,EAAE,gCAAgC,GAAG,oBAAoB,CAI/G"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ExternalDependencies } from '../dependency-scanner/external-dependencies.ts';
|
|
2
|
+
import type { SourceMapTransform } from '../dead-code-eliminator/transform/atom-translator.ts';
|
|
2
3
|
import type { PackageSurface } from '../package-surface/surface.ts';
|
|
3
4
|
import type { BundleResource, RootFileDescription } from '../resource-resolver/resolved-bundle.ts';
|
|
4
5
|
export type LinkedBundleResource = BundleResource & {
|
|
@@ -12,8 +13,17 @@ export type LinkedBundle = {
|
|
|
12
13
|
readonly exportPackageJson?: true | undefined;
|
|
13
14
|
readonly linkedBundleDependencies: ExternalDependencies;
|
|
14
15
|
readonly substitutedSourceFilePathsByPackageName: ReadonlyMap<string, ReadonlySet<string>>;
|
|
16
|
+
readonly sourceMapTransformsByTargetPath: ReadonlyMap<string, readonly SourceMapTransform[]>;
|
|
15
17
|
readonly externalDependencies: ExternalDependencies;
|
|
16
18
|
};
|
|
17
19
|
export type BundleSubstitutionSource = Pick<LinkedBundle, 'contents' | 'name' | 'roots' | 'surface'>;
|
|
20
|
+
type BundleWithContents<TResource extends {
|
|
21
|
+
readonly isSubstituted: boolean;
|
|
22
|
+
}> = {
|
|
23
|
+
readonly contents: readonly TResource[];
|
|
24
|
+
};
|
|
25
|
+
export declare function getSubstitutedResources<TResource extends {
|
|
26
|
+
readonly isSubstituted: boolean;
|
|
27
|
+
}>(bundle: BundleWithContents<TResource>): readonly TResource[];
|
|
18
28
|
export {};
|
|
19
29
|
//# sourceMappingURL=linked-bundle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linked-bundle.d.ts","sourceRoot":"","sources":["../../../../source/linker/linked-bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gDAAgD;
|
|
1
|
+
{"version":3,"file":"linked-bundle.d.ts","sourceRoot":"","sources":["../../../../source/linker/linked-bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AAC3F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAC/F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAEnG,MAAM,MAAM,oBAAoB,GAAG,cAAc,GAAG;IAChD,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACnD,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAC9D,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,wBAAwB,EAAE,oBAAoB,CAAC;IACxD,QAAQ,CAAC,uCAAuC,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3F,QAAQ,CAAC,+BAA+B,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,kBAAkB,EAAE,CAAC,CAAC;IAC7F,QAAQ,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;AACrG,KAAK,kBAAkB,CAAC,SAAS,SAAS;IAAE,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CAAE,IAAI;IAC9E,QAAQ,CAAC,QAAQ,EAAE,SAAS,SAAS,EAAE,CAAC;CAC3C,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,SAAS,SAAS;IAAE,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CAAE,EAC1F,MAAM,EAAE,kBAAkB,CAAC,SAAS,CAAC,GACtC,SAAS,SAAS,EAAE,CAItB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linked-bundle.js","sourceRoot":"","sources":["../../../../source/linker/linked-bundle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"linked-bundle.js","sourceRoot":"","sources":["../../../../source/linker/linked-bundle.ts"],"names":[],"mappings":"AA0BA,MAAM,UAAU,uBAAuB,CACnC,MAAqC;IAErC,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,QAAQ;QAC5C,OAAO,QAAQ,CAAC,aAAa,CAAC;IAClC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/linker/linker.d.ts
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { type ResolvedBundle } from '../resource-resolver/resolved-bundle.ts';
|
|
2
2
|
import type { BundleSubstitutionSource, LinkedBundle } from './linked-bundle.ts';
|
|
3
|
+
type LinkBundleOptions = {
|
|
4
|
+
readonly bundle: ResolvedBundle;
|
|
5
|
+
readonly bundleDependencies: readonly BundleSubstitutionSource[];
|
|
6
|
+
readonly bundlePeerDependencies: readonly BundleSubstitutionSource[];
|
|
7
|
+
};
|
|
8
|
+
export type BundleLinker = {
|
|
9
|
+
linkBundle: (options: LinkBundleOptions) => Promise<LinkedBundle>;
|
|
10
|
+
};
|
|
11
|
+
export declare function createBundleLinker(): BundleLinker;
|
|
3
12
|
export {};
|
|
4
13
|
//# sourceMappingURL=linker.d.ts.map
|
package/linker/linker.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linker.d.ts","sourceRoot":"","sources":["../../../../source/linker/linker.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,yCAAyC;
|
|
1
|
+
{"version":3,"file":"linker.d.ts","sourceRoot":"","sources":["../../../../source/linker/linker.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAGtG,OAAO,KAAK,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIjF,KAAK,iBAAiB,GAAG;IACrB,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,kBAAkB,EAAE,SAAS,wBAAwB,EAAE,CAAC;IACjE,QAAQ,CAAC,sBAAsB,EAAE,SAAS,wBAAwB,EAAE,CAAC;CACxE,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACvB,UAAU,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;CACrE,CAAC;AA4CF,wBAAgB,kBAAkB,IAAI,YAAY,CAiBjD"}
|
|
@@ -1,25 +1,67 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { buildLineIndex } from "../../dead-code-eliminator/transform/line-index.js";
|
|
2
|
+
import { getImportMetaResolveLiterals, resolveSourceFileForLiteral } from "../../dependency-scanner/source-file-references.js";
|
|
2
3
|
import { getSourcePathFromSourceFile } from "../../dependency-scanner/typescript-project-analyzer.js";
|
|
3
|
-
function
|
|
4
|
-
|
|
4
|
+
function collectImportPathEdits(sourceFile, replacements) {
|
|
5
|
+
const edits = [];
|
|
6
|
+
const literals = [
|
|
7
|
+
...sourceFile.getImportStringLiterals(),
|
|
8
|
+
...getImportMetaResolveLiterals(sourceFile)
|
|
9
|
+
];
|
|
10
|
+
for (const literal of literals) {
|
|
5
11
|
const resolvedSourceFile = resolveSourceFileForLiteral(literal, sourceFile);
|
|
6
12
|
if (resolvedSourceFile !== undefined) {
|
|
7
13
|
const replacement = replacements.get(getSourcePathFromSourceFile(resolvedSourceFile));
|
|
8
14
|
if (replacement !== undefined) {
|
|
9
|
-
literal.
|
|
15
|
+
edits.push([literal.getStart() + 1, literal.getEnd() - 1, replacement]);
|
|
10
16
|
}
|
|
11
17
|
}
|
|
12
18
|
}
|
|
19
|
+
return edits.toSorted(function (left, right) {
|
|
20
|
+
return left[0] - right[0];
|
|
21
|
+
});
|
|
13
22
|
}
|
|
14
|
-
|
|
23
|
+
function applyEdits(sourceContent, edits) {
|
|
24
|
+
let content = '';
|
|
25
|
+
let originalOffset = 0;
|
|
26
|
+
let transformedOffset = 0;
|
|
27
|
+
const atoms = [];
|
|
28
|
+
function appendEdit(edit) {
|
|
29
|
+
const [start, end, replacement] = edit;
|
|
30
|
+
content += sourceContent.slice(originalOffset, start) + replacement;
|
|
31
|
+
atoms.push({ originalStart: originalOffset, originalEnd: start, newStart: transformedOffset });
|
|
32
|
+
transformedOffset = content.length;
|
|
33
|
+
originalOffset = end;
|
|
34
|
+
}
|
|
35
|
+
for (const edit of edits) {
|
|
36
|
+
appendEdit(edit);
|
|
37
|
+
}
|
|
38
|
+
content += sourceContent.slice(originalOffset);
|
|
39
|
+
atoms.push({
|
|
40
|
+
originalStart: originalOffset,
|
|
41
|
+
originalEnd: sourceContent.length,
|
|
42
|
+
newStart: transformedOffset
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
content,
|
|
46
|
+
sourceMapTransform: {
|
|
47
|
+
originalLineIndex: buildLineIndex(sourceContent),
|
|
48
|
+
transformedLineIndex: buildLineIndex(content),
|
|
49
|
+
atoms
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export function replaceImportPathsWithTransform(project, sourceFilePath, sourceContent, replacements) {
|
|
15
54
|
if (project === undefined) {
|
|
16
|
-
return sourceContent;
|
|
55
|
+
return { content: sourceContent, sourceMapTransform: undefined };
|
|
17
56
|
}
|
|
18
57
|
const sourceFile = project.getSourceFile(sourceFilePath);
|
|
19
58
|
if (sourceFile === undefined) {
|
|
20
|
-
return sourceContent;
|
|
59
|
+
return { content: sourceContent, sourceMapTransform: undefined };
|
|
60
|
+
}
|
|
61
|
+
const edits = collectImportPathEdits(sourceFile, replacements);
|
|
62
|
+
if (edits.length === 0) {
|
|
63
|
+
return { content: sourceContent, sourceMapTransform: undefined };
|
|
21
64
|
}
|
|
22
|
-
|
|
23
|
-
return sourceFile.getFullText();
|
|
65
|
+
return applyEdits(sourceContent, edits);
|
|
24
66
|
}
|
|
25
67
|
//# sourceMappingURL=import-paths.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-paths.js","sourceRoot":"","sources":["../../../../../source/linker/source-modifier/import-paths.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"import-paths.js","sourceRoot":"","sources":["../../../../../source/linker/source-modifier/import-paths.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,oDAAoD,CAAC;AAEpF,OAAO,EACH,4BAA4B,EAC5B,2BAA2B,EAC9B,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,yDAAyD,CAAC;AAWtG,SAAS,sBAAsB,CAAC,UAAsB,EAAE,YAA0B;IAC9E,MAAM,KAAK,GAAkB,EAAE,CAAC;IAChC,MAAM,QAAQ,GAAG;QACb,GAAG,UAAU,CAAC,uBAAuB,EAAE;QACvC,GAAG,4BAA4B,CAAC,UAAU,CAAC;KAC9C,CAAC;IACF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE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PathsWithTransform } from "./source-modifier/import-paths.js";
|
|
3
3
|
import { createSubstitutedResourceGraph } from "./substituted-resource-graph.js";
|
|
4
4
|
function isSubstitutionSourcePath(sourceFilePath, substitutionSources) {
|
|
5
5
|
return substitutionSources.some(function (bundle) {
|
|
@@ -14,16 +14,20 @@ function recordUnreplacedConnections(outstandingConnections, fromNodeId, directD
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
function contentWithReplacements(node, replacements) {
|
|
17
|
-
return
|
|
17
|
+
return replaceImportPathsWithTransform(node.data.project, node.data.fileDescription.sourceFilePath, node.data.fileDescription.content, replacements.importPathReplacements);
|
|
18
18
|
}
|
|
19
19
|
function addNodeWithReplacements(substitutedGraph, node, replacements) {
|
|
20
20
|
const isSubstituted = replacements.importPathReplacements.size > 0;
|
|
21
|
-
const
|
|
21
|
+
const replacementResult = contentWithReplacements(node, replacements);
|
|
22
|
+
const sourceMapTransformsByTargetPath = replacementResult.sourceMapTransform === undefined
|
|
23
|
+
? new Map()
|
|
24
|
+
: new Map([[node.data.fileDescription.targetFilePath, [replacementResult.sourceMapTransform]]]);
|
|
22
25
|
substitutedGraph.add(node.id, {
|
|
23
|
-
fileDescription: { ...node.data.fileDescription, content },
|
|
26
|
+
fileDescription: { ...node.data.fileDescription, content: replacementResult.content },
|
|
24
27
|
externalDependencies: node.data.externalDependencies,
|
|
25
28
|
bundleDependencies: isSubstituted ? replacements.bundleDependencies : [],
|
|
26
29
|
substitutedSourceFilePathsByPackageName: replacements.substitutedSourceFilePathsByPackageName,
|
|
30
|
+
sourceMapTransformsByTargetPath,
|
|
27
31
|
isSubstituted,
|
|
28
32
|
isExplicitlyIncluded: node.data.isExplicitlyIncluded,
|
|
29
33
|
...node.data.isGeneratedManifest ? { isGeneratedManifest: true } : {}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"substitute-bundles.js","sourceRoot":"","sources":["../../../../source/linker/substitute-bundles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAqB,MAAM,yBAAyB,CAAC;AAErG,OAAO,
|
|
1
|
+
{"version":3,"file":"substitute-bundles.js","sourceRoot":"","sources":["../../../../source/linker/substitute-bundles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAqB,MAAM,yBAAyB,CAAC;AAErG,OAAO,EACH,+BAA+B,EAElC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,8BAA8B,EAAiC,MAAM,iCAAiC,CAAC;AAQhH,SAAS,wBAAwB,CAC7B,cAAsB,EACtB,mBAAwD;IAExD,OAAO,mBAAmB,CAAC,IAAI,CAAC,UAAU,MAAM;QAC5C,OAAO,cAAc,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACP,CAAC;AAED,SAAS,2BAA2B,CAChC,sBAAiD,EACjD,UAAkB,EAClB,kBAAqC,EACrC,aAAkE;IAElE,KAAK,MAAM,IAAI,IAAI,kBAAkB,EAAE,CAAC;QACpC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,sBAAsB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QAChE,CAAC;IACL,CAAC;AACL,CAAC;AAED,SAAS,uBAAuB,CAC5B,IAAuB,EACvB,YAA0B;IAE1B,OAAO,+BAA+B,CAClC,IAAI,CAAC,IAAI,CAAC,OAAO,EACjB,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,cAAc,EACxC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,EACjC,YAAY,CAAC,sBAAsB,CACtC,CAAC;AACN,CAAC;AAED,SAAS,uBAAuB,CAC5B,gBAA0C,EAC1C,IAAuB,EACvB,YAA0B;IAE1B,MAAM,aAAa,GAAG,YAAY,CAAC,sBAAsB,CAAC,IAAI,GAAG,CAAC,CAAC;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AO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;YACvB,OAAO;QACX,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACrB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,oBAAoB,IAAI,wBAAwB,CAAC,IAAI,CAAC,EAAE,EAAE,mBAAmB,CAAC,EAAE,CAAC;YAC5F,OAAO;QACX,CAAC;QAED,MAAM,kBAAkB,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC5D,MAAM,YAAY,GAAG,uBAAuB,CAAC,kBAAkB,EAAE,kBAAkB,EAAE,sBAAsB,CAAC,CAAC;QAC7G,2BAA2B,CACvB,sBAAsB,EACtB,IAAI,CAAC,EAAE,EACP,kBAAkB,EAClB,YAAY,CAAC,sBAAsB,CACtC,CAAC;QACF,uBAAuB,CAAC,gBAAgB,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;IAClE,CAAC;IAED,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IAEvC,KAAK,MAAM,UAAU,IAAI,sBAAsB,EAAE,CAAC;QAC9C,gBAAgB,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC5B,CAAC"}
|
|
@@ -32,10 +32,17 @@ function collectExternalDependencies(externalDependencies, dependencyNames, file
|
|
|
32
32
|
externalDependencies.set(externalDependencyName, addOrCreateReference(externalDependencyName, filePath, externalDependency));
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
+
function collectSourceMapTransforms(sourceMapTransformsByTargetPath, source) {
|
|
36
|
+
for (const [targetPath, transforms] of source) {
|
|
37
|
+
const existing = sourceMapTransformsByTargetPath.get(targetPath) ?? [];
|
|
38
|
+
sourceMapTransformsByTargetPath.set(targetPath, [...existing, ...transforms]);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
35
41
|
function createFlattenCollectors() {
|
|
36
42
|
const contents = [];
|
|
37
43
|
const linkedBundleDependencies = new Map();
|
|
38
44
|
const substitutedSourceFilePathsByPackageName = new Map();
|
|
45
|
+
const sourceMapTransformsByTargetPath = new Map();
|
|
39
46
|
const externalDependencies = new Map();
|
|
40
47
|
const visited = new Set();
|
|
41
48
|
function collect(filePath, data, directDependencies) {
|
|
@@ -54,6 +61,7 @@ function createFlattenCollectors() {
|
|
|
54
61
|
for (const [packageName, sourceFilePaths] of collectSubstitutedSourceFilePaths(substitutedSourceFilePathsByPackageName, data.substitutedSourceFilePathsByPackageName)) {
|
|
55
62
|
substitutedSourceFilePathsByPackageName.set(packageName, new Set(sourceFilePaths));
|
|
56
63
|
}
|
|
64
|
+
collectSourceMapTransforms(sourceMapTransformsByTargetPath, data.sourceMapTransformsByTargetPath);
|
|
57
65
|
collectExternalDependencies(externalDependencies, data.externalDependencies, filePath);
|
|
58
66
|
}
|
|
59
67
|
return {
|
|
@@ -61,6 +69,7 @@ function createFlattenCollectors() {
|
|
|
61
69
|
contents,
|
|
62
70
|
linkedBundleDependencies,
|
|
63
71
|
substitutedSourceFilePathsByPackageName,
|
|
72
|
+
sourceMapTransformsByTargetPath,
|
|
64
73
|
externalDependencies
|
|
65
74
|
};
|
|
66
75
|
}
|
|
@@ -77,7 +86,7 @@ export function createSubstitutedResourceGraph() {
|
|
|
77
86
|
graph.connect({ from: fromFilePath, to: toFilePath });
|
|
78
87
|
},
|
|
79
88
|
flatten(rootFilePaths) {
|
|
80
|
-
const { collect, contents, linkedBundleDependencies, substitutedSourceFilePathsByPackageName, externalDependencies } = createFlattenCollectors();
|
|
89
|
+
const { collect, contents, linkedBundleDependencies, substitutedSourceFilePathsByPackageName, sourceMapTransformsByTargetPath, externalDependencies } = createFlattenCollectors();
|
|
81
90
|
for (const rootFilePath of rootFilePaths) {
|
|
82
91
|
graph.visitBreadthFirstSearch(rootFilePath, function (node) {
|
|
83
92
|
collect(node.id, node.data, node.adjacentNodeIds);
|
|
@@ -94,6 +103,7 @@ export function createSubstitutedResourceGraph() {
|
|
|
94
103
|
contents,
|
|
95
104
|
linkedBundleDependencies,
|
|
96
105
|
substitutedSourceFilePathsByPackageName,
|
|
106
|
+
sourceMapTransformsByTargetPath,
|
|
97
107
|
externalDependencies
|
|
98
108
|
};
|
|
99
109
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"substituted-resource-graph.js","sourceRoot":"","sources":["../../../../source/linker/substituted-resource-graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"substituted-resource-graph.js","sourceRoot":"","sources":["../../../../source/linker/substituted-resource-graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAkBjE,SAAS,oBAAoB,CACzB,sBAA8B,EAC9B,SAAiB,EACjB,kBAAuC;IAEvC,IAAI,kBAAkB,KAAK,SAAS,EAAE,CAAC;QACnC,OAAO;YACH,IAAI,EAAE,sBAAsB;YAC5B,cAAc,EAAE,CAAE,SAAS,CAAE;SAChC,CAAC;IACN,CAAC;IAED,OAAO;QACH,IAAI,EAAE,sBAAsB;QAC5B,cAAc,EAAE,MAAM,CAAC,CAAE,GAAG,kBAAkB,CAAC,cAAc,EAAE,SAAS,CAAE,CAAC;KAC9E,CAAC;AACN,CAAC;AAyBD,SAAS,+BAA+B,CACpC,wBAAyD,EACzD,kBAAqC,EACrC,QAAgB;IAEhB,KAAK,MAAM,oBAAoB,IAAI,kBAAkB,EAAE,CAAC;QACpD,MAAM,gBAAgB,GAAG,wBAAwB,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;QAC5E,wBAAwB,CAAC,GAAG,CACxB,oBAAoB,EACpB,oBAAoB,CAAC,oBAAoB,EA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,kBAAkB,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;gBAC1D,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,kBAAkB,CAAC,CAAC;YAChD,CAAC;YAED,OAAO;gBACH,QAAQ;gBACR,wBAAwB;gBACxB,uCAAuC;gBACvC,+BAA+B;gBAC/B,oBAAoB;aACvB,CAAC;QACN,CAAC;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -4,5 +4,20 @@ import type { FileManager } from '../file-manager/file-manager.ts';
|
|
|
4
4
|
import type { ArtifactSourcePackage } from '../published-package/published-package.ts';
|
|
5
5
|
import type { VendorEntry } from '../vendor-materializer/vendor-entry.ts';
|
|
6
6
|
export type PackFormat = 'folder' | 'tar' | 'zip';
|
|
7
|
+
type PackOptions = {
|
|
8
|
+
readonly bundle: ArtifactSourcePackage;
|
|
9
|
+
readonly format: PackFormat;
|
|
10
|
+
readonly outputPath: string;
|
|
11
|
+
readonly vendorEntries: readonly VendorEntry[];
|
|
12
|
+
readonly extraFiles: readonly FileDescription[];
|
|
13
|
+
};
|
|
14
|
+
export type PackEmitter = {
|
|
15
|
+
pack: (options: PackOptions) => Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
export type PackEmitterDependencies = {
|
|
18
|
+
readonly artifactsBuilder: Pick<ArtifactsBuilder, 'buildFolder' | 'buildTarball' | 'buildZip'>;
|
|
19
|
+
readonly fileManager: Pick<FileManager, 'writeBinaryFile'>;
|
|
20
|
+
};
|
|
21
|
+
export declare function createPackEmitter(dependencies: PackEmitterDependencies): PackEmitter;
|
|
7
22
|
export {};
|
|
8
23
|
//# sourceMappingURL=pack-emitter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack-emitter.d.ts","sourceRoot":"","sources":["../../../../source/pack-emitter/pack-emitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC;
|
|
1
|
+
{"version":3,"file":"pack-emitter.d.ts","sourceRoot":"","sources":["../../../../source/pack-emitter/pack-emitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AACvF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAE1E,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,KAAK,CAAC;AAElD,KAAK,WAAW,GAAG;IACf,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/C,QAAQ,CAAC,UAAU,EAAE,SAAS,eAAe,EAAE,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACtB,IAAI,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IAClC,QAAQ,CAAC,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EAAE,aAAa,GAAG,cAAc,GAAG,UAAU,CAAC,CAAC;IAC/F,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;CAC9D,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,uBAAuB,GAAG,WAAW,CAuCpF"}
|
|
@@ -8,4 +8,6 @@ export type ExplicitPackageSurface = {
|
|
|
8
8
|
readonly packageInterface: PackageInterface;
|
|
9
9
|
};
|
|
10
10
|
export type PackageSurface = ExplicitPackageSurface | ImplicitPackageSurface;
|
|
11
|
+
export declare function implicitPackageSurface(defaultModuleRoot: string): ImplicitPackageSurface;
|
|
12
|
+
export declare function explicitPackageSurface(packageInterface: PackageInterface): ExplicitPackageSurface;
|
|
11
13
|
//# sourceMappingURL=surface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../../../source/package-surface/surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC;
|
|
1
|
+
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../../../source/package-surface/surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,MAAM,MAAM,sBAAsB,GAAG;IACjC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACjC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,sBAAsB,GAAG,sBAAsB,CAAC;AAE7E,wBAAgB,sBAAsB,CAAC,iBAAiB,EAAE,MAAM,GAAG,sBAAsB,CAKxF;AAED,wBAAgB,sBAAsB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,sBAAsB,CAKjG"}
|