@atlaspack/transformer-glsl 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;
@@ -40,6 +40,8 @@ function _glslifyBundle() {
40
40
  return data;
41
41
  }
42
42
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
43
+ // @ts-expect-error TS7016
44
+ // @ts-expect-error TS7016
43
45
  var _default = exports.default = new (_plugin().Transformer)({
44
46
  async transform({
45
47
  asset,
@@ -49,6 +51,7 @@ var _default = exports.default = new (_plugin().Transformer)({
49
51
  let cwd = _path().default.dirname(asset.filePath);
50
52
  let depper = (0, _glslifyDeps().default)({
51
53
  cwd,
54
+ // @ts-expect-error TS7006
52
55
  resolve: async (target, opts, next) => {
53
56
  try {
54
57
  let filePath = await resolve(_path().default.join(opts.basedir, 'index.glsl'), target);
@@ -67,7 +70,7 @@ var _default = exports.default = new (_plugin().Transformer)({
67
70
  asset.type = 'js';
68
71
  return [asset];
69
72
  }
70
- });
73
+ }); // @ts-expect-error TS2304
71
74
  function collectDependencies(asset, ast) {
72
75
  for (let dep of ast) {
73
76
  if (!dep.entry) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/transformer-glsl",
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,16 +9,20 @@
9
9
  "type": "git",
10
10
  "url": "https://github.com/atlassian-labs/atlaspack.git"
11
11
  },
12
- "main": "lib/GLSLTransformer.js",
13
- "source": "src/GLSLTransformer.js",
12
+ "main": "./lib/GLSLTransformer.js",
13
+ "source": "./src/GLSLTransformer.ts",
14
+ "types": "./lib/GLSLTransformer.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
  "glslify-bundle": "^5.1.1",
20
21
  "glslify-deps": "^1.3.2"
21
22
  },
22
23
  "type": "commonjs",
23
- "gitHead": "eda07caafd2ebb814bbdbfd0ec12fa63124e213f"
24
- }
24
+ "scripts": {
25
+ "check-ts": "tsc --emitDeclarationOnly --rootDir src"
26
+ },
27
+ "gitHead": "d2fd849770fe6305e9c694bd97b1bd905abd9d94"
28
+ }
@@ -1,16 +1,18 @@
1
- // @flow
2
1
  import path from 'path';
3
2
  import {promisify} from 'util';
4
3
  import {Transformer} from '@atlaspack/plugin';
4
+ // @ts-expect-error TS7016
5
5
  import glslifyDeps from 'glslify-deps';
6
+ // @ts-expect-error TS7016
6
7
  import glslifyBundle from 'glslify-bundle';
7
8
 
8
- export default (new Transformer({
9
+ export default new Transformer({
9
10
  async transform({asset, resolve}) {
10
11
  // Parse and collect dependencies with glslify-deps
11
12
  let cwd = path.dirname(asset.filePath);
12
13
  let depper = glslifyDeps({
13
14
  cwd,
15
+ // @ts-expect-error TS7006
14
16
  resolve: async (target, opts, next) => {
15
17
  try {
16
18
  let filePath = await resolve(
@@ -19,7 +21,7 @@ export default (new Transformer({
19
21
  );
20
22
 
21
23
  next(null, filePath);
22
- } catch (err) {
24
+ } catch (err: any) {
23
25
  next(err);
24
26
  }
25
27
  },
@@ -40,9 +42,10 @@ export default (new Transformer({
40
42
 
41
43
  return [asset];
42
44
  },
43
- }): Transformer<mixed>);
45
+ }) as Transformer<unknown>;
44
46
 
45
- function collectDependencies(asset, ast) {
47
+ // @ts-expect-error TS2304
48
+ function collectDependencies(asset: MutableAsset, ast: any) {
46
49
  for (let dep of ast) {
47
50
  if (!dep.entry) {
48
51
  asset.invalidateOnFileChange(dep.file);
package/tsconfig.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "../../../tsconfig.json",
3
+ "include": ["src"]
4
+ }