@atlaspack/transformer-pug 2.14.5-canary.138 → 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.
@@ -0,0 +1,3 @@
1
+ import { Transformer } from '@atlaspack/plugin';
2
+ declare const _default: Transformer<unknown>;
3
+ export default _default;
@@ -26,6 +26,7 @@ function _pug() {
26
26
  return data;
27
27
  }
28
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
+ // @ts-expect-error TS7016
29
30
  var _default = exports.default = new (_plugin().Transformer)({
30
31
  async loadConfig({
31
32
  config
@@ -44,13 +45,14 @@ var _default = exports.default = new (_plugin().Transformer)({
44
45
  basedir: _path().default.dirname(asset.filePath),
45
46
  filename: asset.filePath,
46
47
  ...pugConfig,
48
+ // @ts-expect-error TS2339
47
49
  pretty: pugConfig.pretty || false
48
50
  });
49
51
  for (let filePath of render.dependencies) {
50
52
  asset.invalidateOnFileChange(filePath);
51
53
  }
52
54
  asset.type = 'html';
53
- // $FlowFixMe
55
+ // @ts-expect-error TS2339
54
56
  asset.setCode(render(pugConfig.locals));
55
57
  return [asset];
56
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/transformer-pug",
3
- "version": "2.14.5-canary.138+eda07caaf",
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/PugTransformer.js",
13
- "source": "src/PugTransformer.js",
12
+ "main": "./lib/PugTransformer.js",
13
+ "source": "./src/PugTransformer.ts",
14
+ "types": "./lib/PugTransformer.d.ts",
14
15
  "engines": {
15
16
  "node": ">= 16.0.0"
16
17
  },
17
18
  "dependencies": {
18
- "@atlaspack/plugin": "2.14.5-canary.138+eda07caaf",
19
+ "@atlaspack/plugin": "2.14.5-canary.139+d2fd84977",
19
20
  "pug": "^3.0.2"
20
21
  },
21
22
  "type": "commonjs",
22
- "gitHead": "eda07caafd2ebb814bbdbfd0ec12fa63124e213f"
23
- }
23
+ "scripts": {
24
+ "check-ts": "tsc --emitDeclarationOnly --rootDir src"
25
+ },
26
+ "gitHead": "d2fd849770fe6305e9c694bd97b1bd905abd9d94"
27
+ }
@@ -1,10 +1,9 @@
1
- // @flow
2
-
3
1
  import path from 'path';
4
2
  import {Transformer} from '@atlaspack/plugin';
3
+ // @ts-expect-error TS7016
5
4
  import pug from 'pug';
6
5
 
7
- export default (new Transformer({
6
+ export default new Transformer({
8
7
  async loadConfig({config}) {
9
8
  let configFile = await config.getConfig([
10
9
  '.pugrc',
@@ -27,6 +26,7 @@ export default (new Transformer({
27
26
  basedir: path.dirname(asset.filePath),
28
27
  filename: asset.filePath,
29
28
  ...pugConfig,
29
+ // @ts-expect-error TS2339
30
30
  pretty: pugConfig.pretty || false,
31
31
  });
32
32
 
@@ -35,9 +35,9 @@ export default (new Transformer({
35
35
  }
36
36
 
37
37
  asset.type = 'html';
38
- // $FlowFixMe
38
+ // @ts-expect-error TS2339
39
39
  asset.setCode(render(pugConfig.locals));
40
40
 
41
41
  return [asset];
42
42
  },
43
- }): Transformer<mixed>);
43
+ }) as Transformer<unknown>;
package/tsconfig.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "../../../tsconfig.json",
3
+ "include": ["src"]
4
+ }