@atlaspack/transformer-webmanifest 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/transformer-webmanifest
2
2
 
3
+ ## 2.14.21
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies []:
8
+ - @atlaspack/utils@2.17.3
9
+ - @atlaspack/plugin@2.14.21
10
+
3
11
  ## 2.14.20
4
12
 
5
13
  ### Patch Changes
@@ -0,0 +1,3 @@
1
+ import { Transformer } from '@atlaspack/plugin';
2
+ declare const _default: Transformer<unknown>;
3
+ export default _default;
@@ -41,6 +41,7 @@ function _utils() {
41
41
  }
42
42
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
43
43
  // https://developer.mozilla.org/en-US/docs/Web/Manifest
44
+
44
45
  const RESOURCES_SCHEMA = {
45
46
  type: 'array',
46
47
  items: {
@@ -48,6 +49,7 @@ const RESOURCES_SCHEMA = {
48
49
  properties: {
49
50
  src: {
50
51
  type: 'string',
52
+ // @ts-expect-error TS7006
51
53
  __validate: s => {
52
54
  if (s.length === 0) {
53
55
  return 'Must not be empty';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/transformer-webmanifest",
3
- "version": "2.14.5-canary.137+069de478e",
3
+ "version": "2.14.5-canary.139+d2fd84977",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -9,15 +9,19 @@
9
9
  "type": "git",
10
10
  "url": "https://github.com/atlassian-labs/atlaspack.git"
11
11
  },
12
- "main": "lib/WebManifestTransformer.js",
13
- "source": "src/WebManifestTransformer.js",
12
+ "main": "./lib/WebManifestTransformer.js",
13
+ "source": "./src/WebManifestTransformer.ts",
14
+ "types": "./lib/WebManifestTransformer.d.ts",
14
15
  "engines": {},
15
16
  "dependencies": {
16
- "@atlaspack/diagnostic": "2.14.1-canary.205+069de478e",
17
- "@atlaspack/plugin": "2.14.5-canary.137+069de478e",
18
- "@atlaspack/utils": "2.14.5-canary.137+069de478e",
17
+ "@atlaspack/diagnostic": "2.14.1-canary.207+d2fd84977",
18
+ "@atlaspack/plugin": "2.14.5-canary.139+d2fd84977",
19
+ "@atlaspack/utils": "2.14.5-canary.139+d2fd84977",
19
20
  "@mischnic/json-sourcemap": "^0.1.0"
20
21
  },
21
22
  "type": "commonjs",
22
- "gitHead": "069de478e64fb5889f6f2ce023eb510782767fbd"
23
- }
23
+ "scripts": {
24
+ "check-ts": "tsc --emitDeclarationOnly --rootDir src"
25
+ },
26
+ "gitHead": "d2fd849770fe6305e9c694bd97b1bd905abd9d94"
27
+ }
@@ -1,4 +1,3 @@
1
- // @flow
2
1
  // https://developer.mozilla.org/en-US/docs/Web/Manifest
3
2
  import type {SchemaEntity} from '@atlaspack/utils';
4
3
 
@@ -15,6 +14,7 @@ const RESOURCES_SCHEMA = {
15
14
  properties: {
16
15
  src: {
17
16
  type: 'string',
17
+ // @ts-expect-error TS7006
18
18
  __validate: (s) => {
19
19
  if (s.length === 0) {
20
20
  return 'Must not be empty';
@@ -24,7 +24,7 @@ const RESOURCES_SCHEMA = {
24
24
  },
25
25
  required: ['src'],
26
26
  },
27
- };
27
+ } as const;
28
28
  const MANIFEST_SCHEMA: SchemaEntity = {
29
29
  type: 'object',
30
30
  properties: {
@@ -51,7 +51,7 @@ const MANIFEST_SCHEMA: SchemaEntity = {
51
51
  },
52
52
  };
53
53
 
54
- export default (new Transformer({
54
+ export default new Transformer({
55
55
  async transform({asset}) {
56
56
  const source = await asset.getCode();
57
57
  const {data, pointers} = parse(source);
@@ -63,7 +63,7 @@ export default (new Transformer({
63
63
  'Invalid webmanifest',
64
64
  );
65
65
 
66
- function addResourceListToAsset(list, parent) {
66
+ function addResourceListToAsset(list: any, parent: string) {
67
67
  if (list) {
68
68
  invariant(Array.isArray(list));
69
69
  for (let i = 0; i < list.length; i++) {
@@ -101,4 +101,4 @@ export default (new Transformer({
101
101
  asset.setCode(JSON.stringify(data));
102
102
  return [asset];
103
103
  },
104
- }): Transformer<mixed>);
104
+ }) as Transformer<unknown>;
package/tsconfig.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "../../../tsconfig.json",
3
+ "include": ["src"]
4
+ }