@atlaspack/reporter-conditional-manifest 2.14.5-canary.137 → 2.14.5-canary.139

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaspack/reporter-conditional-manifest
2
2
 
3
+ ## 2.15.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`069de47`](https://github.com/atlassian-labs/atlaspack/commit/069de478e64fb5889f6f2ce023eb510782767fbd)]:
8
+ - @atlaspack/feature-flags@2.20.0
9
+ - @atlaspack/plugin@2.14.21
10
+
3
11
  ## 2.15.2
4
12
 
5
13
  ### Patch Changes
@@ -0,0 +1,12 @@
1
+ import { Reporter } from '@atlaspack/plugin';
2
+ import type { Async, PluginLogger, PluginOptions, PluginTracer, ReporterEvent, FileSystem, FilePath } from '@atlaspack/types-internal';
3
+ export declare const manifestHashes: Map<FilePath, string>;
4
+ export declare const updateManifest: (outputFS: FileSystem, logger: PluginLogger, conditionalManifestFilename: FilePath, conditionalManifest: string) => Promise<void>;
5
+ export declare function report({ event, options, logger, }: {
6
+ event: ReporterEvent;
7
+ options: PluginOptions;
8
+ logger: PluginLogger;
9
+ tracer: PluginTracer;
10
+ }): Promise<Async<void>>;
11
+ declare const _default: Reporter;
12
+ export default _default;
@@ -53,6 +53,7 @@ async function report({
53
53
  const bundles = event.bundleGraph.getConditionalBundleMapping();
54
54
 
55
55
  // Replace bundles with file paths
56
+ // @ts-expect-error TS2304
56
57
  const mapBundles = bundles => bundles.map(bundle => (0, _path().relative)(bundle.target.distDir, bundle.filePath));
57
58
  const manifest = {};
58
59
  for (const conditions of bundles.values()) {
@@ -82,6 +83,8 @@ async function report({
82
83
  }
83
84
  }
84
85
  }
86
+
87
+ // @ts-expect-error TS2322
85
88
  var _default = exports.default = new (_plugin().Reporter)({
86
89
  report
87
90
  });
@@ -0,0 +1,6 @@
1
+ import type { PluginOptions } from '@atlaspack/types-internal';
2
+ type Config = {
3
+ filename: string;
4
+ };
5
+ export declare function getConfig({ env, inputFS, projectRoot, }: PluginOptions): Promise<Config>;
6
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/reporter-conditional-manifest",
3
- "version": "2.14.5-canary.137+069de478e",
3
+ "version": "2.14.5-canary.139+d2fd84977",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -9,16 +9,20 @@
9
9
  "type": "git",
10
10
  "url": "https://github.com/atlassian-labs/atlaspack.git"
11
11
  },
12
- "main": "lib/ConditionalManifestReporter.js",
13
- "source": "src/ConditionalManifestReporter.js",
12
+ "main": "./lib/ConditionalManifestReporter.js",
13
+ "source": "./src/ConditionalManifestReporter.ts",
14
+ "types": "./lib/ConditionalManifestReporter.d.ts",
14
15
  "engines": {
15
16
  "node": ">= 16.0.0"
16
17
  },
17
18
  "dependencies": {
18
- "@atlaspack/feature-flags": "2.14.1-canary.205+069de478e",
19
- "@atlaspack/plugin": "2.14.5-canary.137+069de478e",
19
+ "@atlaspack/feature-flags": "2.14.1-canary.207+d2fd84977",
20
+ "@atlaspack/plugin": "2.14.5-canary.139+d2fd84977",
20
21
  "nullthrows": "^1.1.1"
21
22
  },
22
23
  "type": "commonjs",
23
- "gitHead": "069de478e64fb5889f6f2ce023eb510782767fbd"
24
- }
24
+ "scripts": {
25
+ "check-ts": "tsc --emitDeclarationOnly --rootDir src"
26
+ },
27
+ "gitHead": "d2fd849770fe6305e9c694bd97b1bd905abd9d94"
28
+ }
@@ -1,4 +1,3 @@
1
- // @flow strict-local
2
1
  import {relative, join, dirname} from 'path';
3
2
  import crypto from 'crypto';
4
3
  import {Reporter} from '@atlaspack/plugin';
@@ -44,20 +43,21 @@ export async function report({
44
43
  event,
45
44
  options,
46
45
  logger,
47
- }: {|
48
- event: ReporterEvent,
49
- options: PluginOptions,
50
- logger: PluginLogger,
51
- tracer: PluginTracer,
52
- |}): Async<void> {
46
+ }: {
47
+ event: ReporterEvent;
48
+ options: PluginOptions;
49
+ logger: PluginLogger;
50
+ tracer: PluginTracer;
51
+ }): Promise<Async<void>> {
53
52
  if (event.type === 'buildSuccess') {
54
53
  const bundles = event.bundleGraph.getConditionalBundleMapping();
55
54
 
56
55
  // Replace bundles with file paths
57
- const mapBundles = (bundles) =>
56
+ // @ts-expect-error TS2304
57
+ const mapBundles = (bundles: Array<PackagedBundle>) =>
58
58
  bundles.map((bundle) => relative(bundle.target.distDir, bundle.filePath));
59
59
 
60
- const manifest = {};
60
+ const manifest: Record<string, any> = {};
61
61
  for (const conditions of bundles.values()) {
62
62
  for (const [key, cond] of conditions) {
63
63
  const bundle = cond.bundle;
@@ -108,4 +108,5 @@ export async function report({
108
108
  }
109
109
  }
110
110
 
111
- export default (new Reporter({report}): Reporter);
111
+ // @ts-expect-error TS2322
112
+ export default new Reporter({report}) as Reporter;
@@ -1,10 +1,9 @@
1
- // @flow strict-local
2
1
  import {join} from 'path';
3
2
  import type {PluginOptions} from '@atlaspack/types-internal';
4
3
 
5
- type Config = {|
6
- filename: string,
7
- |};
4
+ type Config = {
5
+ filename: string;
6
+ };
8
7
 
9
8
  export async function getConfig({
10
9
  env,
@@ -1,4 +1,3 @@
1
- // @flow strict-local
2
1
  import {
3
2
  manifestHashes,
4
3
  updateManifest,
@@ -1,4 +1,3 @@
1
- // @flow strict-local
2
1
  import type {PluginOptions, EnvMap} from '@atlaspack/types-internal';
3
2
 
4
3
  import {NodePackageManager} from '@atlaspack/package-manager';
@@ -7,7 +6,7 @@ import {overlayFS, fsFixture} from '@atlaspack/test-utils';
7
6
  import assert from 'assert';
8
7
  import {DEFAULT_FEATURE_FLAGS} from '@atlaspack/feature-flags';
9
8
 
10
- function getPluginOptions({env}: {env?: EnvMap, ...}): PluginOptions {
9
+ function getPluginOptions({env}: {env?: EnvMap}): PluginOptions {
11
10
  return {
12
11
  mode: 'development',
13
12
  parcelVersion: 'version',
package/tsconfig.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "../../../tsconfig.json",
3
+ "include": ["src"]
4
+ }