@parcel/rust 2.12.1-dev.3171 → 2.12.1-dev.3238
Sign up to get free protection for your applications and to get access to all the features.
- package/index.d.ts +25 -6
- package/index.js +2 -3
- package/index.js.flow +49 -28
- package/lib/index.js +27 -0
- package/package.json +7 -5
- package/parcel-node-bindings.darwin-arm64.node +0 -0
- package/parcel-node-bindings.darwin-x64.node +0 -0
- package/parcel-node-bindings.linux-arm-gnueabihf.node +0 -0
- package/parcel-node-bindings.linux-arm64-gnu.node +0 -0
- package/parcel-node-bindings.linux-arm64-musl.node +0 -0
- package/parcel-node-bindings.linux-x64-gnu.node +0 -0
- package/parcel-node-bindings.linux-x64-musl.node +0 -0
- package/parcel-node-bindings.win32-x64-msvc.node +0 -0
package/index.d.ts
CHANGED
@@ -7,6 +7,9 @@ export interface JsMacroError {
|
|
7
7
|
kind: number
|
8
8
|
message: string
|
9
9
|
}
|
10
|
+
export interface SerializedParcelDb {
|
11
|
+
id: bigint
|
12
|
+
}
|
10
13
|
export function findAncestorFile(filenames: Array<string>, from: string, root: string): string | null
|
11
14
|
export function findFirstFile(names: Array<string>): string | null
|
12
15
|
export function findNodeModule(module: string, from: string): string | null
|
@@ -18,11 +21,11 @@ export interface JsFileSystemOptions {
|
|
18
21
|
read: (...args: any[]) => any
|
19
22
|
isFile: (...args: any[]) => any
|
20
23
|
isDir: (...args: any[]) => any
|
21
|
-
includeNodeModules?:
|
24
|
+
includeNodeModules?: boolean | Array<string> | Record<string, boolean>
|
22
25
|
}
|
23
26
|
export interface FileSystem {
|
24
27
|
fs?: JsFileSystemOptions
|
25
|
-
includeNodeModules?:
|
28
|
+
includeNodeModules?: boolean | Array<string> | Record<string, boolean>
|
26
29
|
conditions?: number
|
27
30
|
moduleDirResolver?: (...args: any[]) => any
|
28
31
|
mode: number
|
@@ -61,10 +64,26 @@ export interface JsInvalidations {
|
|
61
64
|
invalidateOnFileCreate: Array<FilePathCreateInvalidation | FileNameCreateInvalidation | GlobCreateInvalidation>
|
62
65
|
invalidateOnStartup: boolean
|
63
66
|
}
|
64
|
-
export function transform(opts: object): unknown
|
65
|
-
export function transformAsync(opts: object): object
|
66
|
-
export
|
67
|
-
export
|
67
|
+
export function transform(db: ParcelDb, opts: object): unknown
|
68
|
+
export function transformAsync(db: ParcelDb, opts: object): object
|
69
|
+
export type JsParcelDb = ParcelDb
|
70
|
+
export class ParcelDb {
|
71
|
+
constructor(options: object)
|
72
|
+
serialize(): SerializedParcelDb
|
73
|
+
static deserializeNative(value: SerializedParcelDb): JsParcelDb
|
74
|
+
getPage(page: number): Buffer
|
75
|
+
alloc(typeId: number): number
|
76
|
+
dealloc(typeId: number, addr: number): void
|
77
|
+
readString(addr: number): string
|
78
|
+
getStringId(s: string): number
|
79
|
+
extendVec(typeId: number, addr: number, count: number): void
|
80
|
+
createEnvironment(addr: number): number
|
81
|
+
createTarget(addr: number): number
|
82
|
+
write(filename: string): void
|
83
|
+
toBuffer(): Buffer
|
84
|
+
static _read(filename: string, options: object): JsParcelDb
|
85
|
+
static _fromBuffer(buf: Buffer, options: object): JsParcelDb
|
86
|
+
}
|
68
87
|
export class Hash {
|
69
88
|
constructor()
|
70
89
|
writeString(s: string): void
|
package/index.js
CHANGED
@@ -295,8 +295,9 @@ if (!nativeBinding) {
|
|
295
295
|
throw new Error(`Failed to load native binding`)
|
296
296
|
}
|
297
297
|
|
298
|
-
const { findAncestorFile, findFirstFile, findNodeModule, hashString, hashBuffer, Hash, optimizeImage, Resolver, transform, transformAsync
|
298
|
+
const { ParcelDb, findAncestorFile, findFirstFile, findNodeModule, hashString, hashBuffer, Hash, optimizeImage, Resolver, transform, transformAsync } = nativeBinding
|
299
299
|
|
300
|
+
module.exports.ParcelDb = ParcelDb
|
300
301
|
module.exports.findAncestorFile = findAncestorFile
|
301
302
|
module.exports.findFirstFile = findFirstFile
|
302
303
|
module.exports.findNodeModule = findNodeModule
|
@@ -307,5 +308,3 @@ module.exports.optimizeImage = optimizeImage
|
|
307
308
|
module.exports.Resolver = Resolver
|
308
309
|
module.exports.transform = transform
|
309
310
|
module.exports.transformAsync = transformAsync
|
310
|
-
module.exports.getChangedPackages = getChangedPackages
|
311
|
-
module.exports.getPackages = getPackages
|
package/index.js.flow
CHANGED
@@ -1,21 +1,15 @@
|
|
1
1
|
// @flow
|
2
2
|
import type {FileCreateInvalidation} from '@parcel/types';
|
3
|
+
import type {EnvironmentAddr, TargetAddr} from './src/db';
|
3
4
|
|
4
5
|
declare export var init: void | (() => void);
|
5
6
|
|
6
|
-
declare export function findAncestorFile(
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
): string
|
11
|
-
declare export function
|
12
|
-
declare export function findNodeModule(
|
13
|
-
module: string,
|
14
|
-
from: string,
|
15
|
-
): string | null;
|
16
|
-
declare export function hashString(s: string): string;
|
17
|
-
declare export function hashBuffer(buf: Buffer): string;
|
18
|
-
declare export function optimizeImage(kind: string, buf: Buffer): Buffer;
|
7
|
+
declare export function findAncestorFile(filenames: Array<string>, from: string, root: string): string | null
|
8
|
+
declare export function findFirstFile(names: Array<string>): string | null
|
9
|
+
declare export function findNodeModule(module: string, from: string): string | null
|
10
|
+
declare export function hashString(s: string): string
|
11
|
+
declare export function hashBuffer(buf: Buffer): string
|
12
|
+
declare export function optimizeImage(kind: string, buf: Buffer): Buffer
|
19
13
|
export interface JsFileSystemOptions {
|
20
14
|
canonicalize: string => string;
|
21
15
|
read: string => Buffer;
|
@@ -24,14 +18,14 @@ export interface JsFileSystemOptions {
|
|
24
18
|
includeNodeModules?: boolean | Array<string> | {|[string]: boolean|};
|
25
19
|
}
|
26
20
|
export interface FileSystem {
|
27
|
-
fs?: JsFileSystemOptions
|
21
|
+
fs?: JsFileSystemOptions,
|
28
22
|
includeNodeModules?: boolean | Array<string> | {|[string]: boolean|};
|
29
|
-
conditions?: number
|
30
|
-
moduleDirResolver?: (...args: any[]) => any
|
31
|
-
mode: number
|
32
|
-
entries?: number
|
33
|
-
extensions?: Array<string
|
34
|
-
packageExports: boolean
|
23
|
+
conditions?: number,
|
24
|
+
moduleDirResolver?: (...args: any[]) => any,
|
25
|
+
mode: number,
|
26
|
+
entries?: number,
|
27
|
+
extensions?: Array<string>,
|
28
|
+
packageExports: boolean
|
35
29
|
}
|
36
30
|
export interface ResolveOptions {
|
37
31
|
filename: string;
|
@@ -60,13 +54,46 @@ export interface JsInvalidations {
|
|
60
54
|
invalidateOnFileCreate: Array<FileCreateInvalidation>;
|
61
55
|
invalidateOnStartup: boolean;
|
62
56
|
}
|
63
|
-
declare export function transform(opts: any): any;
|
64
|
-
declare export function transformAsync(opts: any): Promise<any>;
|
57
|
+
declare export function transform(db: ParcelDb, opts: any): any;
|
58
|
+
declare export function transformAsync(db: ParcelDb, opts: any): Promise<any>;
|
65
59
|
declare export class Hash {
|
66
60
|
writeString(s: string): void;
|
67
61
|
writeBuffer(b: Buffer): void;
|
68
62
|
finish(): string;
|
69
63
|
}
|
64
|
+
// $FlowFixMe
|
65
|
+
type TmpBigInt = bigint;
|
66
|
+
export type SerializedParcelDb = {|
|
67
|
+
id: TmpBigInt
|
68
|
+
|};
|
69
|
+
type Options = {|
|
70
|
+
mode: string,
|
71
|
+
env: {[string]: string | void},
|
72
|
+
log_level: string,
|
73
|
+
project_root: string
|
74
|
+
|};
|
75
|
+
declare export class ParcelDb {
|
76
|
+
constructor(options: Options): ParcelDb;
|
77
|
+
serialize(): SerializedParcelDb;
|
78
|
+
static create(options: Options): ParcelDb;
|
79
|
+
static read(filename: string, options: Options): ParcelDb;
|
80
|
+
static fromBuffer(buf: Buffer, options: Options): ParcelDb;
|
81
|
+
static deserialize(value: SerializedParcelDb): ParcelDb;
|
82
|
+
write(filename: string): void;
|
83
|
+
toBuffer(): Buffer;
|
84
|
+
getPage(page: number): Buffer;
|
85
|
+
alloc(typeId: number): number;
|
86
|
+
dealloc(typeId: number, addr: number): void;
|
87
|
+
readString(addr: number): string;
|
88
|
+
getStringId(s: string): number;
|
89
|
+
extendVec(typeId: number, addr: number, count: number): void;
|
90
|
+
createEnvironment(addr: EnvironmentAddr): EnvironmentAddr;
|
91
|
+
createTarget(addr: TargetAddr): TargetAddr;
|
92
|
+
|
93
|
+
starSymbol: number;
|
94
|
+
defaultSymbol: number;
|
95
|
+
[symbol]: any;
|
96
|
+
}
|
70
97
|
export interface ResolverOptions {
|
71
98
|
fs?: JsFileSystemOptions;
|
72
99
|
includeNodeModules?: boolean | Array<string> | {|[string]: boolean|};
|
@@ -82,9 +109,3 @@ declare export class Resolver {
|
|
82
109
|
resolveAsync(options: ResolveOptions): Promise<ResolveResult>;
|
83
110
|
getInvalidations(path: string): JsInvalidations;
|
84
111
|
}
|
85
|
-
export type PackageVersions = Map<String, Array<String>>;
|
86
|
-
declare export function getChangedPackages(
|
87
|
-
packageVersions: PackageVersions,
|
88
|
-
prevPackageVersions: PackageVersions,
|
89
|
-
): Array<string>;
|
90
|
-
declare export function getPackages(yarnLock: string): PackageVersions;
|
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 _db = require("./db");
|
18
|
+
Object.keys(_db).forEach(function (key) {
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
20
|
+
if (key in exports && exports[key] === _db[key]) return;
|
21
|
+
Object.defineProperty(exports, key, {
|
22
|
+
enumerable: true,
|
23
|
+
get: function () {
|
24
|
+
return _db[key];
|
25
|
+
}
|
26
|
+
});
|
27
|
+
});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@parcel/rust",
|
3
|
-
"version": "2.12.1-dev.
|
3
|
+
"version": "2.12.1-dev.3238+7f6b4dbbc",
|
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",
|
16
|
+
"main": "lib/index.js",
|
17
17
|
"browser": "browser.js",
|
18
|
+
"source": "src/index.js",
|
18
19
|
"napi": {
|
19
20
|
"name": "parcel-node-bindings"
|
20
21
|
},
|
@@ -34,10 +35,11 @@
|
|
34
35
|
"napi-wasm": "^1.0.1"
|
35
36
|
},
|
36
37
|
"scripts": {
|
37
|
-
"build": "napi build --platform --cargo-cwd ../../../crates/node-bindings",
|
38
|
-
"build-release": "napi build --platform --release --cargo-cwd ../../../crates/node-bindings",
|
38
|
+
"build": "napi build --platform --cargo-cwd ../../../crates/node-bindings && yarn build-db",
|
39
|
+
"build-release": "napi build --platform --release --cargo-cwd ../../../crates/node-bindings && yarn build-db",
|
40
|
+
"build-db": "cargo run -p parcel-db && prettier --write src/db.js",
|
39
41
|
"wasm:build": "cargo build -p parcel-node-bindings --target wasm32-unknown-unknown && cp ../../../target/wasm32-unknown-unknown/debug/parcel_node_bindings.wasm .",
|
40
42
|
"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"
|
41
43
|
},
|
42
|
-
"gitHead": "
|
44
|
+
"gitHead": "7f6b4dbbc56a203e0fce8794856c03598c4f6708"
|
43
45
|
}
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|