@parcel/rust 2.14.5-canary.3441 → 2.14.5-canary.3442

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/index.js.flow CHANGED
@@ -1,5 +1,6 @@
1
1
  // @flow
2
- import type {FileCreateInvalidation, DependencyPriority, JSONObject} from '@parcel/types';
2
+ import type {FileCreateInvalidation, SpecifierType, DependencyPriority, EnvironmentContext, JSONObject, SourceLocation, OutputFormat, SourceType} from '@parcel/types';
3
+ import type {Diagnostic} from '@parcel/diagnostic';
3
4
 
4
5
  declare export var init: void | (() => void);
5
6
 
@@ -91,43 +92,50 @@ declare export class Resolver {
91
92
 
92
93
  export interface TransformHtmlOpts {
93
94
  code: Buffer,
94
- scope_hoist: boolean,
95
- supports_esm: boolean,
95
+ filePath: string,
96
+ env: RustEnvironment,
96
97
  hmr: boolean
97
98
  }
98
99
 
99
100
  export interface TransformHtmlResult {
100
101
  code: Buffer,
101
- dependencies: HtmlDependency[],
102
- assets: HtmlAsset[],
103
- errors: HtmlError[]
102
+ dependencies: RustDependency[],
103
+ assets: RustAsset[],
104
+ errors: Diagnostic[]
104
105
  }
105
106
 
106
- export interface HtmlDependency {
107
- href: string,
108
- needsStableName: boolean,
107
+ export interface RustEnvironment {
108
+ context: EnvironmentContext,
109
+ outputFormat: OutputFormat,
110
+ sourceType: SourceType,
111
+ flags: number,
112
+ sourceMap: ?any,
113
+ loc: ?SourceLocation,
114
+ includeNodeModules: any,
115
+ engines: any
116
+ }
117
+
118
+ export interface RustDependency {
119
+ specifier: string,
120
+ specifierType: SpecifierType,
121
+ flags: number,
109
122
  priority: DependencyPriority,
110
- outputFormat: 'none' | 'global' | 'esmodule',
111
- sourceType: 'none' | 'module' | 'script',
112
123
  bundleBehavior: 'none' | 'isolated' | 'inline',
113
- placeholder: string,
114
- line: number
124
+ env: RustEnvironment,
125
+ loc: ?SourceLocation,
126
+ placeholder: ?string,
127
+ resolveFrom: ?string,
128
+ range: ?string
115
129
  }
116
130
 
117
- export interface HtmlAsset {
131
+ export interface RustAsset {
132
+ loc: ?SourceLocation,
118
133
  type: string,
119
134
  content: Buffer,
120
- key: string,
121
- isAttr: boolean,
122
- outputFormat: 'none' | 'global' | 'esmodule',
123
- sourceType: 'none' | 'module' | 'script',
124
- bundleBehavior: 'none' | 'isolated' | 'inline',
125
- line: number
126
- }
127
-
128
- export interface HtmlError {
129
- message: string,
130
- line: number
135
+ env: RustEnvironment,
136
+ uniqueKey: string,
137
+ flags: number,
138
+ bundleBehavior: 'none' | 'isolated' | 'inline'
131
139
  }
132
140
 
133
141
  export interface PackageHtmlOpts {
package/lib/index.js ADDED
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _index = require("../index");
7
+ Object.keys(_index).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _index[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _index[key];
14
+ }
15
+ });
16
+ });
17
+ var _utils = require("./utils");
18
+ Object.keys(_utils).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _utils[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _utils[key];
25
+ }
26
+ });
27
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcel/rust",
3
- "version": "2.14.5-canary.3441+d0c8ddd99",
3
+ "version": "2.14.5-canary.3442+914335c16",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -13,8 +13,9 @@
13
13
  "type": "git",
14
14
  "url": "https://github.com/parcel-bundler/parcel.git"
15
15
  },
16
- "main": "index.js",
17
- "browser": "browser.js",
16
+ "source": "src/index.js",
17
+ "main": "lib/index.js",
18
+ "browser": "src/browser.js",
18
19
  "napi": {
19
20
  "name": "parcel-node-bindings"
20
21
  },
@@ -48,5 +49,5 @@
48
49
  "wasm:build": "cargo build -p parcel-node-bindings --target wasm32-unknown-unknown && cp ../../../target/wasm32-unknown-unknown/debug/parcel_node_bindings.wasm .",
49
50
  "wasm:build-release": "CARGO_PROFILE_RELEASE_LTO=true cargo build -p parcel-node-bindings --target wasm32-unknown-unknown --release && wasm-opt --strip-debug -O ../../../target/wasm32-unknown-unknown/release/parcel_node_bindings.wasm -o parcel_node_bindings.wasm"
50
51
  },
51
- "gitHead": "d0c8ddd99d1937e8e1d13043684a8a10617187a6"
52
+ "gitHead": "914335c16417ca54c31cda5875000fd5ea7c26a6"
52
53
  }
@@ -1,4 +1,5 @@
1
1
  const {Environment, napi} = require('napi-wasm');
2
+ const utils = require('./utils');
2
3
 
3
4
  let env;
4
5
  module.exports.init = async function init(input) {
@@ -50,5 +51,6 @@ module.exports.init = async function init(input) {
50
51
  };
51
52
  };
52
53
 
54
+ Object.assign(module.exports, utils);
53
55
  env.exports.initPanicHook();
54
56
  };