@atlaspack/rust 2.12.1-dev.3401 → 2.12.1-dev.3450
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/atlaspack-node-bindings.darwin-arm64.node +0 -0
- package/atlaspack-node-bindings.darwin-x64.node +0 -0
- package/atlaspack-node-bindings.linux-arm-gnueabihf.node +0 -0
- package/atlaspack-node-bindings.linux-arm64-gnu.node +0 -0
- package/atlaspack-node-bindings.linux-x64-gnu.node +0 -0
- package/index.d.ts +65 -57
- package/index.js +8 -2
- package/index.js.flow +236 -25
- package/package.json +4 -3
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/index.d.ts
CHANGED
|
@@ -7,12 +7,37 @@ export interface JsMacroError {
|
|
|
7
7
|
kind: number
|
|
8
8
|
message: string
|
|
9
9
|
}
|
|
10
|
+
export interface LmdbOptions {
|
|
11
|
+
/** The database directory path */
|
|
12
|
+
path: string
|
|
13
|
+
/**
|
|
14
|
+
* If enabled, the database writer will set the following flags:
|
|
15
|
+
*
|
|
16
|
+
* * MAP_ASYNC - "use asynchronous msync when MDB_WRITEMAP is used"
|
|
17
|
+
* * NO_SYNC - "don't fsync after commit"
|
|
18
|
+
* * NO_META_SYNC - "don't fsync metapage after commit"
|
|
19
|
+
*
|
|
20
|
+
* `MDB_WRITEMAP` is on by default.
|
|
21
|
+
*/
|
|
22
|
+
asyncWrites: boolean
|
|
23
|
+
/**
|
|
24
|
+
* The mmap size, this corresponds to [`mdb_env_set_mapsize`](http://www.lmdb.tech/doc/group__mdb.html#gaa2506ec8dab3d969b0e609cd82e619e5)
|
|
25
|
+
* if this isn't set it'll default to around 10MB.
|
|
26
|
+
*/
|
|
27
|
+
mapSize?: number
|
|
28
|
+
}
|
|
29
|
+
export function initTracingSubscriber(): void
|
|
30
|
+
export interface Entry {
|
|
31
|
+
key: string
|
|
32
|
+
value: Buffer
|
|
33
|
+
}
|
|
10
34
|
export function findAncestorFile(filenames: Array<string>, from: string, root: string): string | null
|
|
11
35
|
export function findFirstFile(names: Array<string>): string | null
|
|
12
36
|
export function findNodeModule(module: string, from: string): string | null
|
|
13
37
|
export function hashString(s: string): string
|
|
14
38
|
export function hashBuffer(buf: Buffer): string
|
|
15
39
|
export function optimizeImage(kind: string, buf: Buffer): Buffer
|
|
40
|
+
export function createAssetId(params: unknown): string
|
|
16
41
|
export interface AtlaspackNapiBuildOptions {
|
|
17
42
|
registerWorker: (...args: any[]) => any
|
|
18
43
|
}
|
|
@@ -26,6 +51,8 @@ export interface AtlaspackNapiOptions {
|
|
|
26
51
|
packageManager?: object
|
|
27
52
|
threads?: number
|
|
28
53
|
}
|
|
54
|
+
export function createDependencyId(params: unknown): string
|
|
55
|
+
export function createEnvironmentId(params: unknown): string
|
|
29
56
|
export function initializeMonitoring(): void
|
|
30
57
|
export function closeMonitoring(): void
|
|
31
58
|
/**
|
|
@@ -51,6 +78,17 @@ export function closeMonitoring(): void
|
|
|
51
78
|
* <--- Array<Asset> -----
|
|
52
79
|
*/
|
|
53
80
|
export function registerWorker(channel: JsTransferable, worker: object): void
|
|
81
|
+
export interface InlineRequiresOptimizerInput {
|
|
82
|
+
code: string
|
|
83
|
+
sourceMaps: boolean
|
|
84
|
+
ignoreModuleIds: Array<string>
|
|
85
|
+
}
|
|
86
|
+
export interface InlineRequiresOptimizerResult {
|
|
87
|
+
code: string
|
|
88
|
+
sourceMap?: string
|
|
89
|
+
}
|
|
90
|
+
export function runInlineRequiresOptimizer(input: InlineRequiresOptimizerInput): InlineRequiresOptimizerResult
|
|
91
|
+
export function replaceHashReferences(input: Buffer, hashRefToNameHash: Record<string, string>): Buffer
|
|
54
92
|
export interface JsFileSystemOptions {
|
|
55
93
|
canonicalize: (...args: any[]) => any
|
|
56
94
|
read: (...args: any[]) => any
|
|
@@ -99,56 +137,35 @@ export interface JsInvalidations {
|
|
|
99
137
|
invalidateOnFileCreate: Array<FilePathCreateInvalidation | FileNameCreateInvalidation | GlobCreateInvalidation>
|
|
100
138
|
invalidateOnStartup: boolean
|
|
101
139
|
}
|
|
102
|
-
export interface JsFileSystemOptionsOld {
|
|
103
|
-
canonicalize: (...args: any[]) => any
|
|
104
|
-
read: (...args: any[]) => any
|
|
105
|
-
isFile: (...args: any[]) => any
|
|
106
|
-
isDir: (...args: any[]) => any
|
|
107
|
-
includeNodeModules?: NapiSideEffectsVariants
|
|
108
|
-
}
|
|
109
|
-
export interface FileSystemOld {
|
|
110
|
-
fs?: JsFileSystemOptionsOld
|
|
111
|
-
includeNodeModules?: NapiSideEffectsVariants
|
|
112
|
-
conditions?: number
|
|
113
|
-
moduleDirResolver?: (...args: any[]) => any
|
|
114
|
-
mode: number
|
|
115
|
-
entries?: number
|
|
116
|
-
extensions?: Array<string>
|
|
117
|
-
packageExports: boolean
|
|
118
|
-
typescript?: boolean
|
|
119
|
-
}
|
|
120
|
-
export interface ResolveOptionsOld {
|
|
121
|
-
filename: string
|
|
122
|
-
specifierType: string
|
|
123
|
-
parent: string
|
|
124
|
-
packageConditions?: Array<string>
|
|
125
|
-
}
|
|
126
|
-
export interface FilePathCreateInvalidationOld {
|
|
127
|
-
filePath: string
|
|
128
|
-
}
|
|
129
|
-
export interface FileNameCreateInvalidationOld {
|
|
130
|
-
fileName: string
|
|
131
|
-
aboveFilePath: string
|
|
132
|
-
}
|
|
133
|
-
export interface GlobCreateInvalidationOld {
|
|
134
|
-
glob: string
|
|
135
|
-
}
|
|
136
|
-
export interface ResolveResultOld {
|
|
137
|
-
resolution: unknown
|
|
138
|
-
invalidateOnFileChange: Array<string>
|
|
139
|
-
invalidateOnFileCreate: Array<FilePathCreateInvalidationOld | FileNameCreateInvalidationOld | GlobCreateInvalidationOld>
|
|
140
|
-
query?: string
|
|
141
|
-
sideEffects: boolean
|
|
142
|
-
error: unknown
|
|
143
|
-
moduleType: number
|
|
144
|
-
}
|
|
145
|
-
export interface JsInvalidationsOld {
|
|
146
|
-
invalidateOnFileChange: Array<string>
|
|
147
|
-
invalidateOnFileCreate: Array<FilePathCreateInvalidationOld | FileNameCreateInvalidationOld | GlobCreateInvalidationOld>
|
|
148
|
-
invalidateOnStartup: boolean
|
|
149
|
-
}
|
|
150
140
|
export function transform(opts: object): unknown
|
|
151
141
|
export function transformAsync(opts: object): object
|
|
142
|
+
export type LMDB = Lmdb
|
|
143
|
+
export class Lmdb {
|
|
144
|
+
constructor(options: LmdbOptions)
|
|
145
|
+
get(key: string): Promise<Buffer | null | undefined>
|
|
146
|
+
getSync(key: string): Buffer | null
|
|
147
|
+
getManySync(keys: Array<string>): Array<Buffer | undefined | null>
|
|
148
|
+
putMany(entries: Array<Entry>): Promise<void>
|
|
149
|
+
put(key: string, data: Buffer): Promise<void>
|
|
150
|
+
putNoConfirm(key: string, data: Buffer): void
|
|
151
|
+
startReadTransaction(): void
|
|
152
|
+
commitReadTransaction(): void
|
|
153
|
+
startWriteTransaction(): Promise<void>
|
|
154
|
+
commitWriteTransaction(): Promise<void>
|
|
155
|
+
close(): void
|
|
156
|
+
constructor(options: LMDBOptions)
|
|
157
|
+
get(key: string): Promise<Buffer | null | undefined>
|
|
158
|
+
getSync(key: string): Buffer | null
|
|
159
|
+
getManySync(keys: Array<string>): Array<Buffer | undefined | null>
|
|
160
|
+
putMany(entries: Array<Entry>): Promise<void>
|
|
161
|
+
put(key: string, data: Buffer): Promise<void>
|
|
162
|
+
putNoConfirm(key: string, data: Buffer): void
|
|
163
|
+
startReadTransaction(): void
|
|
164
|
+
commitReadTransaction(): void
|
|
165
|
+
startWriteTransaction(): Promise<void>
|
|
166
|
+
commitWriteTransaction(): Promise<void>
|
|
167
|
+
close(): void
|
|
168
|
+
}
|
|
152
169
|
export class Hash {
|
|
153
170
|
constructor()
|
|
154
171
|
writeString(s: string): void
|
|
@@ -158,7 +175,6 @@ export class Hash {
|
|
|
158
175
|
export class AtlaspackNapi {
|
|
159
176
|
nodeWorkerCount: number
|
|
160
177
|
constructor(napiOptions: AtlaspackNapiOptions)
|
|
161
|
-
build(options: AtlaspackNapiBuildOptions): object
|
|
162
178
|
buildAssetGraph(options: AtlaspackNapiBuildOptions): object
|
|
163
179
|
}
|
|
164
180
|
export class Resolver {
|
|
@@ -169,11 +185,3 @@ export class Resolver {
|
|
|
169
185
|
getInvalidations(path: string): JsInvalidations
|
|
170
186
|
getInvalidations(path: string): JsInvalidations
|
|
171
187
|
}
|
|
172
|
-
export class ResolverOld {
|
|
173
|
-
constructor(projectRoot: string, options: FileSystemOld)
|
|
174
|
-
resolve(options: ResolveOptionsOld): ResolveResultOld
|
|
175
|
-
resolveAsync(): object
|
|
176
|
-
resolveAsync(options: ResolveOptionsOld): object
|
|
177
|
-
getInvalidations(path: string): JsInvalidationsOld
|
|
178
|
-
getInvalidations(path: string): JsInvalidationsOld
|
|
179
|
-
}
|
package/index.js
CHANGED
|
@@ -310,8 +310,10 @@ if (!nativeBinding) {
|
|
|
310
310
|
throw new Error(`Failed to load native binding`)
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
const { findAncestorFile, findFirstFile, findNodeModule, hashString, hashBuffer, Hash, optimizeImage, AtlaspackNapi, initializeMonitoring, closeMonitoring, registerWorker,
|
|
313
|
+
const { initTracingSubscriber, Lmdb, findAncestorFile, findFirstFile, findNodeModule, hashString, hashBuffer, Hash, optimizeImage, createAssetId, AtlaspackNapi, createDependencyId, createEnvironmentId, initializeMonitoring, closeMonitoring, registerWorker, runInlineRequiresOptimizer, replaceHashReferences, Resolver, transform, transformAsync } = nativeBinding
|
|
314
314
|
|
|
315
|
+
module.exports.initTracingSubscriber = initTracingSubscriber
|
|
316
|
+
module.exports.Lmdb = Lmdb
|
|
315
317
|
module.exports.findAncestorFile = findAncestorFile
|
|
316
318
|
module.exports.findFirstFile = findFirstFile
|
|
317
319
|
module.exports.findNodeModule = findNodeModule
|
|
@@ -319,11 +321,15 @@ module.exports.hashString = hashString
|
|
|
319
321
|
module.exports.hashBuffer = hashBuffer
|
|
320
322
|
module.exports.Hash = Hash
|
|
321
323
|
module.exports.optimizeImage = optimizeImage
|
|
324
|
+
module.exports.createAssetId = createAssetId
|
|
322
325
|
module.exports.AtlaspackNapi = AtlaspackNapi
|
|
326
|
+
module.exports.createDependencyId = createDependencyId
|
|
327
|
+
module.exports.createEnvironmentId = createEnvironmentId
|
|
323
328
|
module.exports.initializeMonitoring = initializeMonitoring
|
|
324
329
|
module.exports.closeMonitoring = closeMonitoring
|
|
325
330
|
module.exports.registerWorker = registerWorker
|
|
331
|
+
module.exports.runInlineRequiresOptimizer = runInlineRequiresOptimizer
|
|
332
|
+
module.exports.replaceHashReferences = replaceHashReferences
|
|
326
333
|
module.exports.Resolver = Resolver
|
|
327
|
-
module.exports.ResolverOld = ResolverOld
|
|
328
334
|
module.exports.transform = transform
|
|
329
335
|
module.exports.transformAsync = transformAsync
|
package/index.js.flow
CHANGED
|
@@ -92,25 +92,13 @@ declare export function findNodeModule(
|
|
|
92
92
|
declare export function hashString(s: string): string;
|
|
93
93
|
declare export function hashBuffer(buf: Buffer): string;
|
|
94
94
|
declare export function optimizeImage(kind: string, buf: Buffer): Buffer;
|
|
95
|
-
|
|
96
|
-
canonicalize: string => string;
|
|
97
|
-
read: string => Buffer;
|
|
98
|
-
isFile: string => boolean;
|
|
99
|
-
isDir: string => boolean;
|
|
100
|
-
includeNodeModules?: boolean | Array<string> | {|[string]: boolean|};
|
|
101
|
-
}
|
|
95
|
+
|
|
102
96
|
export interface ResolveOptions {
|
|
103
97
|
filename: string;
|
|
104
98
|
specifierType: string;
|
|
105
99
|
parent: string;
|
|
106
100
|
packageConditions?: Array<string>;
|
|
107
101
|
}
|
|
108
|
-
export type Resolution =
|
|
109
|
-
| {|type: 'Path', value: string|}
|
|
110
|
-
| {|type: 'Builtin', value: string|}
|
|
111
|
-
| {|type: 'External'|}
|
|
112
|
-
| {|type: 'Empty'|}
|
|
113
|
-
| {|type: 'Global', value: string|};
|
|
114
102
|
|
|
115
103
|
export interface ResolveResult {
|
|
116
104
|
resolution: Resolution;
|
|
@@ -133,24 +121,247 @@ declare export class Hash {
|
|
|
133
121
|
writeBuffer(b: Buffer): void;
|
|
134
122
|
finish(): string;
|
|
135
123
|
}
|
|
124
|
+
|
|
125
|
+
export type Engines = {|
|
|
126
|
+
atlaspack?: string,
|
|
127
|
+
browsers?: string | string[],
|
|
128
|
+
electron?: string,
|
|
129
|
+
node?: string,
|
|
130
|
+
|}
|
|
131
|
+
|
|
132
|
+
export type Environment = {|
|
|
133
|
+
context: string,
|
|
134
|
+
engines: Engines,
|
|
135
|
+
includeNodeModules: IncludeNodeModules,
|
|
136
|
+
isLibrary: boolean,
|
|
137
|
+
loc?: SourceLocation,
|
|
138
|
+
outputFormat: string,
|
|
139
|
+
shouldScopeHoist: boolean,
|
|
140
|
+
shouldOptimize: boolean,
|
|
141
|
+
sourceMap?: {|
|
|
142
|
+
inline?: boolean,
|
|
143
|
+
inlineSources?: boolean,
|
|
144
|
+
sourceRoot?: string,
|
|
145
|
+
|},
|
|
146
|
+
sourceType: string,
|
|
147
|
+
|}
|
|
148
|
+
|
|
149
|
+
export type SourceLocation = {|
|
|
150
|
+
filePath: string,
|
|
151
|
+
start: {|
|
|
152
|
+
line: number,
|
|
153
|
+
column: number
|
|
154
|
+
|},
|
|
155
|
+
end: {|
|
|
156
|
+
line: number,
|
|
157
|
+
column: number
|
|
158
|
+
|},
|
|
159
|
+
|}
|
|
160
|
+
|
|
161
|
+
export type Symbol = {|
|
|
162
|
+
local: string,
|
|
163
|
+
exported: string,
|
|
164
|
+
loc?: SourceLocation,
|
|
165
|
+
isWeak: boolean,
|
|
166
|
+
isEsmExport: boolean,
|
|
167
|
+
selfReferenced: boolean,
|
|
168
|
+
|}
|
|
169
|
+
|
|
170
|
+
export type Target = {|
|
|
171
|
+
distDir: string,
|
|
172
|
+
distEntry?: string,
|
|
173
|
+
env: Environment,
|
|
174
|
+
loc?: SourceLocation,
|
|
175
|
+
name: string,
|
|
176
|
+
publicUrl: string,
|
|
177
|
+
|}
|
|
178
|
+
|
|
179
|
+
export type Dependency = {|
|
|
180
|
+
bundleBehavior?: number,
|
|
181
|
+
env: Environment,
|
|
182
|
+
loc: SourceLocation,
|
|
183
|
+
meta?: any,
|
|
184
|
+
packageConditions: number,
|
|
185
|
+
pipeline?: string,
|
|
186
|
+
priority: number,
|
|
187
|
+
range?: string,
|
|
188
|
+
resolveFrom?: string,
|
|
189
|
+
sourceAssetId?: string,
|
|
190
|
+
sourcePath?: string,
|
|
191
|
+
specifier: string,
|
|
192
|
+
specifierType: number,
|
|
193
|
+
sourceAssetType?: string,
|
|
194
|
+
symbols?: Symbol[],
|
|
195
|
+
target?: Target,
|
|
196
|
+
isEntry: boolean,
|
|
197
|
+
isOptional: boolean,
|
|
198
|
+
needsStableName: boolean,
|
|
199
|
+
shouldWrap: boolean,
|
|
200
|
+
isEsm: boolean,
|
|
201
|
+
placeholder?: string,
|
|
202
|
+
|}
|
|
203
|
+
|
|
204
|
+
export type RpcAssetResult = {|
|
|
205
|
+
id: String,
|
|
206
|
+
bundleBehavior: number,
|
|
207
|
+
filePath: string,
|
|
208
|
+
type: string,
|
|
209
|
+
code: Array<number>,
|
|
210
|
+
meta: any,
|
|
211
|
+
pipeline?: string,
|
|
212
|
+
query?: string,
|
|
213
|
+
symbols?: Symbol[],
|
|
214
|
+
uniqueKey?: string,
|
|
215
|
+
sideEffects: boolean,
|
|
216
|
+
isBundleSplittable: boolean,
|
|
217
|
+
isSource: boolean,
|
|
218
|
+
|}
|
|
219
|
+
|
|
220
|
+
export type RpcTransformerOpts = {|
|
|
221
|
+
resolveFrom: string,
|
|
222
|
+
specifier: string,
|
|
223
|
+
options: RpcPluginOptions,
|
|
224
|
+
asset: Asset,
|
|
225
|
+
|}
|
|
226
|
+
|
|
227
|
+
export type RpcHmrOptions = {|
|
|
228
|
+
port?: number,
|
|
229
|
+
host?: string,
|
|
230
|
+
|}
|
|
231
|
+
|
|
232
|
+
export type RpcPluginOptions = {|
|
|
233
|
+
hmrOptions?: RpcHmrOptions,
|
|
234
|
+
projectRoot: string,
|
|
235
|
+
|}
|
|
236
|
+
|
|
237
|
+
export type Asset = {|
|
|
238
|
+
id: string,
|
|
239
|
+
bundleBehavior: number,
|
|
240
|
+
env: Environment,
|
|
241
|
+
filePath: string,
|
|
242
|
+
type: string,
|
|
243
|
+
code: Array<number>,
|
|
244
|
+
meta: any,
|
|
245
|
+
pipeline?: string,
|
|
246
|
+
query?: string,
|
|
247
|
+
stats: {|
|
|
248
|
+
size: number,
|
|
249
|
+
time: number,
|
|
250
|
+
|},
|
|
251
|
+
symbols?: Symbol[],
|
|
252
|
+
uniqueKey?: string,
|
|
253
|
+
sideEffects: boolean,
|
|
254
|
+
isBundleSplittable: boolean,
|
|
255
|
+
isSource: boolean,
|
|
256
|
+
hasCjsExports: boolean,
|
|
257
|
+
staticExports: boolean,
|
|
258
|
+
shouldWrap: boolean,
|
|
259
|
+
hasNodeReplacements: boolean,
|
|
260
|
+
isConstantModule: boolean,
|
|
261
|
+
conditions: Array<{|
|
|
262
|
+
key: string,
|
|
263
|
+
ifTruePlaceholder?: string,
|
|
264
|
+
ifFalsePlaceholder?: string,
|
|
265
|
+
|}>,
|
|
266
|
+
configPath?: string,
|
|
267
|
+
configKeyPath?: string,
|
|
268
|
+
|}
|
|
269
|
+
|
|
270
|
+
declare export class Resolver {
|
|
271
|
+
constructor(projectRoot: string, options: ResolverOptions): Resolver;
|
|
272
|
+
resolve(options: ResolveOptions): ResolveResult;
|
|
273
|
+
resolveAsync(options: ResolveOptions): Promise<ResolveResult>;
|
|
274
|
+
getInvalidations(path: string): JsInvalidations;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export interface LmdbOptions {
|
|
278
|
+
/** The database directory path */
|
|
279
|
+
path: string;
|
|
280
|
+
/**
|
|
281
|
+
* If enabled, the database writer will set the following flags:
|
|
282
|
+
*
|
|
283
|
+
* * MAP_ASYNC - "use asynchronous msync when MDB_WRITEMAP is used"
|
|
284
|
+
* * NO_SYNC - "don't fsync after commit"
|
|
285
|
+
* * NO_META_SYNC - "don't fsync metapage after commit"
|
|
286
|
+
*
|
|
287
|
+
* `MDB_WRITEMAP` is on by default.
|
|
288
|
+
*/
|
|
289
|
+
asyncWrites: boolean;
|
|
290
|
+
/**
|
|
291
|
+
* The mmap size, this corresponds to [`mdb_env_set_mapsize`](http://www.lmdb.tech/doc/group__mdb.html#gaa2506ec8dab3d969b0e609cd82e619e5)
|
|
292
|
+
* if this isn't set it'll default to around 10MB.
|
|
293
|
+
*/
|
|
294
|
+
mapSize?: number;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export interface LmdbEntry {
|
|
298
|
+
key: string;
|
|
299
|
+
value: Buffer;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
declare export class Lmdb {
|
|
303
|
+
constructor(options: LmdbOptions): Lmdb;
|
|
304
|
+
get(key: string): Promise<Buffer | null | void>;
|
|
305
|
+
getSync(key: string): Buffer | null;
|
|
306
|
+
getManySync(keys: Array<string>): Array<Buffer | void | null>;
|
|
307
|
+
putMany(entries: Array<LmdbEntry>): Promise<void>;
|
|
308
|
+
put(key: string, data: Buffer): Promise<void>;
|
|
309
|
+
putNoConfirm(key: string, data: Buffer): void;
|
|
310
|
+
startReadTransaction(): void;
|
|
311
|
+
commitReadTransaction(): void;
|
|
312
|
+
startWriteTransaction(): Promise<void>;
|
|
313
|
+
commitWriteTransaction(): Promise<void>;
|
|
314
|
+
close(): void;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export interface InlineRequiresOptimizerInput {
|
|
318
|
+
code: string;
|
|
319
|
+
sourceMaps: boolean;
|
|
320
|
+
ignoreModuleIds: Array<string>;
|
|
321
|
+
}
|
|
322
|
+
export interface InlineRequiresOptimizerResult {
|
|
323
|
+
code: string;
|
|
324
|
+
sourceMap?: string;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
declare export function runInlineRequiresOptimizer(
|
|
328
|
+
input: InlineRequiresOptimizerInput,
|
|
329
|
+
): InlineRequiresOptimizerResult;
|
|
330
|
+
|
|
331
|
+
declare export function createAssetId(params: mixed): string;
|
|
332
|
+
declare export function createDependencyId(params: mixed): string;
|
|
333
|
+
declare export function createEnvironmentId(params: mixed): string;
|
|
334
|
+
|
|
335
|
+
declare export function replaceHashReferences(
|
|
336
|
+
input: Buffer,
|
|
337
|
+
hashRefToNameHash: {[key: string]: string},
|
|
338
|
+
): Buffer;
|
|
339
|
+
|
|
136
340
|
export interface ResolverOptions {
|
|
137
341
|
fs?: JsFileSystemOptions;
|
|
138
|
-
includeNodeModules?:
|
|
342
|
+
includeNodeModules?: IncludeNodeModules;
|
|
139
343
|
conditions?: number;
|
|
140
344
|
moduleDirResolver?: (...args: any[]) => any;
|
|
141
345
|
mode: number;
|
|
142
346
|
entries?: number;
|
|
143
347
|
extensions?: Array<string>;
|
|
144
348
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
constructor(projectRoot: string, options: ResolverOptions): Resolver;
|
|
153
|
-
resolve(options: ResolveOptions): ResolveResult;
|
|
154
|
-
resolveAsync(options: ResolveOptions): Promise<ResolveResult>;
|
|
155
|
-
getInvalidations(path: string): JsInvalidations;
|
|
349
|
+
|
|
350
|
+
export interface JsFileSystemOptions {
|
|
351
|
+
canonicalize: string => string;
|
|
352
|
+
read: string => Buffer;
|
|
353
|
+
isFile: string => boolean;
|
|
354
|
+
isDir: string => boolean;
|
|
355
|
+
includeNodeModules?: IncludeNodeModules;
|
|
156
356
|
}
|
|
357
|
+
|
|
358
|
+
// Types below break IDE highlighting, place them at the bottom of the file
|
|
359
|
+
|
|
360
|
+
export type IncludeNodeModules = boolean | Array<string> | {|[string]: boolean|}
|
|
361
|
+
|
|
362
|
+
export type Resolution =
|
|
363
|
+
| {|type: 'Path', value: string|}
|
|
364
|
+
| {|type: 'Builtin', value: string|}
|
|
365
|
+
| {|type: 'External'|}
|
|
366
|
+
| {|type: 'Empty'|}
|
|
367
|
+
| {|type: 'Global', value: string|};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/rust",
|
|
3
|
-
"version": "2.12.1-dev.
|
|
4
|
-
"license": "MIT",
|
|
3
|
+
"version": "2.12.1-dev.3450+58845ef87",
|
|
4
|
+
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -33,8 +33,9 @@
|
|
|
33
33
|
"build": "napi build --platform --cargo-cwd ../../../crates/node-bindings",
|
|
34
34
|
"build-canary": "napi build --platform --profile canary --features canary --cargo-cwd ../../../crates/node-bindings",
|
|
35
35
|
"build-release": "napi build --platform --release --cargo-cwd ../../../crates/node-bindings",
|
|
36
|
+
"test": "mocha",
|
|
36
37
|
"wasm:build": "cargo build -p atlaspack-node-bindings --target wasm32-unknown-unknown && cp ../../../target/wasm32-unknown-unknown/debug/atlaspack_node_bindings.wasm .",
|
|
37
38
|
"wasm:build-release": "CARGO_PROFILE_RELEASE_LTO=true cargo build -p atlaspack-node-bindings --target wasm32-unknown-unknown --release && wasm-opt --strip-debug -O ../../../target/wasm32-unknown-unknown/release/atlaspack_node_bindings.wasm -o atlaspack_node_bindings.wasm"
|
|
38
39
|
},
|
|
39
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "58845ef87446fcedb7d7d8876440c64184645cbb"
|
|
40
41
|
}
|