@atlaspack/core 2.19.3-typescript-80839fbd5.0 → 2.19.3-typescript-c10a7ae7b.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/index.d.ts CHANGED
@@ -4,6 +4,8 @@ import type {
4
4
  BuildSuccessEvent,
5
5
  AsyncSubscription,
6
6
  } from '@atlaspack/types';
7
+ import type {Diagnostic} from '@atlaspack/diagnostic';
8
+ import type ThrowableDiagnostic from '@atlaspack/diagnostic';
7
9
 
8
10
  import type {FarmOptions} from '@atlaspack/workers';
9
11
 
@@ -17,6 +19,7 @@ export class Atlaspack {
17
19
  watch(
18
20
  cb?: (err: Error | null | undefined, buildEvent?: BuildEvent) => unknown,
19
21
  ): Promise<AsyncSubscription>;
22
+ _init(): Promise<void>;
20
23
  }
21
24
 
22
25
  export class Parcel {
@@ -25,6 +28,7 @@ export class Parcel {
25
28
  watch(
26
29
  cb?: (err: Error | null | undefined, buildEvent?: BuildEvent) => unknown,
27
30
  ): Promise<AsyncSubscription>;
31
+ _init(): Promise<void>;
28
32
  }
29
33
 
30
34
  export declare function createWorkerFarm(
@@ -32,3 +36,24 @@ export declare function createWorkerFarm(
32
36
  ): WorkerFarm;
33
37
 
34
38
  export default Atlaspack;
39
+
40
+ export type NapiWorkerPoolOptions = {
41
+ workerCount?: number;
42
+ };
43
+
44
+ export type Transferable = any;
45
+
46
+ export declare class NapiWorkerPool {
47
+ constructor(options?: NapiWorkerPoolOptions);
48
+ workerCount(): number;
49
+ getWorkers(): Promise<Array<Transferable>>;
50
+ shutdown(): void;
51
+ }
52
+
53
+ export declare class BuildError extends ThrowableDiagnostic {
54
+ constructor(diagnostic: Array<Diagnostic> | Diagnostic);
55
+ }
56
+
57
+ export const INTERNAL_TRANSFORM: symbol;
58
+ export const INTERNAL_RESOLVE: symbol;
59
+ export let WORKER_PATH: string;
@@ -25,6 +25,9 @@ var _BundleGraph = _interopRequireDefault(require("./BundleGraph"));
25
25
  var _Config = _interopRequireDefault(require("./public/Config"));
26
26
  var _RequestTracker = require("./RequestTracker");
27
27
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
28
+ // flow-to-ts helpers
29
+
30
+ // /flow-to-ts helpers
28
31
  // @ts-expect-error TS7034
29
32
  let coreRegistered;
30
33
  function registerCoreWithSerializer() {
package/lib/types.js CHANGED
@@ -4,6 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.SpecifierType = exports.Priority = exports.ExportsCondition = exports.BundleBehaviorNames = exports.BundleBehavior = void 0;
7
+ // flow-to-ts helpers
8
+
9
+ // /flow-to-ts helpers
10
+
7
11
  const SpecifierType = exports.SpecifierType = {
8
12
  esm: 0,
9
13
  commonjs: 1,
package/lib/utils.js CHANGED
@@ -37,6 +37,10 @@ function _utils() {
37
37
  }
38
38
  var _projectPath = require("./projectPath");
39
39
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
40
+ // flow-to-ts helpers
41
+
42
+ // /flow-to-ts helpers
43
+
40
44
  const base62 = (0, _baseX().default)('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');
41
45
  function getBundleGroupId(bundleGroup) {
42
46
  return 'bundle_group:' + bundleGroup.target.name + bundleGroup.entryAssetId;
package/lib/worker.js CHANGED
@@ -81,6 +81,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
81
81
 
82
82
  // register with serializer
83
83
 
84
+ // flow-to-ts helpers
85
+
86
+ // /flow-to-ts helpers
84
87
  // @ts-expect-error TS2339
85
88
  if (process.env.ATLASPACK_BUILD_REPL && process.browser) {
86
89
  /* eslint-disable import/no-extraneous-dependencies, monorepo/no-internal-import */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/core",
3
- "version": "2.19.3-typescript-80839fbd5.0",
3
+ "version": "2.19.3-typescript-c10a7ae7b.0",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -10,7 +10,7 @@
10
10
  "url": "https://github.com/atlassian-labs/atlaspack.git"
11
11
  },
12
12
  "main": "lib/index.js",
13
- "types": "src/index.ts",
13
+ "types": "index.d.ts",
14
14
  "source": "src/index.ts",
15
15
  "engines": {
16
16
  "node": ">= 16.0.0"
@@ -18,24 +18,25 @@
18
18
  "scripts": {
19
19
  "test": "mocha",
20
20
  "test-ci": "mocha",
21
+ "generate-ts": "tsc --emitDeclarationOnly",
21
22
  "check-ts": "tsc --noEmit"
22
23
  },
23
24
  "dependencies": {
24
- "@atlaspack/build-cache": "2.13.4-typescript-80839fbd5.0",
25
- "@atlaspack/cache": "3.2.16-typescript-80839fbd5.0",
26
- "@atlaspack/diagnostic": "2.14.2-typescript-80839fbd5.0",
27
- "@atlaspack/events": "2.14.2-typescript-80839fbd5.0",
28
- "@atlaspack/feature-flags": "2.19.3-typescript-80839fbd5.0",
29
- "@atlaspack/fs": "2.15.16-typescript-80839fbd5.0",
30
- "@atlaspack/graph": "3.5.10-typescript-80839fbd5.0",
31
- "@atlaspack/logger": "2.14.14-typescript-80839fbd5.0",
32
- "@atlaspack/package-manager": "2.14.21-typescript-80839fbd5.0",
33
- "@atlaspack/plugin": "2.14.21-typescript-80839fbd5.0",
34
- "@atlaspack/profiler": "2.14.18-typescript-80839fbd5.0",
35
- "@atlaspack/rust": "3.4.2-typescript-80839fbd5.0",
36
- "@atlaspack/types": "2.15.11-typescript-80839fbd5.0",
37
- "@atlaspack/utils": "2.17.3-typescript-80839fbd5.0",
38
- "@atlaspack/workers": "2.14.21-typescript-80839fbd5.0",
25
+ "@atlaspack/build-cache": "2.13.4-typescript-c10a7ae7b.0",
26
+ "@atlaspack/cache": "3.2.16-typescript-c10a7ae7b.0",
27
+ "@atlaspack/diagnostic": "2.14.2-typescript-c10a7ae7b.0",
28
+ "@atlaspack/events": "2.14.2-typescript-c10a7ae7b.0",
29
+ "@atlaspack/feature-flags": "2.19.3-typescript-c10a7ae7b.0",
30
+ "@atlaspack/fs": "2.15.16-typescript-c10a7ae7b.0",
31
+ "@atlaspack/graph": "3.5.10-typescript-c10a7ae7b.0",
32
+ "@atlaspack/logger": "2.14.14-typescript-c10a7ae7b.0",
33
+ "@atlaspack/package-manager": "2.14.21-typescript-c10a7ae7b.0",
34
+ "@atlaspack/plugin": "2.14.21-typescript-c10a7ae7b.0",
35
+ "@atlaspack/profiler": "2.14.18-typescript-c10a7ae7b.0",
36
+ "@atlaspack/rust": "3.4.2-typescript-c10a7ae7b.0",
37
+ "@atlaspack/types": "2.15.11-typescript-c10a7ae7b.0",
38
+ "@atlaspack/utils": "2.17.3-typescript-c10a7ae7b.0",
39
+ "@atlaspack/workers": "2.14.21-typescript-c10a7ae7b.0",
39
40
  "@mischnic/json-sourcemap": "^0.1.0",
40
41
  "@parcel/source-map": "^2.1.1",
41
42
  "base-x": "^3.0.8",
@@ -49,7 +50,7 @@
49
50
  "semver": "^7.5.2"
50
51
  },
51
52
  "devDependencies": {
52
- "@atlaspack/babel-register": "2.14.2-typescript-80839fbd5.0",
53
+ "@atlaspack/babel-register": "2.14.2-typescript-c10a7ae7b.0",
53
54
  "@types/node": ">= 18",
54
55
  "graphviz": "^0.0.9",
55
56
  "jest-diff": "*",
@@ -60,5 +61,5 @@
60
61
  "./src/serializerCore.js": "./src/serializerCore.browser.js"
61
62
  },
62
63
  "type": "commonjs",
63
- "gitHead": "80839fbd5c6d6668c2622849856a4b25601354a8"
64
+ "gitHead": "c10a7ae7b0dc2c79430506d16447ff9bb9966043"
64
65
  }
@@ -1,5 +1,3 @@
1
- import {Flow} from 'flow-to-typescript-codemod';
2
-
3
1
  import {registerSerializableClass} from '@atlaspack/build-cache';
4
2
  import {Graph} from '@atlaspack/graph';
5
3
 
@@ -11,6 +9,10 @@ import BundleGraph from './BundleGraph';
11
9
  import Config from './public/Config';
12
10
  import {RequestGraph} from './RequestTracker';
13
11
 
12
+ // flow-to-ts helpers
13
+ export type Class<T> = new (...args: any[]) => T;
14
+ // /flow-to-ts helpers
15
+
14
16
  // @ts-expect-error TS7034
15
17
  let coreRegistered;
16
18
  export function registerCoreWithSerializer() {
@@ -30,7 +32,7 @@ export function registerCoreWithSerializer() {
30
32
  Graph,
31
33
  AtlaspackConfig,
32
34
  RequestGraph,
33
- }) as Array<[string, Flow.Class<any>]>) {
35
+ }) as Array<[string, Class<any>]>) {
34
36
  registerSerializableClass(packageVersion + ':' + name, ctor);
35
37
  }
36
38
  coreRegistered = true;
package/src/types.ts CHANGED
@@ -1,5 +1,3 @@
1
- import {Flow} from 'flow-to-typescript-codemod';
2
-
3
1
  import type {ContentKey} from '@atlaspack/graph';
4
2
  import type {
5
3
  ASTGenerator,
@@ -36,6 +34,14 @@ import type {FeatureFlags} from '@atlaspack/feature-flags';
36
34
  import type {BackendType} from '@parcel/watcher';
37
35
  import type {EnvironmentRef} from './EnvironmentManager';
38
36
 
37
+ // flow-to-ts helpers
38
+ export type SetComplement<A, B extends A> = A extends B ? never : A;
39
+ export type Diff<T extends U, U extends object> = Pick<
40
+ T,
41
+ SetComplement<keyof T, keyof U>
42
+ >;
43
+ // /flow-to-ts helpers
44
+
39
45
  export type AtlaspackPluginNode = {
40
46
  packageName: PackageName;
41
47
  resolveFrom: ProjectPath;
@@ -431,9 +437,10 @@ export type AssetRequestInput = {
431
437
  };
432
438
 
433
439
  export type AssetRequestResult = Array<Asset>;
440
+
434
441
  // Asset group nodes are essentially used as placeholders for the results of an asset request
435
442
  export type AssetGroup = Partial<
436
- Flow.Diff<
443
+ Diff<
437
444
  AssetRequestInput,
438
445
  {
439
446
  optionsRef: SharedReference;
package/src/utils.ts CHANGED
@@ -1,5 +1,3 @@
1
- import {Flow} from 'flow-to-typescript-codemod';
2
-
3
1
  import type {
4
2
  FilePath,
5
3
  FileCreateInvalidation,
@@ -20,6 +18,14 @@ import baseX from 'base-x';
20
18
  import {hashObject} from '@atlaspack/utils';
21
19
  import {fromProjectPath, toProjectPath} from './projectPath';
22
20
 
21
+ // flow-to-ts helpers
22
+ export type SetComplement<A, B extends A> = A extends B ? never : A;
23
+ export type Diff<T extends U, U extends object> = Pick<
24
+ T,
25
+ SetComplement<keyof T, keyof U>
26
+ >;
27
+ // /flow-to-ts helpers
28
+
23
29
  const base62 = baseX(
24
30
  '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
25
31
  );
@@ -212,7 +218,7 @@ export function toInternalSymbols<
212
218
  {
213
219
  loc: InternalSourceLocation | null | undefined;
214
220
  } & Partial<
215
- Flow.Diff<
221
+ Diff<
216
222
  T,
217
223
  {
218
224
  loc: SourceLocation | null | undefined;
package/src/worker.ts CHANGED
@@ -1,5 +1,3 @@
1
- import {Flow} from 'flow-to-typescript-codemod';
2
-
3
1
  import type {
4
2
  Bundle,
5
3
  AtlaspackOptions,
@@ -33,6 +31,14 @@ import '@atlaspack/cache'; // register with serializer
33
31
  import '@atlaspack/package-manager';
34
32
  import '@atlaspack/fs';
35
33
 
34
+ // flow-to-ts helpers
35
+ export type SetComplement<A, B extends A> = A extends B ? never : A;
36
+ export type Diff<T extends U, U extends object> = Pick<
37
+ T,
38
+ SetComplement<keyof T, keyof U>
39
+ >;
40
+ // /flow-to-ts helpers
41
+
36
42
  // @ts-expect-error TS2339
37
43
  if (process.env.ATLASPACK_BUILD_REPL && process.browser) {
38
44
  /* eslint-disable import/no-extraneous-dependencies, monorepo/no-internal-import */
@@ -45,7 +51,7 @@ registerCoreWithSerializer();
45
51
 
46
52
  // Remove the workerApi type from the TransformationOpts and ValidationOpts types:
47
53
  // https://github.com/facebook/flow/issues/2835
48
- type WorkerTransformationOpts = Flow.Diff<
54
+ type WorkerTransformationOpts = Diff<
49
55
  TransformationOpts,
50
56
  {
51
57
  workerApi: unknown;
@@ -55,7 +61,7 @@ type WorkerTransformationOpts = Flow.Diff<
55
61
  optionsRef: SharedReference;
56
62
  configCachePath: string;
57
63
  };
58
- type WorkerValidationOpts = Flow.Diff<
64
+ type WorkerValidationOpts = Diff<
59
65
  // @ts-expect-error TS2344
60
66
  ValidationOpts,
61
67
  {