@napi-rs/cli 3.0.0-alpha.43 → 3.0.0-alpha.45
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const WASI_WORKER_TEMPLATE = "import fs from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport { parentPort, Worker } from \"node:worker_threads\";\n\
|
|
1
|
+
export declare const WASI_WORKER_TEMPLATE = "import fs from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport { WASI } from \"node:wasi\";\nimport { parentPort, Worker } from \"node:worker_threads\";\n\nconst require = createRequire(import.meta.url);\n\nconst { instantiateNapiModuleSync, MessageHandler, getDefaultContext } = require(\"@napi-rs/wasm-runtime\");\n\nif (parentPort) {\n parentPort.on(\"message\", (data) => {\n globalThis.onmessage({ data });\n });\n}\n\nObject.assign(globalThis, {\n self: globalThis,\n require,\n Worker,\n importScripts: function (f) {\n ;(0, eval)(fs.readFileSync(f, \"utf8\") + \"//# sourceURL=\" + f);\n },\n postMessage: function (msg) {\n if (parentPort) {\n parentPort.postMessage(msg);\n }\n },\n});\n\nconst emnapiContext = getDefaultContext()\n\nconst handler = new MessageHandler({\n onLoad({ wasmModule, wasmMemory }) {\n const wasi = new WASI({\n version: 'preview1',\n env: process.env,\n preopens: {\n '/': '/',\n },\n });\n\n return instantiateNapiModuleSync(wasmModule, {\n childThread: true,\n wasi,\n context: emnapiContext,\n overwriteImports(importObject) {\n importObject.env = {\n ...importObject.env,\n ...importObject.napi,\n ...importObject.emnapi,\n memory: wasmMemory\n };\n },\n });\n },\n});\n\nglobalThis.onmessage = function (e) {\n handler.handle(e);\n};\n";
|
|
2
2
|
export declare const WASI_WORKER_BROWSER_TEMPLATE = "import { instantiateNapiModuleSync, MessageHandler, WASI } from '@napi-rs/wasm-runtime'\nimport { Volume, createFsFromVolume } from '@napi-rs/wasm-runtime/fs'\n\nconst fs = createFsFromVolume(\n Volume.fromJSON({\n '/': null,\n }),\n)\n\nconst handler = new MessageHandler({\n onLoad({ wasmModule, wasmMemory }) {\n const wasi = new WASI({\n fs,\n print: function () {\n // eslint-disable-next-line no-console\n console.log.apply(console, arguments)\n },\n printErr: function() {\n // eslint-disable-next-line no-console\n console.error.apply(console, arguments)\n },\n })\n return instantiateNapiModuleSync(wasmModule, {\n childThread: true,\n wasi,\n overwriteImports(importObject) {\n importObject.env = {\n ...importObject.env,\n ...importObject.napi,\n ...importObject.emnapi,\n memory: wasmMemory,\n }\n },\n })\n },\n})\n\nglobalThis.onmessage = function (e) {\n handler.handle(e)\n}\n";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export const WASI_WORKER_TEMPLATE = `import fs from "node:fs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
|
+
import { WASI } from "node:wasi";
|
|
3
4
|
import { parentPort, Worker } from "node:worker_threads";
|
|
4
5
|
|
|
5
|
-
import { instantiateNapiModuleSync, MessageHandler, WASI } from "@napi-rs/wasm-runtime";
|
|
6
|
-
|
|
7
6
|
const require = createRequire(import.meta.url);
|
|
8
7
|
|
|
8
|
+
const { instantiateNapiModuleSync, MessageHandler, getDefaultContext } = require("@napi-rs/wasm-runtime");
|
|
9
|
+
|
|
9
10
|
if (parentPort) {
|
|
10
11
|
parentPort.on("message", (data) => {
|
|
11
12
|
globalThis.onmessage({ data });
|
|
@@ -26,13 +27,22 @@ Object.assign(globalThis, {
|
|
|
26
27
|
},
|
|
27
28
|
});
|
|
28
29
|
|
|
30
|
+
const emnapiContext = getDefaultContext()
|
|
31
|
+
|
|
29
32
|
const handler = new MessageHandler({
|
|
30
33
|
onLoad({ wasmModule, wasmMemory }) {
|
|
31
|
-
const wasi = new WASI({
|
|
34
|
+
const wasi = new WASI({
|
|
35
|
+
version: 'preview1',
|
|
36
|
+
env: process.env,
|
|
37
|
+
preopens: {
|
|
38
|
+
'/': '/',
|
|
39
|
+
},
|
|
40
|
+
});
|
|
32
41
|
|
|
33
42
|
return instantiateNapiModuleSync(wasmModule, {
|
|
34
43
|
childThread: true,
|
|
35
44
|
wasi,
|
|
45
|
+
context: emnapiContext,
|
|
36
46
|
overwriteImports(importObject) {
|
|
37
47
|
importObject.env = {
|
|
38
48
|
...importObject.env,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wasi-worker-template.js","sourceRoot":"","sources":["../../../src/api/templates/wasi-worker-template.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG
|
|
1
|
+
{"version":3,"file":"wasi-worker-template.js","sourceRoot":"","sources":["../../../src/api/templates/wasi-worker-template.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4DnC,CAAA;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwC3C,CAAA"}
|
package/dist/index.cjs
CHANGED
|
@@ -3922,8 +3922,11 @@ var require_re = __commonJS({
|
|
|
3922
3922
|
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
3923
3923
|
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
3924
3924
|
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
3925
|
-
createToken("
|
|
3925
|
+
createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
3926
|
+
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
3927
|
+
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
3926
3928
|
createToken("COERCERTL", src[t.COERCE], true);
|
|
3929
|
+
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
3927
3930
|
createToken("LONETILDE", "(?:~>?)");
|
|
3928
3931
|
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
3929
3932
|
exports2.tildeTrimReplace = "$1~";
|
|
@@ -4558,21 +4561,27 @@ var require_coerce = __commonJS({
|
|
|
4558
4561
|
options = options || {};
|
|
4559
4562
|
let match = null;
|
|
4560
4563
|
if (!options.rtl) {
|
|
4561
|
-
match = version2.match(re[t.COERCE]);
|
|
4564
|
+
match = version2.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
4562
4565
|
} else {
|
|
4566
|
+
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
4563
4567
|
let next;
|
|
4564
|
-
while ((next =
|
|
4568
|
+
while ((next = coerceRtlRegex.exec(version2)) && (!match || match.index + match[0].length !== version2.length)) {
|
|
4565
4569
|
if (!match || next.index + next[0].length !== match.index + match[0].length) {
|
|
4566
4570
|
match = next;
|
|
4567
4571
|
}
|
|
4568
|
-
|
|
4572
|
+
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
4569
4573
|
}
|
|
4570
|
-
|
|
4574
|
+
coerceRtlRegex.lastIndex = -1;
|
|
4571
4575
|
}
|
|
4572
4576
|
if (match === null) {
|
|
4573
4577
|
return null;
|
|
4574
4578
|
}
|
|
4575
|
-
|
|
4579
|
+
const major = match[2];
|
|
4580
|
+
const minor = match[3] || "0";
|
|
4581
|
+
const patch = match[4] || "0";
|
|
4582
|
+
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
4583
|
+
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
4584
|
+
return parse4(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
4576
4585
|
};
|
|
4577
4586
|
module2.exports = coerce;
|
|
4578
4587
|
}
|
|
@@ -6977,7 +6986,7 @@ var require_dist_node5 = __commonJS({
|
|
|
6977
6986
|
module2.exports = __toCommonJS2(dist_src_exports);
|
|
6978
6987
|
var import_endpoint = require_dist_node2();
|
|
6979
6988
|
var import_universal_user_agent = require_dist_node();
|
|
6980
|
-
var VERSION = "8.
|
|
6989
|
+
var VERSION = "8.2.0";
|
|
6981
6990
|
function isPlainObject2(value) {
|
|
6982
6991
|
if (typeof value !== "object" || value === null)
|
|
6983
6992
|
return false;
|
|
@@ -7113,11 +7122,17 @@ var require_dist_node5 = __commonJS({
|
|
|
7113
7122
|
function toErrorMessage(data) {
|
|
7114
7123
|
if (typeof data === "string")
|
|
7115
7124
|
return data;
|
|
7125
|
+
let suffix;
|
|
7126
|
+
if ("documentation_url" in data) {
|
|
7127
|
+
suffix = ` - ${data.documentation_url}`;
|
|
7128
|
+
} else {
|
|
7129
|
+
suffix = "";
|
|
7130
|
+
}
|
|
7116
7131
|
if ("message" in data) {
|
|
7117
7132
|
if (Array.isArray(data.errors)) {
|
|
7118
|
-
return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}`;
|
|
7133
|
+
return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`;
|
|
7119
7134
|
}
|
|
7120
|
-
return data.message
|
|
7135
|
+
return `${data.message}${suffix}`;
|
|
7121
7136
|
}
|
|
7122
7137
|
return `Unknown error: ${JSON.stringify(data)}`;
|
|
7123
7138
|
}
|
|
@@ -7546,7 +7561,7 @@ var require_dist_node9 = __commonJS({
|
|
|
7546
7561
|
requestLog: () => requestLog
|
|
7547
7562
|
});
|
|
7548
7563
|
module2.exports = __toCommonJS2(dist_src_exports);
|
|
7549
|
-
var VERSION = "4.0.
|
|
7564
|
+
var VERSION = "4.0.1";
|
|
7550
7565
|
function requestLog(octokit) {
|
|
7551
7566
|
octokit.hook.wrap("request", (request, options) => {
|
|
7552
7567
|
octokit.log.debug("request", options);
|
|
@@ -7599,7 +7614,7 @@ var require_dist_node10 = __commonJS({
|
|
|
7599
7614
|
paginatingEndpoints: () => paginatingEndpoints
|
|
7600
7615
|
});
|
|
7601
7616
|
module2.exports = __toCommonJS2(dist_src_exports);
|
|
7602
|
-
var VERSION = "9.1
|
|
7617
|
+
var VERSION = "9.2.1";
|
|
7603
7618
|
function normalizePaginatedListResponse(response) {
|
|
7604
7619
|
if (!response.data) {
|
|
7605
7620
|
return {
|
|
@@ -7750,6 +7765,8 @@ var require_dist_node10 = __commonJS({
|
|
|
7750
7765
|
"GET /orgs/{org}/members/{username}/codespaces",
|
|
7751
7766
|
"GET /orgs/{org}/migrations",
|
|
7752
7767
|
"GET /orgs/{org}/migrations/{migration_id}/repositories",
|
|
7768
|
+
"GET /orgs/{org}/organization-roles/{role_id}/teams",
|
|
7769
|
+
"GET /orgs/{org}/organization-roles/{role_id}/users",
|
|
7753
7770
|
"GET /orgs/{org}/outside_collaborators",
|
|
7754
7771
|
"GET /orgs/{org}/packages",
|
|
7755
7772
|
"GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
|
|
@@ -7974,7 +7991,7 @@ var require_dist_node11 = __commonJS({
|
|
|
7974
7991
|
restEndpointMethods: () => restEndpointMethods
|
|
7975
7992
|
});
|
|
7976
7993
|
module2.exports = __toCommonJS2(dist_src_exports);
|
|
7977
|
-
var VERSION = "10.
|
|
7994
|
+
var VERSION = "10.4.0";
|
|
7978
7995
|
var Endpoints = {
|
|
7979
7996
|
actions: {
|
|
7980
7997
|
addCustomLabelsToSelfHostedRunnerForOrg: [
|
|
@@ -8099,6 +8116,9 @@ var require_dist_node11 = __commonJS({
|
|
|
8099
8116
|
"GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
|
|
8100
8117
|
],
|
|
8101
8118
|
getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
|
|
8119
|
+
getCustomOidcSubClaimForRepo: [
|
|
8120
|
+
"GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
|
|
8121
|
+
],
|
|
8102
8122
|
getEnvironmentPublicKey: [
|
|
8103
8123
|
"GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"
|
|
8104
8124
|
],
|
|
@@ -8251,6 +8271,9 @@ var require_dist_node11 = __commonJS({
|
|
|
8251
8271
|
setCustomLabelsForSelfHostedRunnerForRepo: [
|
|
8252
8272
|
"PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
|
|
8253
8273
|
],
|
|
8274
|
+
setCustomOidcSubClaimForRepo: [
|
|
8275
|
+
"PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"
|
|
8276
|
+
],
|
|
8254
8277
|
setGithubActionsDefaultWorkflowPermissionsOrganization: [
|
|
8255
8278
|
"PUT /orgs/{org}/actions/permissions/workflow"
|
|
8256
8279
|
],
|
|
@@ -8320,6 +8343,7 @@ var require_dist_node11 = __commonJS({
|
|
|
8320
8343
|
listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"],
|
|
8321
8344
|
markNotificationsAsRead: ["PUT /notifications"],
|
|
8322
8345
|
markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"],
|
|
8346
|
+
markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"],
|
|
8323
8347
|
markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"],
|
|
8324
8348
|
setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"],
|
|
8325
8349
|
setThreadSubscription: [
|
|
@@ -8596,10 +8620,10 @@ var require_dist_node11 = __commonJS({
|
|
|
8596
8620
|
updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
|
|
8597
8621
|
},
|
|
8598
8622
|
copilot: {
|
|
8599
|
-
|
|
8623
|
+
addCopilotSeatsForTeams: [
|
|
8600
8624
|
"POST /orgs/{org}/copilot/billing/selected_teams"
|
|
8601
8625
|
],
|
|
8602
|
-
|
|
8626
|
+
addCopilotSeatsForUsers: [
|
|
8603
8627
|
"POST /orgs/{org}/copilot/billing/selected_users"
|
|
8604
8628
|
],
|
|
8605
8629
|
cancelCopilotSeatAssignmentForTeams: [
|
|
@@ -8912,10 +8936,24 @@ var require_dist_node11 = __commonJS({
|
|
|
8912
8936
|
}
|
|
8913
8937
|
]
|
|
8914
8938
|
},
|
|
8939
|
+
oidc: {
|
|
8940
|
+
getOidcCustomSubTemplateForOrg: [
|
|
8941
|
+
"GET /orgs/{org}/actions/oidc/customization/sub"
|
|
8942
|
+
],
|
|
8943
|
+
updateOidcCustomSubTemplateForOrg: [
|
|
8944
|
+
"PUT /orgs/{org}/actions/oidc/customization/sub"
|
|
8945
|
+
]
|
|
8946
|
+
},
|
|
8915
8947
|
orgs: {
|
|
8916
8948
|
addSecurityManagerTeam: [
|
|
8917
8949
|
"PUT /orgs/{org}/security-managers/teams/{team_slug}"
|
|
8918
8950
|
],
|
|
8951
|
+
assignTeamToOrgRole: [
|
|
8952
|
+
"PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
|
|
8953
|
+
],
|
|
8954
|
+
assignUserToOrgRole: [
|
|
8955
|
+
"PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"
|
|
8956
|
+
],
|
|
8919
8957
|
blockUser: ["PUT /orgs/{org}/blocks/{username}"],
|
|
8920
8958
|
cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"],
|
|
8921
8959
|
checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"],
|
|
@@ -8924,6 +8962,7 @@ var require_dist_node11 = __commonJS({
|
|
|
8924
8962
|
convertMemberToOutsideCollaborator: [
|
|
8925
8963
|
"PUT /orgs/{org}/outside_collaborators/{username}"
|
|
8926
8964
|
],
|
|
8965
|
+
createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"],
|
|
8927
8966
|
createInvitation: ["POST /orgs/{org}/invitations"],
|
|
8928
8967
|
createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"],
|
|
8929
8968
|
createOrUpdateCustomPropertiesValuesForRepos: [
|
|
@@ -8934,6 +8973,9 @@ var require_dist_node11 = __commonJS({
|
|
|
8934
8973
|
],
|
|
8935
8974
|
createWebhook: ["POST /orgs/{org}/hooks"],
|
|
8936
8975
|
delete: ["DELETE /orgs/{org}"],
|
|
8976
|
+
deleteCustomOrganizationRole: [
|
|
8977
|
+
"DELETE /orgs/{org}/organization-roles/{role_id}"
|
|
8978
|
+
],
|
|
8937
8979
|
deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
|
|
8938
8980
|
enableOrDisableSecurityProductOnAllOrgRepos: [
|
|
8939
8981
|
"POST /orgs/{org}/{security_product}/{enablement}"
|
|
@@ -8945,6 +8987,7 @@ var require_dist_node11 = __commonJS({
|
|
|
8945
8987
|
],
|
|
8946
8988
|
getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
|
|
8947
8989
|
getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
|
|
8990
|
+
getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"],
|
|
8948
8991
|
getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
|
|
8949
8992
|
getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"],
|
|
8950
8993
|
getWebhookDelivery: [
|
|
@@ -8960,6 +9003,12 @@ var require_dist_node11 = __commonJS({
|
|
|
8960
9003
|
listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"],
|
|
8961
9004
|
listMembers: ["GET /orgs/{org}/members"],
|
|
8962
9005
|
listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
|
|
9006
|
+
listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"],
|
|
9007
|
+
listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"],
|
|
9008
|
+
listOrgRoles: ["GET /orgs/{org}/organization-roles"],
|
|
9009
|
+
listOrganizationFineGrainedPermissions: [
|
|
9010
|
+
"GET /orgs/{org}/organization-fine-grained-permissions"
|
|
9011
|
+
],
|
|
8963
9012
|
listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
|
|
8964
9013
|
listPatGrantRepositories: [
|
|
8965
9014
|
"GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
|
|
@@ -8974,6 +9023,9 @@ var require_dist_node11 = __commonJS({
|
|
|
8974
9023
|
listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"],
|
|
8975
9024
|
listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"],
|
|
8976
9025
|
listWebhooks: ["GET /orgs/{org}/hooks"],
|
|
9026
|
+
patchCustomOrganizationRole: [
|
|
9027
|
+
"PATCH /orgs/{org}/organization-roles/{role_id}"
|
|
9028
|
+
],
|
|
8977
9029
|
pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"],
|
|
8978
9030
|
redeliverWebhookDelivery: [
|
|
8979
9031
|
"POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
|
|
@@ -8998,6 +9050,18 @@ var require_dist_node11 = __commonJS({
|
|
|
8998
9050
|
reviewPatGrantRequestsInBulk: [
|
|
8999
9051
|
"POST /orgs/{org}/personal-access-token-requests"
|
|
9000
9052
|
],
|
|
9053
|
+
revokeAllOrgRolesTeam: [
|
|
9054
|
+
"DELETE /orgs/{org}/organization-roles/teams/{team_slug}"
|
|
9055
|
+
],
|
|
9056
|
+
revokeAllOrgRolesUser: [
|
|
9057
|
+
"DELETE /orgs/{org}/organization-roles/users/{username}"
|
|
9058
|
+
],
|
|
9059
|
+
revokeOrgRoleTeam: [
|
|
9060
|
+
"DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
|
|
9061
|
+
],
|
|
9062
|
+
revokeOrgRoleUser: [
|
|
9063
|
+
"DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
|
|
9064
|
+
],
|
|
9001
9065
|
setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
|
|
9002
9066
|
setPublicMembershipForAuthenticatedUser: [
|
|
9003
9067
|
"PUT /orgs/{org}/public_members/{username}"
|
|
@@ -9288,6 +9352,9 @@ var require_dist_node11 = __commonJS({
|
|
|
9288
9352
|
{},
|
|
9289
9353
|
{ mapToData: "users" }
|
|
9290
9354
|
],
|
|
9355
|
+
cancelPagesDeployment: [
|
|
9356
|
+
"POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"
|
|
9357
|
+
],
|
|
9291
9358
|
checkAutomatedSecurityFixes: [
|
|
9292
9359
|
"GET /repos/{owner}/{repo}/automated-security-fixes"
|
|
9293
9360
|
],
|
|
@@ -9323,12 +9390,15 @@ var require_dist_node11 = __commonJS({
|
|
|
9323
9390
|
createForAuthenticatedUser: ["POST /user/repos"],
|
|
9324
9391
|
createFork: ["POST /repos/{owner}/{repo}/forks"],
|
|
9325
9392
|
createInOrg: ["POST /orgs/{org}/repos"],
|
|
9393
|
+
createOrUpdateCustomPropertiesValues: [
|
|
9394
|
+
"PATCH /repos/{owner}/{repo}/properties/values"
|
|
9395
|
+
],
|
|
9326
9396
|
createOrUpdateEnvironment: [
|
|
9327
9397
|
"PUT /repos/{owner}/{repo}/environments/{environment_name}"
|
|
9328
9398
|
],
|
|
9329
9399
|
createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
|
|
9330
9400
|
createOrgRuleset: ["POST /orgs/{org}/rulesets"],
|
|
9331
|
-
createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/
|
|
9401
|
+
createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"],
|
|
9332
9402
|
createPagesSite: ["POST /repos/{owner}/{repo}/pages"],
|
|
9333
9403
|
createRelease: ["POST /repos/{owner}/{repo}/releases"],
|
|
9334
9404
|
createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"],
|
|
@@ -9481,6 +9551,9 @@ var require_dist_node11 = __commonJS({
|
|
|
9481
9551
|
getOrgRulesets: ["GET /orgs/{org}/rulesets"],
|
|
9482
9552
|
getPages: ["GET /repos/{owner}/{repo}/pages"],
|
|
9483
9553
|
getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
|
|
9554
|
+
getPagesDeployment: [
|
|
9555
|
+
"GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"
|
|
9556
|
+
],
|
|
9484
9557
|
getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
|
|
9485
9558
|
getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
|
|
9486
9559
|
getPullRequestReviewProtection: [
|
|
@@ -9691,6 +9764,9 @@ var require_dist_node11 = __commonJS({
|
|
|
9691
9764
|
]
|
|
9692
9765
|
},
|
|
9693
9766
|
securityAdvisories: {
|
|
9767
|
+
createFork: [
|
|
9768
|
+
"POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"
|
|
9769
|
+
],
|
|
9694
9770
|
createPrivateVulnerabilityReport: [
|
|
9695
9771
|
"POST /repos/{owner}/{repo}/security-advisories/reports"
|
|
9696
9772
|
],
|
|
@@ -17143,12 +17219,13 @@ ${wasiRegisterFunctions.map((name) => ` __napiInstance.exports['${name}']?.()`)
|
|
|
17143
17219
|
// dist/api/templates/wasi-worker-template.js
|
|
17144
17220
|
var WASI_WORKER_TEMPLATE = `import fs from "node:fs";
|
|
17145
17221
|
import { createRequire } from "node:module";
|
|
17222
|
+
import { WASI } from "node:wasi";
|
|
17146
17223
|
import { parentPort, Worker } from "node:worker_threads";
|
|
17147
17224
|
|
|
17148
|
-
import { instantiateNapiModuleSync, MessageHandler, WASI } from "@napi-rs/wasm-runtime";
|
|
17149
|
-
|
|
17150
17225
|
const require = createRequire(import.meta.url);
|
|
17151
17226
|
|
|
17227
|
+
const { instantiateNapiModuleSync, MessageHandler, getDefaultContext } = require("@napi-rs/wasm-runtime");
|
|
17228
|
+
|
|
17152
17229
|
if (parentPort) {
|
|
17153
17230
|
parentPort.on("message", (data) => {
|
|
17154
17231
|
globalThis.onmessage({ data });
|
|
@@ -17169,13 +17246,22 @@ Object.assign(globalThis, {
|
|
|
17169
17246
|
},
|
|
17170
17247
|
});
|
|
17171
17248
|
|
|
17249
|
+
const emnapiContext = getDefaultContext()
|
|
17250
|
+
|
|
17172
17251
|
const handler = new MessageHandler({
|
|
17173
17252
|
onLoad({ wasmModule, wasmMemory }) {
|
|
17174
|
-
const wasi = new WASI({
|
|
17253
|
+
const wasi = new WASI({
|
|
17254
|
+
version: 'preview1',
|
|
17255
|
+
env: process.env,
|
|
17256
|
+
preopens: {
|
|
17257
|
+
'/': '/',
|
|
17258
|
+
},
|
|
17259
|
+
});
|
|
17175
17260
|
|
|
17176
17261
|
return instantiateNapiModuleSync(wasmModule, {
|
|
17177
17262
|
childThread: true,
|
|
17178
17263
|
wasi,
|
|
17264
|
+
context: emnapiContext,
|
|
17179
17265
|
overwriteImports(importObject) {
|
|
17180
17266
|
importObject.env = {
|
|
17181
17267
|
...importObject.env,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@napi-rs/cli",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.45",
|
|
4
4
|
"description": "Cli tools for napi-rs",
|
|
5
5
|
"author": "LongYinan <lynweklm@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/napi-rs/napi-rs",
|
|
@@ -72,18 +72,18 @@
|
|
|
72
72
|
"clipanion": "^3.2.1",
|
|
73
73
|
"colorette": "^2.0.20",
|
|
74
74
|
"debug": "^4.3.4",
|
|
75
|
-
"emnapi": "1.
|
|
75
|
+
"emnapi": "1.1.0",
|
|
76
76
|
"inquirer": "^9.2.13",
|
|
77
77
|
"js-yaml": "^4.1.0",
|
|
78
78
|
"lodash-es": "^4.17.21",
|
|
79
79
|
"semver": "^7.5.4",
|
|
80
80
|
"toml": "^3.0.0",
|
|
81
81
|
"typanion": "^3.14.0",
|
|
82
|
-
"wasm-sjlj": "^1.0.
|
|
82
|
+
"wasm-sjlj": "^1.0.5"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@emnapi/core": "^1.
|
|
86
|
-
"@emnapi/runtime": "^1.
|
|
85
|
+
"@emnapi/core": "^1.1.0",
|
|
86
|
+
"@emnapi/runtime": "^1.1.0",
|
|
87
87
|
"@types/debug": "^4.1.12",
|
|
88
88
|
"@types/inquirer": "^9.0.7",
|
|
89
89
|
"@types/js-yaml": "^4.0.9",
|
|
@@ -98,16 +98,13 @@
|
|
|
98
98
|
"typescript": "^5.3.3"
|
|
99
99
|
},
|
|
100
100
|
"peerDependencies": {
|
|
101
|
-
"@emnapi/runtime": "^1.
|
|
102
|
-
"emnapi": "^1.
|
|
101
|
+
"@emnapi/runtime": "^1.1.0",
|
|
102
|
+
"emnapi": "^1.1.0"
|
|
103
103
|
},
|
|
104
104
|
"peerDependenciesMeta": {
|
|
105
105
|
"@emnapi/runtime": {
|
|
106
106
|
"optional": true
|
|
107
107
|
},
|
|
108
|
-
"@tybys/wasm-util": {
|
|
109
|
-
"optional": true
|
|
110
|
-
},
|
|
111
108
|
"emnapi": {
|
|
112
109
|
"optional": true
|
|
113
110
|
}
|
|
@@ -130,5 +127,5 @@
|
|
|
130
127
|
"**/__tests__/**/*.spec.ts"
|
|
131
128
|
]
|
|
132
129
|
},
|
|
133
|
-
"gitHead": "
|
|
130
|
+
"gitHead": "f5b685473117903f448888a7deda9fe5d7435aeb"
|
|
134
131
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export const WASI_WORKER_TEMPLATE = `import fs from "node:fs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
|
+
import { WASI } from "node:wasi";
|
|
3
4
|
import { parentPort, Worker } from "node:worker_threads";
|
|
4
5
|
|
|
5
|
-
import { instantiateNapiModuleSync, MessageHandler, WASI } from "@napi-rs/wasm-runtime";
|
|
6
|
-
|
|
7
6
|
const require = createRequire(import.meta.url);
|
|
8
7
|
|
|
8
|
+
const { instantiateNapiModuleSync, MessageHandler, getDefaultContext } = require("@napi-rs/wasm-runtime");
|
|
9
|
+
|
|
9
10
|
if (parentPort) {
|
|
10
11
|
parentPort.on("message", (data) => {
|
|
11
12
|
globalThis.onmessage({ data });
|
|
@@ -26,13 +27,22 @@ Object.assign(globalThis, {
|
|
|
26
27
|
},
|
|
27
28
|
});
|
|
28
29
|
|
|
30
|
+
const emnapiContext = getDefaultContext()
|
|
31
|
+
|
|
29
32
|
const handler = new MessageHandler({
|
|
30
33
|
onLoad({ wasmModule, wasmMemory }) {
|
|
31
|
-
const wasi = new WASI({
|
|
34
|
+
const wasi = new WASI({
|
|
35
|
+
version: 'preview1',
|
|
36
|
+
env: process.env,
|
|
37
|
+
preopens: {
|
|
38
|
+
'/': '/',
|
|
39
|
+
},
|
|
40
|
+
});
|
|
32
41
|
|
|
33
42
|
return instantiateNapiModuleSync(wasmModule, {
|
|
34
43
|
childThread: true,
|
|
35
44
|
wasi,
|
|
45
|
+
context: emnapiContext,
|
|
36
46
|
overwriteImports(importObject) {
|
|
37
47
|
importObject.env = {
|
|
38
48
|
...importObject.env,
|