reg-cli 0.0.0-experimental-wasm3 → 0.0.0-experimental-wasm5
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/dist/cli.cjs +2 -1
- package/dist/cli.mjs +2 -1
- package/dist/entry.cjs +1 -1
- package/dist/entry.mjs +1 -1
- package/dist/index.cjs +11 -5
- package/dist/index.d.cts +2 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +9 -5
- package/dist/shared/{reg-cli.023bb9e7.cjs → reg-cli.217aa27a.cjs} +3 -6
- package/dist/shared/{reg-cli.05d5cc1c.mjs → reg-cli.899e776d.mjs} +3 -6
- package/dist/worker.cjs +1 -1
- package/dist/worker.mjs +1 -1
- package/package.json +3 -2
package/dist/cli.cjs
CHANGED
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
const index = require('./index.cjs');
|
|
4
4
|
require('node:events');
|
|
5
5
|
require('node:worker_threads');
|
|
6
|
-
require('./shared/reg-cli.
|
|
6
|
+
require('./shared/reg-cli.217aa27a.cjs');
|
|
7
7
|
require('path');
|
|
8
8
|
require('url');
|
|
9
9
|
require('node:fs/promises');
|
|
10
10
|
require('node:path');
|
|
11
11
|
|
|
12
12
|
const emitter = index.run(process.argv.slice(2));
|
|
13
|
+
console.log(process.argv.slice(2));
|
|
13
14
|
emitter.on("complete", (data) => {
|
|
14
15
|
console.log(data);
|
|
15
16
|
});
|
package/dist/cli.mjs
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { run } from './index.mjs';
|
|
2
2
|
import 'node:events';
|
|
3
3
|
import 'node:worker_threads';
|
|
4
|
-
import './shared/reg-cli.
|
|
4
|
+
import './shared/reg-cli.899e776d.mjs';
|
|
5
5
|
import 'path';
|
|
6
6
|
import 'url';
|
|
7
7
|
import 'node:fs/promises';
|
|
8
8
|
import 'node:path';
|
|
9
9
|
|
|
10
10
|
const emitter = run(process.argv.slice(2));
|
|
11
|
+
console.log(process.argv.slice(2));
|
|
11
12
|
emitter.on("complete", (data) => {
|
|
12
13
|
console.log(data);
|
|
13
14
|
});
|
package/dist/entry.cjs
CHANGED
|
@@ -4,7 +4,7 @@ const fs = require('node:fs');
|
|
|
4
4
|
const wasmUtil = require('@tybys/wasm-util');
|
|
5
5
|
const node_process = require('node:process');
|
|
6
6
|
const node_worker_threads = require('node:worker_threads');
|
|
7
|
-
const utils = require('./shared/reg-cli.
|
|
7
|
+
const utils = require('./shared/reg-cli.217aa27a.cjs');
|
|
8
8
|
require('path');
|
|
9
9
|
require('url');
|
|
10
10
|
require('node:fs/promises');
|
package/dist/entry.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import fs from 'node:fs';
|
|
|
2
2
|
import { WASI } from '@tybys/wasm-util';
|
|
3
3
|
import { env } from 'node:process';
|
|
4
4
|
import { workerData, parentPort } from 'node:worker_threads';
|
|
5
|
-
import { a as readWasm } from './shared/reg-cli.
|
|
5
|
+
import { a as readWasm } from './shared/reg-cli.899e776d.mjs';
|
|
6
6
|
import 'path';
|
|
7
7
|
import 'url';
|
|
8
8
|
import 'node:fs/promises';
|
package/dist/index.cjs
CHANGED
|
@@ -2,23 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
const EventEmitter = require('node:events');
|
|
4
4
|
const node_worker_threads = require('node:worker_threads');
|
|
5
|
-
const utils = require('./shared/reg-cli.
|
|
5
|
+
const utils = require('./shared/reg-cli.217aa27a.cjs');
|
|
6
6
|
const node_path = require('node:path');
|
|
7
|
+
const url = require('url');
|
|
7
8
|
require('path');
|
|
8
|
-
require('url');
|
|
9
9
|
require('node:fs/promises');
|
|
10
10
|
|
|
11
|
+
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
11
12
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
12
13
|
|
|
13
14
|
const EventEmitter__default = /*#__PURE__*/_interopDefaultCompat(EventEmitter);
|
|
14
15
|
|
|
16
|
+
const dir = () => {
|
|
17
|
+
const dir2 = utils.isCJS ? __dirname : node_path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
|
|
18
|
+
return dir2;
|
|
19
|
+
};
|
|
15
20
|
const run = (argv) => {
|
|
16
21
|
const emitter = new EventEmitter__default();
|
|
17
|
-
const worker = new node_worker_threads.Worker(node_path.join(
|
|
22
|
+
const worker = new node_worker_threads.Worker(node_path.join(dir(), `./entry.${utils.resolveExtention()}`), { workerData: { argv } });
|
|
18
23
|
let nextTid = 1;
|
|
19
24
|
const workers = [worker];
|
|
20
25
|
const spawn = (startArg, threadId, memory) => {
|
|
21
|
-
const worker2 = new node_worker_threads.Worker(node_path.join(
|
|
26
|
+
const worker2 = new node_worker_threads.Worker(node_path.join(dir(), `./worker.${utils.resolveExtention()}`));
|
|
22
27
|
workers.push(worker2);
|
|
23
28
|
worker2.on("message", ({ cmd, startArg: startArg2, threadId: threadId2, memory: memory2 }) => {
|
|
24
29
|
if (cmd === "loaded") {
|
|
@@ -63,9 +68,10 @@ const run = (argv) => {
|
|
|
63
68
|
return emitter;
|
|
64
69
|
};
|
|
65
70
|
const compare = (input) => {
|
|
66
|
-
const args = Object.entries(input).flatMap(([k, v]) => [k
|
|
71
|
+
const args = Object.entries(input).flatMap(([k, v]) => [`--${k}`, String(v)]);
|
|
67
72
|
return run(args);
|
|
68
73
|
};
|
|
69
74
|
|
|
70
75
|
exports.compare = compare;
|
|
76
|
+
exports.dir = dir;
|
|
71
77
|
exports.run = run;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import EventEmitter from 'node:events';
|
|
2
2
|
|
|
3
|
+
declare const dir: () => string;
|
|
3
4
|
declare const run: (argv: string[]) => EventEmitter;
|
|
4
5
|
type CompareInput = {
|
|
5
6
|
actualDir: string;
|
|
@@ -33,4 +34,4 @@ type CompareOutput = {
|
|
|
33
34
|
};
|
|
34
35
|
declare const compare: (input: CompareInput) => EventEmitter;
|
|
35
36
|
|
|
36
|
-
export { type CompareInput, type CompareOutput, compare, run };
|
|
37
|
+
export { type CompareInput, type CompareOutput, compare, dir, run };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import EventEmitter from 'node:events';
|
|
2
2
|
|
|
3
|
+
declare const dir: () => string;
|
|
3
4
|
declare const run: (argv: string[]) => EventEmitter;
|
|
4
5
|
type CompareInput = {
|
|
5
6
|
actualDir: string;
|
|
@@ -33,4 +34,4 @@ type CompareOutput = {
|
|
|
33
34
|
};
|
|
34
35
|
declare const compare: (input: CompareInput) => EventEmitter;
|
|
35
36
|
|
|
36
|
-
export { type CompareInput, type CompareOutput, compare, run };
|
|
37
|
+
export { type CompareInput, type CompareOutput, compare, dir, run };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import EventEmitter from 'node:events';
|
|
2
2
|
|
|
3
|
+
declare const dir: () => string;
|
|
3
4
|
declare const run: (argv: string[]) => EventEmitter;
|
|
4
5
|
type CompareInput = {
|
|
5
6
|
actualDir: string;
|
|
@@ -33,4 +34,4 @@ type CompareOutput = {
|
|
|
33
34
|
};
|
|
34
35
|
declare const compare: (input: CompareInput) => EventEmitter;
|
|
35
36
|
|
|
36
|
-
export { type CompareInput, type CompareOutput, compare, run };
|
|
37
|
+
export { type CompareInput, type CompareOutput, compare, dir, run };
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import EventEmitter from 'node:events';
|
|
2
2
|
import { Worker } from 'node:worker_threads';
|
|
3
|
-
import {
|
|
4
|
-
import { join } from 'node:path';
|
|
3
|
+
import { i as isCJS, r as resolveExtention } from './shared/reg-cli.899e776d.mjs';
|
|
4
|
+
import { dirname, join } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
5
6
|
import 'path';
|
|
6
|
-
import 'url';
|
|
7
7
|
import 'node:fs/promises';
|
|
8
8
|
|
|
9
|
+
const dir = () => {
|
|
10
|
+
const dir2 = isCJS ? __dirname : dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
return dir2;
|
|
12
|
+
};
|
|
9
13
|
const run = (argv) => {
|
|
10
14
|
const emitter = new EventEmitter();
|
|
11
15
|
const worker = new Worker(join(dir(), `./entry.${resolveExtention()}`), { workerData: { argv } });
|
|
@@ -57,8 +61,8 @@ const run = (argv) => {
|
|
|
57
61
|
return emitter;
|
|
58
62
|
};
|
|
59
63
|
const compare = (input) => {
|
|
60
|
-
const args = Object.entries(input).flatMap(([k, v]) => [k
|
|
64
|
+
const args = Object.entries(input).flatMap(([k, v]) => [`--${k}`, String(v)]);
|
|
61
65
|
return run(args);
|
|
62
66
|
};
|
|
63
67
|
|
|
64
|
-
export { compare, run };
|
|
68
|
+
export { compare, dir, run };
|
|
@@ -11,18 +11,15 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
11
11
|
const path__default = /*#__PURE__*/_interopDefaultCompat(path);
|
|
12
12
|
|
|
13
13
|
const isCJS = typeof __dirname !== "undefined";
|
|
14
|
-
const dir = () => {
|
|
15
|
-
const dir2 = isCJS ? __dirname : path__default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/reg-cli.023bb9e7.cjs', document.baseURI).href))));
|
|
16
|
-
return dir2;
|
|
17
|
-
};
|
|
18
14
|
const readWasm = () => {
|
|
19
|
-
const
|
|
15
|
+
const dir = isCJS ? __dirname : path__default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/reg-cli.217aa27a.cjs', document.baseURI).href))));
|
|
16
|
+
const file = promises.readFile(node_path.join(dir, "./reg.wasm"));
|
|
20
17
|
return file;
|
|
21
18
|
};
|
|
22
19
|
const resolveExtention = () => {
|
|
23
20
|
return isCJS ? "cjs" : "mjs";
|
|
24
21
|
};
|
|
25
22
|
|
|
26
|
-
exports.
|
|
23
|
+
exports.isCJS = isCJS;
|
|
27
24
|
exports.readWasm = readWasm;
|
|
28
25
|
exports.resolveExtention = resolveExtention;
|
|
@@ -4,16 +4,13 @@ import { readFile } from 'node:fs/promises';
|
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
|
|
6
6
|
const isCJS = typeof __dirname !== "undefined";
|
|
7
|
-
const dir = () => {
|
|
8
|
-
const dir2 = isCJS ? __dirname : path.dirname(fileURLToPath(import.meta.url));
|
|
9
|
-
return dir2;
|
|
10
|
-
};
|
|
11
7
|
const readWasm = () => {
|
|
12
|
-
const
|
|
8
|
+
const dir = isCJS ? __dirname : path.dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const file = readFile(join(dir, "./reg.wasm"));
|
|
13
10
|
return file;
|
|
14
11
|
};
|
|
15
12
|
const resolveExtention = () => {
|
|
16
13
|
return isCJS ? "cjs" : "mjs";
|
|
17
14
|
};
|
|
18
15
|
|
|
19
|
-
export { readWasm as a,
|
|
16
|
+
export { readWasm as a, isCJS as i, resolveExtention as r };
|
package/dist/worker.cjs
CHANGED
|
@@ -4,7 +4,7 @@ const node_worker_threads = require('node:worker_threads');
|
|
|
4
4
|
const fs = require('node:fs');
|
|
5
5
|
const wasmUtil = require('@tybys/wasm-util');
|
|
6
6
|
const node_process = require('node:process');
|
|
7
|
-
const utils = require('./shared/reg-cli.
|
|
7
|
+
const utils = require('./shared/reg-cli.217aa27a.cjs');
|
|
8
8
|
require('path');
|
|
9
9
|
require('url');
|
|
10
10
|
require('node:fs/promises');
|
package/dist/worker.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { parentPort } from 'node:worker_threads';
|
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import { WASI } from '@tybys/wasm-util';
|
|
4
4
|
import { argv, env } from 'node:process';
|
|
5
|
-
import { a as readWasm } from './shared/reg-cli.
|
|
5
|
+
import { a as readWasm } from './shared/reg-cli.899e776d.mjs';
|
|
6
6
|
import 'path';
|
|
7
7
|
import 'url';
|
|
8
8
|
import 'node:fs/promises';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reg-cli",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-wasm5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"start": "node ./dist/cli.mjs",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"reg-cli": "./dist/cli.mjs"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
|
-
"build": "unbuild && cp reg.wasm ./dist/shared/reg.wasm"
|
|
27
|
+
"build": "unbuild && cp reg.wasm ./dist/shared/reg.wasm",
|
|
28
|
+
"prepublishOnly": "npm run build"
|
|
28
29
|
},
|
|
29
30
|
"keywords": [],
|
|
30
31
|
"author": "bokuweb",
|