@shuvi/compiler 1.0.0-rc.4 → 1.0.0-rc.7

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/lib/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import { transform, transformSync } from './swc';
2
+ export { transform, transformSync };
package/lib/index.js ADDED
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transformSync = exports.transform = void 0;
4
+ const swc_1 = require("./swc");
5
+ Object.defineProperty(exports, "transform", { enumerable: true, get: function () { return swc_1.transform; } });
6
+ Object.defineProperty(exports, "transformSync", { enumerable: true, get: function () { return swc_1.transformSync; } });
@@ -1,3 +1,5 @@
1
+ export function transform(src: any, options: any): Promise<any>;
2
+ export function transformSync(src: any, options: any): any;
1
3
  export function minify(src: any, opts: any): Promise<any>;
2
4
  export function minifySync(src: any, opts: any): any;
3
5
  export function bundle(options: any): Promise<any>;
package/lib/swc/index.js CHANGED
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.bundle = exports.minifySync = exports.minify = void 0;
12
+ exports.bundle = exports.minifySync = exports.minify = exports.transformSync = exports.transform = void 0;
13
13
  const fs = require('fs');
14
14
  const { platform, arch } = require('os');
15
15
  const path = require('path');
@@ -64,6 +64,7 @@ function transform(src, options) {
64
64
  return bindings.transform(isModule ? JSON.stringify(src) : src, isModule, toBuffer(options));
65
65
  });
66
66
  }
67
+ exports.transform = transform;
67
68
  function transformSync(src, options) {
68
69
  var _a, _b;
69
70
  const isModule = typeof src !== 'string' && !Buffer.isBuffer(src);
@@ -73,6 +74,7 @@ function transformSync(src, options) {
73
74
  }
74
75
  return bindings.transformSync(isModule ? JSON.stringify(src) : src, isModule, toBuffer(options));
75
76
  }
77
+ exports.transformSync = transformSync;
76
78
  function toBuffer(t) {
77
79
  return Buffer.from(JSON.stringify(t));
78
80
  }
@@ -92,5 +94,3 @@ function bundle(options) {
92
94
  });
93
95
  }
94
96
  exports.bundle = bundle;
95
- module.exports.transform = transform;
96
- module.exports.transformSync = transformSync;
package/package.json CHANGED
@@ -1,31 +1,27 @@
1
1
  {
2
2
  "name": "@shuvi/compiler",
3
- "version": "1.0.0-rc.4",
3
+ "version": "1.0.0-rc.7",
4
+ "main": "./lib/index.js",
5
+ "types": "./lib/index.d.js",
6
+ "files": [
7
+ "lib"
8
+ ],
4
9
  "scripts": {
5
10
  "dev": "tsc -p tsconfig.build.json -w",
6
11
  "prebuild": "rimraf lib",
7
12
  "build": "tsc -p tsconfig.build.json"
8
13
  },
9
- "files": [
10
- "lib"
11
- ],
12
- "exports": {
13
- "./swc": {
14
- "default": "./lib/swc/index.js",
15
- "types": "./lib/swc/index.d.ts"
16
- }
17
- },
18
14
  "optionalDependencies": {
19
- "@shuvi/swc-darwin-arm64": "1.0.0-rc.2",
20
- "@shuvi/swc-darwin-x64": "1.0.0-rc.2",
21
- "@shuvi/swc-linux-arm-gnueabihf": "1.0.0-rc.2",
22
- "@shuvi/swc-linux-arm64-gnu": "1.0.0-rc.2",
23
- "@shuvi/swc-linux-arm64-musl": "1.0.0-rc.2",
24
- "@shuvi/swc-linux-x64-gnu": "1.0.0-rc.2",
25
- "@shuvi/swc-linux-x64-musl": "1.0.0-rc.2",
26
- "@shuvi/swc-win32-arm64-msvc": "1.0.0-rc.2",
27
- "@shuvi/swc-win32-ia32-msvc": "1.0.0-rc.2",
28
- "@shuvi/swc-win32-x64-msvc": "1.0.0-rc.2"
15
+ "@shuvi/swc-darwin-arm64": "1.0.0-rc.3",
16
+ "@shuvi/swc-darwin-x64": "1.0.0-rc.3",
17
+ "@shuvi/swc-linux-arm-gnueabihf": "1.0.0-rc.3",
18
+ "@shuvi/swc-linux-arm64-gnu": "1.0.0-rc.3",
19
+ "@shuvi/swc-linux-arm64-musl": "1.0.0-rc.3",
20
+ "@shuvi/swc-linux-x64-gnu": "1.0.0-rc.3",
21
+ "@shuvi/swc-linux-x64-musl": "1.0.0-rc.3",
22
+ "@shuvi/swc-win32-arm64-msvc": "1.0.0-rc.3",
23
+ "@shuvi/swc-win32-ia32-msvc": "1.0.0-rc.3",
24
+ "@shuvi/swc-win32-x64-msvc": "1.0.0-rc.3"
29
25
  },
30
26
  "dependencies": {
31
27
  "@napi-rs/triples": "1.1.0"