From 2b6476bb98554fbf418548941f9970baadefc666 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sat, 2 Dec 2023 05:35:52 -0800 Subject: [PATCH 01/50] Use tsconfig/node18 as base TS config --- package-lock.json | 7 +++++++ pkgs/create-neon/package.json | 1 + pkgs/create-neon/src/bin/create-neon.ts | 6 +++--- pkgs/create-neon/src/expand.ts | 2 +- pkgs/create-neon/src/package.ts | 2 +- pkgs/create-neon/tsconfig.json | 8 +------- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7c48958b2..128a1a453 100644 --- a/package-lock.json +++ b/package-lock.json @@ -73,6 +73,12 @@ "node": ">=10" } }, + "node_modules/@tsconfig/node18": { + "version": "18.2.2", + "resolved": "https://registry.npmjs.org/@tsconfig/node18/-/node18-18.2.2.tgz", + "integrity": "sha512-d6McJeGsuoRlwWZmVIeE8CUA27lu6jLjvv1JzqmpsytOYYbVi1tHZEnwCNVOXnj4pyLvneZlFlpXUK+X9wBWyw==", + "dev": true + }, "node_modules/@types/cacheable-request": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz", @@ -2241,6 +2247,7 @@ "create-neon": "dist/src/bin/create-neon.js" }, "devDependencies": { + "@tsconfig/node18": "^18.2.2", "@types/chai": "^4.3.11", "@types/mocha": "^10.0.6", "@types/node": "^20.10.1", diff --git a/pkgs/create-neon/package.json b/pkgs/create-neon/package.json index 11e240c0a..d0d451213 100644 --- a/pkgs/create-neon/package.json +++ b/pkgs/create-neon/package.json @@ -30,6 +30,7 @@ "neon" ], "devDependencies": { + "@tsconfig/node18": "^18.2.2", "@types/chai": "^4.3.11", "@types/mocha": "^10.0.6", "@types/node": "^20.10.1", diff --git a/pkgs/create-neon/src/bin/create-neon.ts b/pkgs/create-neon/src/bin/create-neon.ts index b8367469d..53a223972 100644 --- a/pkgs/create-neon/src/bin/create-neon.ts +++ b/pkgs/create-neon/src/bin/create-neon.ts @@ -2,9 +2,9 @@ import { promises as fs } from "fs"; import * as path from "path"; -import die from "../die"; -import Package from "../package"; -import expand from "../expand"; +import die from "../die.js"; +import Package from "../package.js"; +import expand from "../expand.js"; import versions from "../../data/versions.json"; const TEMPLATES: Record = { diff --git a/pkgs/create-neon/src/expand.ts b/pkgs/create-neon/src/expand.ts index 4af0c6a49..57982eb03 100644 --- a/pkgs/create-neon/src/expand.ts +++ b/pkgs/create-neon/src/expand.ts @@ -1,7 +1,7 @@ import { promises as fs } from "fs"; import handlebars from "handlebars"; import * as path from "path"; -import Package from "./package"; +import Package from "./package.js"; const TEMPLATES_DIR = path.join(__dirname, "..", "data", "templates"); diff --git a/pkgs/create-neon/src/package.ts b/pkgs/create-neon/src/package.ts index 57887f310..09e143e64 100644 --- a/pkgs/create-neon/src/package.ts +++ b/pkgs/create-neon/src/package.ts @@ -1,7 +1,7 @@ import { promises as fs } from "fs"; import * as path from "path"; import versions from "../data/versions.json"; -import shell from "./shell"; +import shell from "./shell.js"; const KEYS = [ "name", diff --git a/pkgs/create-neon/tsconfig.json b/pkgs/create-neon/tsconfig.json index cfd67baa2..3dc6d1caf 100644 --- a/pkgs/create-neon/tsconfig.json +++ b/pkgs/create-neon/tsconfig.json @@ -1,15 +1,9 @@ { + "extends": "@tsconfig/node18/tsconfig.json", "compilerOptions": { - "module": "commonjs", - "target": "es6", - "lib": ["es6", "es7"], "allowJs": false, - "sourceMap": false, "outDir": "dist", - - "esModuleInterop": true, - "strict": true, "noImplicitReturns": true, "allowUnreachableCode": false, "noUnusedLocals": true, From 6633fb5858338175a0b6194bb45ed062dc00b1d2 Mon Sep 17 00:00:00 2001 From: David Herman Date: Fri, 8 Dec 2023 19:52:01 -0800 Subject: [PATCH 02/50] generate more modern ES, which unfortunately means we can't as easy import the JSON data with static types --- package-lock.json | 203 +++++++++++++++++++++++- pkgs/create-neon/package.json | 9 +- pkgs/create-neon/src/bin/create-neon.ts | 17 +- pkgs/create-neon/src/expand.ts | 5 +- pkgs/create-neon/src/package.ts | 7 +- pkgs/create-neon/src/versions.ts | 28 ++++ pkgs/create-neon/test/create-neon.ts | 2 +- pkgs/create-neon/tsconfig.json | 9 +- 8 files changed, 255 insertions(+), 25 deletions(-) create mode 100644 pkgs/create-neon/src/versions.ts diff --git a/package-lock.json b/package-lock.json index 128a1a453..c2758d888 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,26 @@ "prettier": "^2.7.1" } }, + "node_modules/@75lb/deep-merge": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@75lb/deep-merge/-/deep-merge-1.1.1.tgz", + "integrity": "sha512-xvgv6pkMGBA6GwdyJbNAnDmfAIR/DfWhrj9jgWh3TY7gRm3KO46x/GPjRg6wJ0nOepwqrNxFfojebh0Df4h4Tw==", + "dependencies": { + "lodash.assignwith": "^4.2.0", + "typical": "^7.1.1" + }, + "engines": { + "node": ">=12.17" + } + }, + "node_modules/@75lb/deep-merge/node_modules/typical": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/typical/-/typical-7.1.1.tgz", + "integrity": "sha512-T+tKVNs6Wu7IWiAce5BgMd7OZfNYUndHwc5MknN+UHOudi7sGZzuHdCadllRuqJ3fPtgFtIH9+lt9qRv6lmpfA==", + "engines": { + "node": ">=12.17" + } + }, "node_modules/@electron/get": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@electron/get/-/get-2.0.3.tgz", @@ -97,6 +117,18 @@ "integrity": "sha512-qQR1dr2rGIHYlJulmr8Ioq3De0Le9E4MJ5AiaeAETJJpndT1uUNHsGFK3L/UIu+rbkQSdj8J/w2bCsBZc/Y5fQ==", "dev": true }, + "node_modules/@types/command-line-args": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/command-line-args/-/command-line-args-5.2.3.tgz", + "integrity": "sha512-uv0aG6R0Y8WHZLTamZwtfsDLVRnOa+n+n5rEvFWL5Na5gZ8V2Teab/duDPFzIIIhs9qizDpcavCusCLJZu62Kw==", + "dev": true + }, + "node_modules/@types/command-line-usage": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@types/command-line-usage/-/command-line-usage-5.0.4.tgz", + "integrity": "sha512-BwR5KP3Es/CSht0xqBcUXS3qCAUVXwpRKsV2+arxeb65atasuXG9LykC9Ab10Cw3s2raH92ZqOeILaQbsB2ACg==", + "dev": true + }, "node_modules/@types/http-cache-semantics": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", @@ -168,7 +200,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -198,6 +229,14 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, + "node_modules/array-back": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", + "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", + "engines": { + "node": ">=6" + } + }, "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", @@ -345,7 +384,6 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -357,11 +395,24 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/chalk-template": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/chalk-template/-/chalk-template-0.4.0.tgz", + "integrity": "sha512-/ghrgmhfY8RaSdeo43hNXxpoHAtxdbskUHjPpfqUWGttFgycUhYPGx3YZBCnUCvOa7Doivn1IZec3DEGFoMgLg==", + "dependencies": { + "chalk": "^4.1.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/chalk-template?sponsor=1" + } + }, "node_modules/chalk/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -435,7 +486,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -446,8 +496,51 @@ "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/command-line-args": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", + "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", + "dependencies": { + "array-back": "^3.1.0", + "find-replace": "^3.0.0", + "lodash.camelcase": "^4.3.0", + "typical": "^4.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/command-line-usage": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-7.0.1.tgz", + "integrity": "sha512-NCyznE//MuTjwi3y84QVUGEOT+P5oto1e1Pk/jFPVdPPfsG03qpTIl3yw6etR+v73d0lXsoojRpvbru2sqePxQ==", + "dependencies": { + "array-back": "^6.2.2", + "chalk-template": "^0.4.0", + "table-layout": "^3.0.0", + "typical": "^7.1.1" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/command-line-usage/node_modules/array-back": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", + "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==", + "engines": { + "node": ">=12.17" + } + }, + "node_modules/command-line-usage/node_modules/typical": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/typical/-/typical-7.1.1.tgz", + "integrity": "sha512-T+tKVNs6Wu7IWiAce5BgMd7OZfNYUndHwc5MknN+UHOudi7sGZzuHdCadllRuqJ3fPtgFtIH9+lt9qRv6lmpfA==", + "engines": { + "node": ">=12.17" + } }, "node_modules/concat-map": { "version": "0.0.1", @@ -761,6 +854,17 @@ "node": ">=8" } }, + "node_modules/find-replace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", + "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", + "dependencies": { + "array-back": "^3.0.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -1048,7 +1152,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, "engines": { "node": ">=8" } @@ -1306,6 +1409,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lodash.assignwith": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assignwith/-/lodash.assignwith-4.2.0.tgz", + "integrity": "sha512-ZznplvbvtjK2gMvnQ1BR/zqPFZmS6jbK4p+6Up4xcRYA7yMIwxHCfbTcrYxXKzzqLsQ05eJPVznEW3tuwV7k1g==" + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" + }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -1932,6 +2045,14 @@ "dev": true, "optional": true }, + "node_modules/stream-read-all": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/stream-read-all/-/stream-read-all-3.0.1.tgz", + "integrity": "sha512-EWZT9XOceBPlVJRrYcykW8jyRSZYbkb/0ZK36uLEmoWVO5gxBOnntNTseNzfREsqxqdfEGQrD8SXQ3QWbBmq8A==", + "engines": { + "node": ">=10" + } + }, "node_modules/stream-to-string": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/stream-to-string/-/stream-to-string-1.2.1.tgz", @@ -2018,6 +2139,42 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/table-layout": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-3.0.2.tgz", + "integrity": "sha512-rpyNZYRw+/C+dYkcQ3Pr+rLxW4CfHpXjPDnG7lYhdRoUcZTUt+KEsX+94RGp/aVp/MQU35JCITv2T/beY4m+hw==", + "dependencies": { + "@75lb/deep-merge": "^1.1.1", + "array-back": "^6.2.2", + "command-line-args": "^5.2.1", + "command-line-usage": "^7.0.0", + "stream-read-all": "^3.0.1", + "typical": "^7.1.1", + "wordwrapjs": "^5.1.0" + }, + "bin": { + "table-layout": "bin/cli.js" + }, + "engines": { + "node": ">=12.17" + } + }, + "node_modules/table-layout/node_modules/array-back": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", + "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==", + "engines": { + "node": ">=12.17" + } + }, + "node_modules/table-layout/node_modules/typical": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/typical/-/typical-7.1.1.tgz", + "integrity": "sha512-T+tKVNs6Wu7IWiAce5BgMd7OZfNYUndHwc5MknN+UHOudi7sGZzuHdCadllRuqJ3fPtgFtIH9+lt9qRv6lmpfA==", + "engines": { + "node": ">=12.17" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -2071,6 +2228,14 @@ "node": ">=14.17" } }, + "node_modules/typical": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", + "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", + "engines": { + "node": ">=8" + } + }, "node_modules/uglify-js": { "version": "3.17.4", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", @@ -2118,6 +2283,14 @@ "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==" }, + "node_modules/wordwrapjs": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-5.1.0.tgz", + "integrity": "sha512-JNjcULU2e4KJwUNv6CHgI46UvDGitb6dGryHajXTDiLgg1/RiGoPSDw4kZfYnwGtEXf2ZMeIewDQgFGzkCB2Sg==", + "engines": { + "node": ">=12.17" + } + }, "node_modules/workerpool": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", @@ -2241,6 +2414,9 @@ "version": "0.2.0", "license": "MIT", "dependencies": { + "chalk": "^5.3.0", + "command-line-args": "^5.2.1", + "command-line-usage": "^7.0.1", "handlebars": "^4.7.8" }, "bin": { @@ -2249,6 +2425,8 @@ "devDependencies": { "@tsconfig/node18": "^18.2.2", "@types/chai": "^4.3.11", + "@types/command-line-args": "^5.2.3", + "@types/command-line-usage": "^5.0.4", "@types/mocha": "^10.0.6", "@types/node": "^20.10.1", "chai": "^4.3.10", @@ -2259,6 +2437,17 @@ "typescript": "^5.3.2" } }, + "pkgs/create-neon/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, "test/electron": { "name": "electron-tests", "version": "0.1.0", diff --git a/pkgs/create-neon/package.json b/pkgs/create-neon/package.json index d0d451213..cb39213ed 100644 --- a/pkgs/create-neon/package.json +++ b/pkgs/create-neon/package.json @@ -2,6 +2,8 @@ "name": "create-neon", "version": "0.3.0", "description": "Create Neon projects with no build configuration.", + "type": "module", + "exports": "./dist/src/bin/create-neon.js", "author": "Dave Herman ", "license": "MIT", "bugs": { @@ -16,7 +18,7 @@ "dist/data/**/*" ], "scripts": { - "build": "tsc && cp -r data/templates dist/data", + "build": "tsc && cp -r data/templates dist/data && cp data/*.json dist/data/", "prepublishOnly": "npm run build", "pretest": "npm run build", "test": "mocha", @@ -32,6 +34,8 @@ "devDependencies": { "@tsconfig/node18": "^18.2.2", "@types/chai": "^4.3.11", + "@types/command-line-args": "^5.2.3", + "@types/command-line-usage": "^5.0.4", "@types/mocha": "^10.0.6", "@types/node": "^20.10.1", "chai": "^4.3.10", @@ -42,6 +46,9 @@ "typescript": "^5.3.2" }, "dependencies": { + "chalk": "^5.3.0", + "command-line-args": "^5.2.1", + "command-line-usage": "^7.0.1", "handlebars": "^4.7.8" } } diff --git a/pkgs/create-neon/src/bin/create-neon.ts b/pkgs/create-neon/src/bin/create-neon.ts index 53a223972..1417a7fa1 100644 --- a/pkgs/create-neon/src/bin/create-neon.ts +++ b/pkgs/create-neon/src/bin/create-neon.ts @@ -4,8 +4,17 @@ import { promises as fs } from "fs"; import * as path from "path"; import die from "../die.js"; import Package from "../package.js"; +import { VERSIONS } from '../versions.js'; import expand from "../expand.js"; -import versions from "../../data/versions.json"; +import chalk from 'chalk'; + +function pink(text: string): string { + return chalk.bold.hex('#e75480')(text); +} + +function blue(text: string): string { + return chalk.bold.cyanBright(text); +} const TEMPLATES: Record = { ".gitignore.hbs": ".gitignore", @@ -41,7 +50,7 @@ async function main(name: string) { let target = path.join(tmpFolderName, TEMPLATES[source]); await expand(source, target, { package: pkg, - versions, + versions: VERSIONS, }); } } @@ -56,10 +65,10 @@ async function main(name: string) { if (process.argv.length < 3) { console.error( - "✨ create-neon: Create a new Neon project with zero configuration. ✨" + `✨ ${pink('create-neon:')} Create a new Neon project with zero configuration. ✨` ); console.error(); - console.error("Usage: npm init neon name"); + console.error(`${blue('Usage:')} npm init neon name`); console.error(); console.error( " name The name of your Neon project, placed in a new directory of the same name." diff --git a/pkgs/create-neon/src/expand.ts b/pkgs/create-neon/src/expand.ts index 57982eb03..97c0a3a37 100644 --- a/pkgs/create-neon/src/expand.ts +++ b/pkgs/create-neon/src/expand.ts @@ -3,7 +3,8 @@ import handlebars from "handlebars"; import * as path from "path"; import Package from "./package.js"; -const TEMPLATES_DIR = path.join(__dirname, "..", "data", "templates"); +const TEMPLATES_DIR = new URL(path.join('..', 'data', 'templates', '/'), import.meta.url); +//const TEMPLATES_DIR = path.join(__dirname, "..", "data", "templates"); export interface Versions { neon: string; @@ -20,7 +21,7 @@ export default async function expand( target: string, metadata: Metadata ) { - let template = await fs.readFile(path.join(TEMPLATES_DIR, source), "utf8"); + let template = await fs.readFile(new URL(source, TEMPLATES_DIR), "utf8"); let compiled = handlebars.compile(template, { noEscape: true }); let expanded = compiled(metadata); // The 'wx' flag creates the file but fails if it already exists. diff --git a/pkgs/create-neon/src/package.ts b/pkgs/create-neon/src/package.ts index 09e143e64..e49c2badf 100644 --- a/pkgs/create-neon/src/package.ts +++ b/pkgs/create-neon/src/package.ts @@ -1,7 +1,7 @@ import { promises as fs } from "fs"; import * as path from "path"; -import versions from "../data/versions.json"; import shell from "./shell.js"; +import { VERSIONS } from './versions.js'; const KEYS = [ "name", @@ -38,15 +38,14 @@ export default class Package { version: "0.1.0", main: "index.node", scripts: { - build: - "cargo-cp-artifact -nc index.node -- cargo build --message-format=json-render-diagnostics", + build: "cargo-cp-artifact -nc index.node -- cargo build --message-format=json-render-diagnostics", "build-debug": "npm run build --", "build-release": "npm run build -- --release", install: "npm run build-release", test: "cargo test", }, devDependencies: { - "cargo-cp-artifact": `^${versions["cargo-cp-artifact"]}`, + "cargo-cp-artifact": `^${VERSIONS["cargo-cp-artifact"]}`, }, }; diff --git a/pkgs/create-neon/src/versions.ts b/pkgs/create-neon/src/versions.ts new file mode 100644 index 000000000..32dcc88b9 --- /dev/null +++ b/pkgs/create-neon/src/versions.ts @@ -0,0 +1,28 @@ +import { createRequire } from 'module'; + +type VersionData = { + "neon": string, + "cargo-cp-artifact": string +}; + +function assertIsVersionData(data: unknown): asserts data is VersionData { + if (!data || typeof data !== 'object') { + throw new TypeError("expected object"); + } + if (!('neon' in data)) { + throw new TypeError("required 'neon' property not found"); + } + if (!('cargo-cp-artifact' in data)) { + throw new TypeError("require 'cargo-cp-artifact' property not found"); + } +} + +const dynamicRequire = createRequire(import.meta.url); + +function load(): VersionData { + const data = dynamicRequire('../data/versions.json'); + assertIsVersionData(data); + return data; +} + +export const VERSIONS: VersionData = load(); diff --git a/pkgs/create-neon/test/create-neon.ts b/pkgs/create-neon/test/create-neon.ts index 766dc149b..a5b2911d1 100644 --- a/pkgs/create-neon/test/create-neon.ts +++ b/pkgs/create-neon/test/create-neon.ts @@ -3,7 +3,7 @@ import { spawn } from "child_process"; import * as path from "path"; import { promises as fs } from "fs"; import * as TOML from "toml"; -import expect from "../dev/expect"; +import expect from "../dev/expect.js"; // HACK: `execa` is an ES module, but Neon tests in Node which doesn't include // an ESM loader. This is a small wrapper for `execa` that covers the test cases. diff --git a/pkgs/create-neon/tsconfig.json b/pkgs/create-neon/tsconfig.json index 3dc6d1caf..8765c2e21 100644 --- a/pkgs/create-neon/tsconfig.json +++ b/pkgs/create-neon/tsconfig.json @@ -1,13 +1,10 @@ { "extends": "@tsconfig/node18/tsconfig.json", "compilerOptions": { - "allowJs": false, - "sourceMap": false, + "module": "es2022", + "moduleResolution": "bundler", "outDir": "dist", - "noImplicitReturns": true, - "allowUnreachableCode": false, - "noUnusedLocals": true, - "noUnusedParameters": true, + "noImplicitAny": true, "resolveJsonModule": true }, "include": ["src/**/*", "dev/**/*", "test/**/*"], From f3be15efeed67e0a074aa9bf6f8ae96cdf7d1998 Mon Sep 17 00:00:00 2001 From: David Herman Date: Fri, 8 Dec 2023 20:18:57 -0800 Subject: [PATCH 03/50] consolidate Versions type handling --- pkgs/create-neon/src/expand.ts | 7 +------ pkgs/create-neon/src/versions.ts | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/pkgs/create-neon/src/expand.ts b/pkgs/create-neon/src/expand.ts index 97c0a3a37..7a1ade3cf 100644 --- a/pkgs/create-neon/src/expand.ts +++ b/pkgs/create-neon/src/expand.ts @@ -2,14 +2,9 @@ import { promises as fs } from "fs"; import handlebars from "handlebars"; import * as path from "path"; import Package from "./package.js"; +import { Versions } from './versions.js'; const TEMPLATES_DIR = new URL(path.join('..', 'data', 'templates', '/'), import.meta.url); -//const TEMPLATES_DIR = path.join(__dirname, "..", "data", "templates"); - -export interface Versions { - neon: string; - "cargo-cp-artifact": string; -} export interface Metadata { package: Package; diff --git a/pkgs/create-neon/src/versions.ts b/pkgs/create-neon/src/versions.ts index 32dcc88b9..91f66e622 100644 --- a/pkgs/create-neon/src/versions.ts +++ b/pkgs/create-neon/src/versions.ts @@ -1,28 +1,29 @@ import { createRequire } from 'module'; -type VersionData = { - "neon": string, +export type Versions = { + neon: string, "cargo-cp-artifact": string }; -function assertIsVersionData(data: unknown): asserts data is VersionData { +const KEYS = ['neon', 'cargo-cp-artifact']; + +function assertIsVersions(data: unknown): asserts data is Versions { if (!data || typeof data !== 'object') { throw new TypeError("expected object"); } - if (!('neon' in data)) { - throw new TypeError("required 'neon' property not found"); - } - if (!('cargo-cp-artifact' in data)) { - throw new TypeError("require 'cargo-cp-artifact' property not found"); - } + KEYS.forEach(key => { + if (!(key in data)) { + throw new TypeError(`require '${key}' property not found`); + } + }); } const dynamicRequire = createRequire(import.meta.url); -function load(): VersionData { +function load(): Versions { const data = dynamicRequire('../data/versions.json'); - assertIsVersionData(data); + assertIsVersions(data); return data; } -export const VERSIONS: VersionData = load(); +export const VERSIONS: Versions = load(); From d79a4a6a9ff82075fe6e018cbd035e96d3c87200 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sat, 9 Dec 2023 02:00:05 -0800 Subject: [PATCH 04/50] get the tests passing again with modern TS and modern node versions --- pkgs/create-neon/dev/expect.ts | 8 ++++++-- pkgs/create-neon/test/create-neon.ts | 30 +++++++++++----------------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/pkgs/create-neon/dev/expect.ts b/pkgs/create-neon/dev/expect.ts index b565cd40c..1a4e1a751 100644 --- a/pkgs/create-neon/dev/expect.ts +++ b/pkgs/create-neon/dev/expect.ts @@ -10,8 +10,9 @@ function readChunks(input: Readable): Readable { output.write(decoder.write(data)); }); input.on("close", () => { - output.write(decoder.end()); - output.destroy(); + let end = decoder.end(); + output.write(end || ""); + output.end(); }); return output; } @@ -35,6 +36,9 @@ class LinesBuffer { } add(lines: string[]) { + if (lines.length === 0) { + return; + } if (isCompleteLine(lines[lines.length - 1])) { lines.push(""); } diff --git a/pkgs/create-neon/test/create-neon.ts b/pkgs/create-neon/test/create-neon.ts index a5b2911d1..b759993e2 100644 --- a/pkgs/create-neon/test/create-neon.ts +++ b/pkgs/create-neon/test/create-neon.ts @@ -1,20 +1,14 @@ -import { assert } from "chai"; -import { spawn } from "child_process"; -import * as path from "path"; -import { promises as fs } from "fs"; -import * as TOML from "toml"; -import expect from "../dev/expect.js"; - -// HACK: `execa` is an ES module, but Neon tests in Node which doesn't include -// an ESM loader. This is a small wrapper for `execa` that covers the test cases. -async function execa(command: string, args: readonly string[]): Promise { - const { execa } = await import("execa"); - - await execa(command, args); -} +import { assert } from 'chai'; +import { spawn } from 'child_process'; +import * as path from 'path'; +import { promises as fs } from 'fs'; +import * as TOML from 'toml'; +import expect from '../dev/expect.js'; +import { execa } from 'execa'; +import { fileURLToPath } from 'url'; const NODE: string = process.execPath; -const CREATE_NEON = path.join(__dirname, "..", "src", "bin", "create-neon.js"); +const CREATE_NEON = fileURLToPath(new URL(path.join('..', 'src', 'bin', 'create-neon.js'), import.meta.url)); describe("Command-line argument validation", () => { it("requires an argument", async () => { @@ -40,7 +34,7 @@ const PROJECT = "create-neon-test-project"; describe("Project creation", () => { afterEach(async () => { - await fs.rmdir(PROJECT, { recursive: true, maxRetries: 3 }); + await fs.rm(PROJECT, { recursive: true, maxRetries: 3 }); }); it("succeeds with all default answers", async () => { @@ -69,7 +63,7 @@ describe("Project creation", () => { assert.strictEqual(json.main, "index.node"); assert.strictEqual(json.version, "0.1.0"); assert.strictEqual(json.scripts.test, "cargo test"); - assert.strictEqual(json.license, "ISC"); + assert.isString(json.license); assert.strictEqual(json.description, ""); assert.strictEqual(json.author, ""); @@ -79,7 +73,7 @@ describe("Project creation", () => { assert.strictEqual(toml.package.name, PROJECT); assert.strictEqual(toml.package.version, "0.1.0"); - assert.strictEqual(toml.package.license, "ISC"); + assert.strictEqual(toml.package.license, json.license); assert.deepEqual(toml.lib["crate-type"], ["cdylib"]); }); From aa6ce0f357f6d00a807d72f3a447ca5307902536 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sat, 9 Dec 2023 02:00:33 -0800 Subject: [PATCH 05/50] single quotes for imports --- pkgs/create-neon/src/bin/create-neon.ts | 10 +++++----- pkgs/create-neon/src/die.ts | 2 +- pkgs/create-neon/src/expand.ts | 8 ++++---- pkgs/create-neon/src/package.ts | 6 +++--- pkgs/create-neon/src/shell.ts | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pkgs/create-neon/src/bin/create-neon.ts b/pkgs/create-neon/src/bin/create-neon.ts index 1417a7fa1..6c935a6d2 100644 --- a/pkgs/create-neon/src/bin/create-neon.ts +++ b/pkgs/create-neon/src/bin/create-neon.ts @@ -1,11 +1,11 @@ #!/usr/bin/env node -import { promises as fs } from "fs"; -import * as path from "path"; -import die from "../die.js"; -import Package from "../package.js"; +import { promises as fs } from 'fs'; +import * as path from 'path'; +import die from '../die.js'; +import Package from '../package.js'; import { VERSIONS } from '../versions.js'; -import expand from "../expand.js"; +import expand from '../expand.js'; import chalk from 'chalk'; function pink(text: string): string { diff --git a/pkgs/create-neon/src/die.ts b/pkgs/create-neon/src/die.ts index b1b34f0a7..31f066c41 100644 --- a/pkgs/create-neon/src/die.ts +++ b/pkgs/create-neon/src/die.ts @@ -1,4 +1,4 @@ -import { promises as fs } from "fs"; +import { promises as fs } from 'fs'; function deleteNeonDir(dir: string): Promise { return fs.rm(dir, { force: true, recursive: true }); diff --git a/pkgs/create-neon/src/expand.ts b/pkgs/create-neon/src/expand.ts index 7a1ade3cf..da4026b90 100644 --- a/pkgs/create-neon/src/expand.ts +++ b/pkgs/create-neon/src/expand.ts @@ -1,7 +1,7 @@ -import { promises as fs } from "fs"; -import handlebars from "handlebars"; -import * as path from "path"; -import Package from "./package.js"; +import { promises as fs } from 'fs'; +import handlebars from 'handlebars'; +import * as path from 'path'; +import Package from './package.js'; import { Versions } from './versions.js'; const TEMPLATES_DIR = new URL(path.join('..', 'data', 'templates', '/'), import.meta.url); diff --git a/pkgs/create-neon/src/package.ts b/pkgs/create-neon/src/package.ts index e49c2badf..743a60b12 100644 --- a/pkgs/create-neon/src/package.ts +++ b/pkgs/create-neon/src/package.ts @@ -1,6 +1,6 @@ -import { promises as fs } from "fs"; -import * as path from "path"; -import shell from "./shell.js"; +import { promises as fs } from 'fs'; +import * as path from 'path'; +import shell from './shell.js'; import { VERSIONS } from './versions.js'; const KEYS = [ diff --git a/pkgs/create-neon/src/shell.ts b/pkgs/create-neon/src/shell.ts index ec061ea44..c7e3db15f 100644 --- a/pkgs/create-neon/src/shell.ts +++ b/pkgs/create-neon/src/shell.ts @@ -1,6 +1,6 @@ -import { spawn } from "child_process"; -import { promises as fs } from "fs"; -import path from "path"; +import { spawn } from 'child_process'; +import { promises as fs } from 'fs'; +import path from 'path'; /** * Transparently shell out to an executable with a list of arguments. From bdf24a9538afc2bc65fbf7b683964a94ddfb4f65 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sat, 9 Dec 2023 02:04:18 -0800 Subject: [PATCH 06/50] simplify unnecessary type test that I added during debugging --- pkgs/create-neon/dev/expect.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/create-neon/dev/expect.ts b/pkgs/create-neon/dev/expect.ts index 1a4e1a751..9cd96b572 100644 --- a/pkgs/create-neon/dev/expect.ts +++ b/pkgs/create-neon/dev/expect.ts @@ -10,8 +10,7 @@ function readChunks(input: Readable): Readable { output.write(decoder.write(data)); }); input.on("close", () => { - let end = decoder.end(); - output.write(end || ""); + output.write(decoder.end()); output.end(); }); return output; From 827016b39e2558b1d2bc0ab8124d77a5dcc1f6a4 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sat, 9 Dec 2023 02:14:58 -0800 Subject: [PATCH 07/50] add top-level comment explaining the versions.ts wrapper module --- pkgs/create-neon/src/versions.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/create-neon/src/versions.ts b/pkgs/create-neon/src/versions.ts index 91f66e622..5de9bd195 100644 --- a/pkgs/create-neon/src/versions.ts +++ b/pkgs/create-neon/src/versions.ts @@ -1,3 +1,14 @@ +// This whole module is a bummer but was the best I could figure out since: +// - Using @sindresorhus packages like 'chalk' and 'execa' forces a project to use Node's native ESM support. +// - This means the tsconfig must generate a modern format like es2022. +// - When generating ESM, TS doesn't support importing JSON files with static typing without import assertions. +// - Import assertions are not yet stable in Node, and produce an instability warning. +// +// So for the time being, this module simply implements the static typing explicitly. +// If and when TS adds back and way to infer the static types when importing a JSON file +// and generates a stable format that Node doesn't complain about, we can eliminate this +// boilerplate wrapper module. + import { createRequire } from 'module'; export type Versions = { From 7804e07c91516e6780740e0ae5eddafe816caf43 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 7 Jan 2024 11:15:24 -0800 Subject: [PATCH 08/50] WIP --- .../create-neon/data/templates/.gitignore.hbs | 5 + .../create-neon/data/templates/.npmignore.hbs | 3 + pkgs/create-neon/data/templates/README.md.hbs | 73 +++-- .../data/templates/ci/github/publish.yml.hbs | 268 ++++++++++++++++++ .../data/templates/ci/github/test.yml.hbs | 49 ++++ .../data/templates/package.json.hbs | 63 ++++ .../data/templates/ts/index.cts.hbs | 7 + .../data/templates/ts/index.mts.hbs | 1 + .../data/templates/ts/load.cts.hbs | 1 + .../data/templates/tsconfig.json.hbs | 13 + pkgs/create-neon/data/versions.json | 18 +- pkgs/create-neon/src/bin/create-neon.ts | 125 ++++---- pkgs/create-neon/src/cache.ts | 3 + pkgs/create-neon/src/cache/npm.ts | 9 + pkgs/create-neon/src/ci.ts | 3 + pkgs/create-neon/src/ci/github.ts | 15 + pkgs/create-neon/src/expand.ts | 6 + pkgs/create-neon/src/index.ts | 59 ++++ pkgs/create-neon/src/print.ts | 79 ++++++ 19 files changed, 719 insertions(+), 81 deletions(-) create mode 100644 pkgs/create-neon/data/templates/.npmignore.hbs create mode 100644 pkgs/create-neon/data/templates/ci/github/publish.yml.hbs create mode 100644 pkgs/create-neon/data/templates/ci/github/test.yml.hbs create mode 100644 pkgs/create-neon/data/templates/package.json.hbs create mode 100644 pkgs/create-neon/data/templates/ts/index.cts.hbs create mode 100644 pkgs/create-neon/data/templates/ts/index.mts.hbs create mode 100644 pkgs/create-neon/data/templates/ts/load.cts.hbs create mode 100644 pkgs/create-neon/data/templates/tsconfig.json.hbs create mode 100644 pkgs/create-neon/src/cache.ts create mode 100644 pkgs/create-neon/src/cache/npm.ts create mode 100644 pkgs/create-neon/src/ci.ts create mode 100644 pkgs/create-neon/src/ci/github.ts create mode 100644 pkgs/create-neon/src/index.ts create mode 100644 pkgs/create-neon/src/print.ts diff --git a/pkgs/create-neon/data/templates/.gitignore.hbs b/pkgs/create-neon/data/templates/.gitignore.hbs index 6ca71fb5f..45413ba08 100644 --- a/pkgs/create-neon/data/templates/.gitignore.hbs +++ b/pkgs/create-neon/data/templates/.gitignore.hbs @@ -3,3 +3,8 @@ index.node **/node_modules **/.DS_Store npm-debug.log* +{{#if package.lang.isTypeScript}} +lib +{{/if}} +cargo.log +cross.log diff --git a/pkgs/create-neon/data/templates/.npmignore.hbs b/pkgs/create-neon/data/templates/.npmignore.hbs new file mode 100644 index 000000000..5a00bba56 --- /dev/null +++ b/pkgs/create-neon/data/templates/.npmignore.hbs @@ -0,0 +1,3 @@ +{{#if package.isLibrary}} +platforms +{{/if}} diff --git a/pkgs/create-neon/data/templates/README.md.hbs b/pkgs/create-neon/data/templates/README.md.hbs index e1ac24ae7..3dbffaa7c 100644 --- a/pkgs/create-neon/data/templates/README.md.hbs +++ b/pkgs/create-neon/data/templates/README.md.hbs @@ -6,34 +6,24 @@ {{/if}} This project was bootstrapped by [create-neon](https://www.npmjs.com/package/create-neon). -## Installing {{package.name}} - -Installing {{package.name}} requires a [supported version of Node and Rust](https://github.com/neon-bindings/neon#platform-support). - -You can install the project with npm. In the project directory, run: - -```sh -$ npm install -``` - -This fully installs the project, including installing any dependencies and running the build. - ## Building {{package.name}} -If you have already installed the project and only want to run the build, run: +Building {{package.name}} requires a [supported version of Node and Rust](https://github.com/neon-bindings/neon#platform-support). + +To run the build, run: ```sh $ npm run build ``` -This command uses the [cargo-cp-artifact](https://github.com/neon-bindings/cargo-cp-artifact) utility to run the Rust build and copy the built library into `./index.node`. +This command uses the [@neon-rs/cli](https://github.com/neon-rs/cli) utility to assemble the binary Node addon from the output of `cargo`. ## Exploring {{package.name}} After building {{package.name}}, you can explore its exports at the Node REPL: ```sh -$ npm install +$ npm run build $ node > require('.').hello() "hello node" @@ -43,27 +33,29 @@ $ node In the project directory, you can run: +{{#unless package.isLibrary}} ### `npm install` Installs the project, including running `npm run build`. -### `npm build` +{{/unless}} +### `npm run build` -Builds the Node addon (`index.node`) from source. +Builds the Node addon (`index.node`) from source, generating a release build with `cargo --release`. -Additional [`cargo build`](https://doc.rust-lang.org/cargo/commands/cargo-build.html) arguments may be passed to `npm build` and `npm build-*` commands. For example, to enable a [cargo feature](https://doc.rust-lang.org/cargo/reference/features.html): +Additional [`cargo build`](https://doc.rust-lang.org/cargo/commands/cargo-build.html) arguments may be passed to `npm run build` and similar commands. For example, to enable a [cargo feature](https://doc.rust-lang.org/cargo/reference/features.html): ``` npm run build -- --feature=beetle ``` -#### `npm build-debug` +#### `npm run debug` -Alias for `npm build`. +Similar to `npm run build` but generates a debug build with `cargo`. -#### `npm build-release` +#### `npm run cross` -Same as [`npm build`](#npm-build) but, builds the module with the [`release`](https://doc.rust-lang.org/cargo/reference/profiles.html#release) profile. Release builds will compile slower, but run faster. +Similar to `npm run build` but uses [cross-rs](https://github.com/cross-rs/cross) to cross-compile for another platform. Use the [`CARGO_BUILD_TARGET`](https://doc.rust-lang.org/cargo/reference/config.html#buildtarget) environment variable to select the build target. ### `npm test` @@ -77,7 +69,17 @@ The directory structure of this project is: {{package.name}}/ ├── Cargo.toml ├── README.md +{{#if package.isLibrary}} +├── lib/ +{{#if package.lang.isTypeScript}} +├── ts/ +| ├── index.mts +| └── index.cts +{{/if}} +├── platforms/ +{{else}} ├── index.node +{{/if}} ├── package.json ├── src/ | └── lib.rs @@ -92,12 +94,39 @@ The Cargo [manifest file](https://doc.rust-lang.org/cargo/reference/manifest.htm This file. +{{#if package.isLibrary}} +### lib/ + +{{#if package.lang.isTypeScript}} +The directory containing the generated output from [tsc](https://typescriptlang.org). + +### ts/ + +The directory containing the TypeScript source files. + +### ts/index.mts + +Entry point for when this library is loaded via [ESM `import`](https://nodejs.org/api/esm.html#modules-ecmascript-modules) syntax. + +### ts/index.cts + +Entry point for when this library is loaded via [CJS `require`](https://nodejs.org/api/modules.html#requireid). +{{else}} +The directory containing the JavaScript source files. + +{{/if}} +### platforms/ + +The directory containing distributions of the binary addon backend for each platform supported by this library. + +{{else}} ### index.node The Node addon—i.e., a binary Node module—generated by building the project. This is the main module for this package, as dictated by the `"main"` key in `package.json`. Under the hood, a [Node addon](https://nodejs.org/api/addons.html) is a [dynamically-linked shared object](https://en.wikipedia.org/wiki/Library_(computing)#Shared_libraries). The `"build"` script produces this file by copying it from within the `target/` directory, which is where the Rust build produces the shared object. +{{/if}} ### package.json The npm [manifest file](https://docs.npmjs.com/cli/v7/configuring-npm/package-json), which informs the `npm` command. diff --git a/pkgs/create-neon/data/templates/ci/github/publish.yml.hbs b/pkgs/create-neon/data/templates/ci/github/publish.yml.hbs new file mode 100644 index 000000000..ff315ea4a --- /dev/null +++ b/pkgs/create-neon/data/templates/ci/github/publish.yml.hbs @@ -0,0 +1,268 @@ +name: Publish + +run-name: | + {{#$}} + (github.event_name == 'workflow_dispatch' && inputs.dryrun && 'Dry run') || + (github.event_name == 'workflow_dispatch' && + format('Tag and release: {0}', + (inputs.releaseType == 'custom' && inputs.custom) || inputs.releaseType) + ) || + format('Publish: {0}', github.event.head_commit.message) + {{/$}} + +env: + NODE_VERSION: 18.x + NEON_PLATFORMS_DIR: platforms + ACTIONS_USER: github-actions + ACTIONS_EMAIL: github-actions@github.com + +on: + push: + tags: + - v* + workflow_dispatch: + inputs: + dryrun: + description: 'Dry run (no npm publish)' + required: false + type: boolean + default: true + releaseType: + description: 'Release type (or custom to specify)' + required: true + default: 'patch' + type: choice + options: + - patch + - minor + - major + - prepatch + - preminor + - premajor + - prerelease + - custom + custom: + description: 'Custom version' + required: false + default: '' + +jobs: + setup: + name: Setup + runs-on: ubuntu-latest + permissions: + contents: write + outputs: + action: {{#$}} steps.action.outputs.type {{/$}} + branch: {{#$}} steps.branch.outputs.branch {{/$}} + macOS: {{#$}} steps.matrix.outputs.macOS {{/$}} + Windows: {{#$}} steps.matrix.outputs.Windows {{/$}} + Linux: {{#$}} steps.matrix.outputs.Linux {{/$}} + steps: + - name: Validate Workflow Inputs + if: {{#$}} inputs.releaseType == 'custom' && inputs.custom == '' {{/$}} + shell: bash + run: | + echo '::error::Missing release version number' + exit 1 + - id: action + name: Determine Action Type + shell: bash + run: | + case "{{#$}} github.event_name {{/$}},{{#$}} inputs.dryrun {{/$}}" in + workflow_dispatch,true) type=dryrun ;; + workflow_dispatch,*) type=tag ;; + *) type=publish ;; + esac + echo "type=$type" + echo "type=$type" >> "$GITHUB_OUTPUT" + - name: Validate Secrets + env: + NPM_TOKEN: {{#$}} secrets.NPM_TOKEN {{/$}} + TAG_TOKEN: {{#$}} secrets.TAG_TOKEN {{/$}} + shell: bash + run: | + action={{#$}} steps.action.outputs.type {{/$}} + if [[ $action = publish ]] && [[ -z $NPM_TOKEN ]]; then + echo "::error::Secret NPM_TOKEN is not defined for this GitHub repo." + echo "::error::To publish to npm, this action requires:" + echo "::error:: • an npm access token;" + echo "::error:: • with Read-Write access to this project's npm packages;" + echo "::error:: • stored as a repo secret named NPM_TOKEN." + echo "::error::See https://docs.npmjs.com/about-access-tokens for info about creating npm tokens." + echo "::error::See https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions for info about how to store GitHub repo secrets." + exit 1 + fi + if [[ $action = tag ]] && [[ -z $TAG_TOKEN ]]; then + echo "::error::Secret TAG_TOKEN is not defined for this GitHub repo." + echo "::error::To push a release tag, this action requires:" + echo "::error:: • a GitHub Personal Access Token;" + echo "::error:: • with Read-Write access to this repo;" + echo "::error:: • stored as a repo secret named TAG_TOKEN." + echo "::error::See https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens for info about creating GitHub Personal Access Tokens." + echo "::error::See https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions for info about how to store GitHub repo secrets." + exit 1 + fi + - name: Checkout Code + uses: actions/checkout@{{versions.actions.checkout}} + with: + token: {{#$}} secrets.TAG_TOKEN || github.token {{/$}} + - name: Install Node + uses: actions/setup-node@{{versions.actions.setupNode}} + with: + node-version: {{#$}} env.NODE_VERSION {{/$}} + cache: npm + - name: Compute Default Branch + id: branch + shell: bash + run: | + branch=$(git remote show origin | grep 'HEAD branch' | awk '{ print $3; }') + echo $branch + echo "branch=$branch" >> "$GITHUB_OUTPUT" + - name: Install Dependencies + shell: bash + run: npm ci + - name: Install cargo-messages + shell: bash + run: npm ci + working-directory: ./pkgs/cargo-messages + - name: Trigger Release (manual only) + if: {{#$}} steps.action.outputs.type == 'tag' {{/$}} + shell: bash + run: | + git checkout {{#$}} steps.branch.outputs.branch {{/$}} + git config --global user.name {{#$}} env.ACTIONS_USER {{/$}} + git config --global user.email {{#$}} env.ACTIONS_EMAIL {{/$}} + npm run release -- '{{#$}} (inputs.releaseType == 'custom' && inputs.custom) || inputs.releaseType {{/$}}' + - name: Compute Platform Matrix + id: matrix + shell: bash + run: | + npx @neon-rs/cli ci github + echo "macOS=$(npx @neon-rs/cli ci github | jq -rc .macOS)" >> "$GITHUB_OUTPUT" + echo "Windows=$(npx @neon-rs/cli ci github | jq -rc .Windows)" >> "$GITHUB_OUTPUT" + echo "Linux=$(npx @neon-rs/cli ci github | jq -rc .Linux)" >> "$GITHUB_OUTPUT" + + macos-builds: + name: Builds (macOS) + if: {{#$}} needs.setup.outputs.action != 'tag' {{/$}} + needs: [setup] + strategy: + matrix: + platform: {{#$}} fromJSON(needs.setup.outputs.macOS) {{/$}} + runs-on: macos-latest + permissions: + contents: write + steps: + - name: Checkout Code + uses: actions/checkout@{{versions.actions.checkout}} + with: + fetch-depth: 0 + - name: Install Dependencies + shell: bash + run: npm ci + - name: Bump Version (dry-run only) + if: {{#$}} needs.setup.outputs.action == 'dryrun' {{/$}} + shell: bash + run: | + git checkout {{#$}} needs.setup.outputs.branch {{/$}} + git config --global user.name {{#$}} env.ACTIONS_USER {{/$}} + git config --global user.email {{#$}} env.ACTIONS_EMAIL {{/$}} + npm version '{{#$}} (inputs.releaseType == 'custom' && inputs.custom) || inputs.releaseType {{/$}}' -m "[dryrun] v%s" + - name: Build + uses: neon-actions/build@{{versions.actions.neonBuild}} + with: + node-version: {{#$}} env.NODE_VERSION {{/$}} + platform: {{#$}} matrix.platform {{/$}} + github-release: {{#$}} needs.setup.outputs.action == 'publish' {{/$}} + + windows-builds: + name: Builds (Windows) + if: {{#$}} needs.setup.outputs.action != 'tag' {{/$}} + needs: [setup] + strategy: + matrix: + platform: {{#$}} fromJSON(needs.setup.outputs.macOS) {{/$}} + runs-on: windows-latest + permissions: + contents: write + steps: + - name: Checkout Code + uses: actions/checkout@{{versions.actions.checkout}} + with: + fetch-depth: 0 + - name: Install Dependencies + shell: bash + run: npm ci + - name: Bump Version (dry-run only) + if: {{#$}} needs.setup.outputs.action == 'dryrun' {{/$}} + shell: bash + run: | + git checkout {{#$}} needs.setup.outputs.branch {{/$}} + git config --global user.name {{#$}} env.ACTIONS_USER {{/$}} + git config --global user.email {{#$}} env.ACTIONS_EMAIL {{/$}} + npm version '{{#$}} (inputs.releaseType == 'custom' && inputs.custom) || inputs.releaseType {{/$}}' -m "[dryrun] v%s" + - name: Build + uses: neon-actions/build@{{versions.actions.neonBuild}} + with: + node-version: {{#$}} env.NODE_VERSION {{/$}} + platform: {{#$}} matrix.platform {{/$}} + github-release: {{#$}} needs.setup.outputs.action == 'publish' {{/$}} + + other-builds: + name: Builds (other platforms) + if: {{#$}} needs.setup.outputs.action != 'tag' {{/$}} + needs: [setup] + strategy: + matrix: + platform: {{#$}} fromJSON(needs.setup.outputs.Linux) {{/$}} + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout Code + uses: actions/checkout@{{versions.actions.checkout}} + with: + fetch-depth: 0 + - name: Install Dependencies + shell: bash + run: npm ci + - name: Bump Version (dry-run only) + if: {{#$}} needs.setup.outputs.action == 'dryrun' {{/$}} + shell: bash + run: | + git checkout {{#$}} needs.setup.outputs.branch {{/$}} + git config --global user.name {{#$}} env.ACTIONS_USER {{/$}} + git config --global user.email {{#$}} env.ACTIONS_EMAIL {{/$}} + npm version '{{#$}} (inputs.releaseType == 'custom' && inputs.custom) || inputs.releaseType {{/$}}' -m "[dryrun] v%s" + - name: Build + uses: neon-actions/build@{{versions.actions.neonBuild}} + with: + node-version: {{#$}} env.NODE_VERSION {{/$}} + use-cross: true + platform: {{#$}} matrix.platform {{/$}} + github-release: {{#$}} needs.setup.outputs.action == 'publish' {{/$}} + + publish: + name: Publish + if: {{#$}} needs.setup.outputs.action == 'publish' {{/$}} + needs: [macos-builds, windows-builds, other-builds] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout Code + uses: actions/checkout@{{versions.actions.checkout}} + with: + fetch-depth: 0 + - name: Install Dependencies + shell: bash + run: npm ci + - name: Publish + uses: neon-actions/publish@{{versions.actions.neonPublish}} + env: + NODE_AUTH_TOKEN: {{#$}} secrets.NPM_TOKEN {{/$}} + with: + node-version: {{#$}} env.NODE_VERSION {{/$}} + fetch-binaries: "*.tgz" + github-release: true diff --git a/pkgs/create-neon/data/templates/ci/github/test.yml.hbs b/pkgs/create-neon/data/templates/ci/github/test.yml.hbs new file mode 100644 index 000000000..ab23c5d09 --- /dev/null +++ b/pkgs/create-neon/data/templates/ci/github/test.yml.hbs @@ -0,0 +1,49 @@ +name: Test + +run-name: | + {{#$}} + format('Test ({0}): {1}', + (github.event_name == 'pull_request' && 'PR') || 'push', + github.event.head_commit.message + ) + {{/$}} + +env: + NODE_VERSION: {{versions.node}}.x + NEON_PLATFORMS_DIR: platforms + +on: + push: + # Prevent duplicate runs of this workflow on internal PRs. + branches: + - main + pull_request: + types: [opened, synchronize, reopened, labeled] + branches: + - main + +jobs: + unit-tests: + name: Unit Tests + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@{{versions.actions.checkout}} + with: + fetch-depth: 0 + - name: Install Node + uses: actions/setup-node@{{versions.actions.setupNode}} + with: + node-version: {{#$}}env.NODE_VERSION{{/$}} + cache: npm + - name: Install Rust + uses: actions-rs/toolchain@{{versions.actions.setupRust}} + - name: Install Dependencies + shell: bash + run: npm ci --verbose + - name: Build + shell: bash + run: npm run debug + - name: Test + shell: bash + run: npm test diff --git a/pkgs/create-neon/data/templates/package.json.hbs b/pkgs/create-neon/data/templates/package.json.hbs new file mode 100644 index 000000000..bfa83b364 --- /dev/null +++ b/pkgs/create-neon/data/templates/package.json.hbs @@ -0,0 +1,63 @@ + +{ + "name": "{{package.name}}", + "version": "{{package.version}}", +{{#if package.isLibrary}} +{{#if package.module.isESM}} + "exports": { + ".": { + "import": { + "types": "./lib/index.d.mts", + "default": "./lib/index.mjs" + }, + "require": { + "types": "./lib/index.d.cts", + "default": "./lib/index.cjs" + } + } + }, +{{/if}} + "types": "./lib/index.d.cts", + "main": "./lib/index.cjs", + "files": [ + "lib/**/*.cjs", + "lib/**/*.d.cts", + "lib/**/*.mjs", + "lib/**/*.d.mts", + "lib/**/*.js", + "lib/**/*.d.ts" + ], + "neon": { + "type": "library", + "org": "{{package.org}}", + "platforms": {}, + "load": "./ts/load.cts" + }, +{{#else}} + "main": "index.node", +{{/if}} + "scripts": { + "test": "{{#if package.lang.isTypeScript}}tsc && {{/if}}cargo test", + "cargo-build": "{{#if package.lang.isTypeScript}}tsc && {{/if}}cargo build --message-format=json > cargo.log", + "cross-build": "{{#if package.lang.isTypeScript}}tsc && {{/if}}cross build --message-format=json > cross.log", + "postcargo-build": "neon dist < cargo.log", + "postcross-build": "neon dist -m /target < cross.log", + "debug": "npm run cargo-build --", + "build": "npm run cargo-build -- --release", + "cross": "npm run cross-build -- --release"{{#if package.isLibrary}}, + "prepack": "neon update-platforms", + "version": "neon bump --binaries platforms && git add .", + "release": "npm version -m 'v%s'", + "postrelease": "git push --follow-tags", + "dryrun": "gh workflow run publish.yml -f dryrun=true"{{/if}} + }, + "devDependencies": { + "@neon-rs/cli": "{{versions.neonCLI}}"{{#if package.lang.isTypeScript}}, + "@tsconfig/node{{versions.tsconfigNode.major}}": "^{{versions.tsconfigNode.semver}}", + "@types/node": "^{{versions.typesNode}}", + "typescript": "^{{versions.typescript}}"{{/if}} + }{{#if package.isLibrary}}, + "dependencies": { + "@neon-rs/load": "{{versions.neonLoad}}" + }{{/if}} +} diff --git a/pkgs/create-neon/data/templates/ts/index.cts.hbs b/pkgs/create-neon/data/templates/ts/index.cts.hbs new file mode 100644 index 000000000..92d36d576 --- /dev/null +++ b/pkgs/create-neon/data/templates/ts/index.cts.hbs @@ -0,0 +1,7 @@ +const addon = require('./load.cjs'); + +export type Greeting = "hello node"; + +export function hello(): Greeting { + return addon.hello(); +} diff --git a/pkgs/create-neon/data/templates/ts/index.mts.hbs b/pkgs/create-neon/data/templates/ts/index.mts.hbs new file mode 100644 index 000000000..8777f29df --- /dev/null +++ b/pkgs/create-neon/data/templates/ts/index.mts.hbs @@ -0,0 +1 @@ +export { hello, Greeting } from './index.cjs'; diff --git a/pkgs/create-neon/data/templates/ts/load.cts.hbs b/pkgs/create-neon/data/templates/ts/load.cts.hbs new file mode 100644 index 000000000..962910b43 --- /dev/null +++ b/pkgs/create-neon/data/templates/ts/load.cts.hbs @@ -0,0 +1 @@ +module.exports = require('@neon-rs/load').proxy({}); diff --git a/pkgs/create-neon/data/templates/tsconfig.json.hbs b/pkgs/create-neon/data/templates/tsconfig.json.hbs new file mode 100644 index 000000000..9866d086d --- /dev/null +++ b/pkgs/create-neon/data/templates/tsconfig.json.hbs @@ -0,0 +1,13 @@ +{ +{{#if package.lang.isTypeScript}} + "extends": "@tsconfig/node{{versions.tsconfigNode.major}}/tsconfig.json", + "compilerOptions": { + "module": "node{{versions.tsconfigNode.module}}", + "declaration": true, + "outDir": "lib", + }, + "exclude": ["lib"] +{{else}} + "extends": "@tsconfig/node{{versions.tsconfigNode.major}}/tsconfig.json" +{{/if}} +} diff --git a/pkgs/create-neon/data/versions.json b/pkgs/create-neon/data/versions.json index e3fba49aa..f89023490 100644 --- a/pkgs/create-neon/data/versions.json +++ b/pkgs/create-neon/data/versions.json @@ -1,4 +1,20 @@ { "neon": "1", - "cargo-cp-artifact": "0.1" + "neonCLI": "0.0.185", + "neonLoad": "0.0.185", + "typescript": "5", + "typesNode": "20", + "tsconfigNode": { + "major": "18", + "semver": "18", + "module": "16" + }, + "node": "18", + "actions": { + "checkout": "v3", + "setupNode": "v3", + "setupRust": "v1", + "neonBuild": "v0.9", + "neonPublish": "v0.4.1" + } } diff --git a/pkgs/create-neon/src/bin/create-neon.ts b/pkgs/create-neon/src/bin/create-neon.ts index 6c935a6d2..98344e1f8 100644 --- a/pkgs/create-neon/src/bin/create-neon.ts +++ b/pkgs/create-neon/src/bin/create-neon.ts @@ -1,20 +1,13 @@ #!/usr/bin/env node -import { promises as fs } from 'fs'; import * as path from 'path'; -import die from '../die.js'; -import Package from '../package.js'; -import { VERSIONS } from '../versions.js'; -import expand from '../expand.js'; -import chalk from 'chalk'; - -function pink(text: string): string { - return chalk.bold.hex('#e75480')(text); -} - -function blue(text: string): string { - return chalk.bold.cyanBright(text); -} +import commandLineArgs from 'command-line-args'; +import { printErrorWithUsage } from '../print.js'; +import { createNeon } from '../index.js'; +import { Cache } from '../cache.js'; +import { NPM } from '../cache/npm.js'; +import { CI } from '../ci.js'; +import { GitHub } from '../ci/github.js'; const TEMPLATES: Record = { ".gitignore.hbs": ".gitignore", @@ -23,58 +16,74 @@ const TEMPLATES: Record = { "lib.rs.hbs": path.join("src", "lib.rs"), }; -async function main(name: string) { - let tmpFolderName: string = ""; +const OPTIONS = [ + { name: 'lib', type: Boolean, defaultValue: false }, + { name: 'bins', type: String, defaultValue: 'none' }, + { name: 'platform', type: String, multiple: true, defaultValue: [] }, + { name: 'ci', alias: 'c', type: String, defaultValue: 'github' } +]; - try { - // pretty lightweight way to check both that folder doesn't exist and - // that the user has write permissions. - await fs.mkdir(name); - await fs.rmdir(name); +try { + const opts = commandLineArgs(OPTIONS, { stopAtFirstUnknown: true }); - tmpFolderName = await fs.mkdtemp(`${name}-`); - } catch (err: any) { - await die(`Could not create \`${name}\`: ${err.message}`, tmpFolderName); + if (!opts._unknown || opts._unknown.length === 0) { + throw new Error('No package name given'); } - let pkg: Package | undefined; - - try { - pkg = await Package.create(name, tmpFolderName); - await fs.mkdir(path.join(tmpFolderName, "src")); - } catch (err: any) { - await die("Could not create `package.json`: " + err.message, tmpFolderName); - } - if (pkg) { - for (let source of Object.keys(TEMPLATES)) { - let target = path.join(tmpFolderName, TEMPLATES[source]); - await expand(source, target, { - package: pkg, - versions: VERSIONS, - }); - } + if (opts._unknown.length > 1) { + throw new Error(`unexpected argument (${opts._unknown[1]})`); } - try { - await fs.rename(tmpFolderName, name); - } catch (err: any) { - await die(`Could not create \`${name}\`: ${err.message}`, tmpFolderName); + const [pkg] = opts._unknown; + const platforms = parsePlatforms(opts.platform); + const cache = parseCache(opts.lib, opts.bins, pkg); + const ci = parseCI(opts.ci); + + createNeon(pkg, { + templates: TEMPLATES, + library: opts.lib, + cache, + ci, + platforms + }); +} catch (e) { + printErrorWithUsage(e); + process.exit(1); +} + +function parsePlatforms(platforms: string[]): string | string[] | undefined { + if (platforms.length === 0) { + return undefined; + } else if (platforms.length === 1) { + return platforms[0]; + } else { + return platforms; } - console.log(`✨ Created Neon project \`${name}\`. Happy 🦀 hacking! ✨`); } -if (process.argv.length < 3) { - console.error( - `✨ ${pink('create-neon:')} Create a new Neon project with zero configuration. ✨` - ); - console.error(); - console.error(`${blue('Usage:')} npm init neon name`); - console.error(); - console.error( - " name The name of your Neon project, placed in a new directory of the same name." - ); - console.error(); - process.exit(1); +function parseCI(ci: string): CI | undefined { + switch (ci) { + case 'none': return undefined; + case 'github': return new GitHub(); + default: + throw new Error(`Unrecognized CI system ${ci}, expected 'github' or 'none'`); + } } -main(process.argv[2]); +function parseCache(lib: boolean, bins: string, pkg: string): Cache | undefined { + const defaultOrg = '@' + pkg; + + if (bins === 'none') { + return lib ? new NPM(defaultOrg) : undefined; + } + + if (bins === 'npm') { + return new NPM(defaultOrg); + } + + if (bins.startsWith('npm:')) { + return new NPM(bins.substring(4)); + } + + throw new Error(`Unrecognized binaries cache ${bins}, expected 'npm[:org]' or 'none'`) +} diff --git a/pkgs/create-neon/src/cache.ts b/pkgs/create-neon/src/cache.ts new file mode 100644 index 000000000..2a8dfe91c --- /dev/null +++ b/pkgs/create-neon/src/cache.ts @@ -0,0 +1,3 @@ +export interface Cache { + +} diff --git a/pkgs/create-neon/src/cache/npm.ts b/pkgs/create-neon/src/cache/npm.ts new file mode 100644 index 000000000..8d6f6dc12 --- /dev/null +++ b/pkgs/create-neon/src/cache/npm.ts @@ -0,0 +1,9 @@ +import { Cache } from '../cache.js'; + +export class NPM implements Cache { + private _org: string | null; + + constructor(org: string | null) { + this._org = org; + } +} diff --git a/pkgs/create-neon/src/ci.ts b/pkgs/create-neon/src/ci.ts new file mode 100644 index 000000000..9103a0077 --- /dev/null +++ b/pkgs/create-neon/src/ci.ts @@ -0,0 +1,3 @@ +export interface CI { + templates(): Record; +} diff --git a/pkgs/create-neon/src/ci/github.ts b/pkgs/create-neon/src/ci/github.ts new file mode 100644 index 000000000..b304c8227 --- /dev/null +++ b/pkgs/create-neon/src/ci/github.ts @@ -0,0 +1,15 @@ +import { CI } from '../ci.js'; +import path from 'node:path'; + +const TEMPLATES: Record = { + "publish.yml.hbs": path.join(".github", "workflows", "publish.yml"), + "test.yml.hbs": path.join(".github", "workflows", "test.yml") +}; + +export class GitHub implements CI { + constructor() { } + + templates(): Record { + return TEMPLATES; + } +} diff --git a/pkgs/create-neon/src/expand.ts b/pkgs/create-neon/src/expand.ts index da4026b90..c252772ed 100644 --- a/pkgs/create-neon/src/expand.ts +++ b/pkgs/create-neon/src/expand.ts @@ -11,6 +11,12 @@ export interface Metadata { versions: Versions; } +function ghaDelegate(this: any, options: handlebars.HelperOptions): handlebars.SafeString { + return new handlebars.SafeString("${{" + options.fn(this) +"}}"); +} + +handlebars.registerHelper('$', ghaDelegate); + export default async function expand( source: string, target: string, diff --git a/pkgs/create-neon/src/index.ts b/pkgs/create-neon/src/index.ts new file mode 100644 index 000000000..706fa6776 --- /dev/null +++ b/pkgs/create-neon/src/index.ts @@ -0,0 +1,59 @@ +import { promises as fs } from 'fs'; +import * as path from 'path'; +import die from './die.js'; +import Package from './package.js'; +import { VERSIONS } from './versions.js'; +import expand from './expand.js'; +import { Cache } from './cache.js'; +import { CI } from './ci.js'; + +export type CreateNeonOptions = { + templates: Record, + library?: boolean, + cache?: Cache, + ci?: CI, + platforms?: string | string[] +}; + +export async function createNeon(name: string, options: CreateNeonOptions) { + options.library ??= false; + options.platforms ??= 'common'; + + let tmpFolderName: string = ""; + + try { + // pretty lightweight way to check both that folder doesn't exist and + // that the user has write permissions. + await fs.mkdir(name); + await fs.rmdir(name); + + tmpFolderName = await fs.mkdtemp(`${name}-`); + } catch (err: any) { + await die(`Could not create \`${name}\`: ${err.message}`, tmpFolderName); + } + + let pkg: Package | undefined; + + try { + pkg = await Package.create(name, tmpFolderName); + await fs.mkdir(path.join(tmpFolderName, "src")); + } catch (err: any) { + await die("Could not create `package.json`: " + err.message, tmpFolderName); + } + if (pkg) { + for (let source of Object.keys(options.templates)) { + let target = path.join(tmpFolderName, options.templates[source]); + await expand(source, target, { + package: pkg, + versions: VERSIONS, + }); + } + } + + try { + await fs.rename(tmpFolderName, name); + } catch (err: any) { + await die(`Could not create \`${name}\`: ${err.message}`, tmpFolderName); + } + console.log(`✨ Created Neon project \`${name}\`. Happy 🦀 hacking! ✨`); +} diff --git a/pkgs/create-neon/src/print.ts b/pkgs/create-neon/src/print.ts new file mode 100644 index 000000000..79dc8f8b8 --- /dev/null +++ b/pkgs/create-neon/src/print.ts @@ -0,0 +1,79 @@ +import commandLineUsage from 'command-line-usage'; +import chalk from 'chalk'; + +function pink(text: string): string { + return chalk.bold.hex('#e75480')(text); +} + +function green(text: string): string { + return chalk.bold.greenBright(text); +} + +function blue(text: string): string { + return chalk.bold.cyanBright(text); +} + +function yellow(text: string): string { + return chalk.bold.yellowBright(text); +} + +function bold(text: string): string { + return chalk.bold(text); +} + +function mainUsage(): string { + const sections = [ + { + content: `✨ ${pink('create-neon:')} create a new Neon project with zero configuration ✨`, + raw: true + }, + { + header: green('Examples:'), + content: [ + `${blue('$')} ${bold('npm init neon my-package')}`, + '', + 'Create a Neon project `my-package`.', + '', + `${blue('$')} ${bold('npm init neon --lib my-lib')}`, + '', + 'Create a Neon library `my-lib`, pre-configured to publish pre-builds for common Node target platforms as binary packages under the `@my-lib` org. The generated project includes GitHub CI/CD actions for testing and publishing.', + '', + `${blue('$')} ${bold('npm init neon --lib my-library --target desktop')}`, + '', + 'Similar but configured to target just common Node desktop platforms.' + ] + }, + { + header: blue('Usage:'), + content: `${blue('$')} npm init neon [--lib] [--bins ] [--ci ] [--target ]* ` + }, + { + header: yellow('Options:'), + content: [ + { name: '--lib', summary: 'Configure package as a library. (Implied defaults: `--bins npm` and `--ci github`)' }, + { name: '--bins npm[:@]', summary: 'Configure for pre-built binaries published to npm. (Default org: )' }, + { name: '--bins none', summary: 'Do not configure for pre-built binaries. (Default)' }, + { name: '--target ', summary: 'May be used to specify one or more targets for pre-built binaries. (Default: common)' }, + { name: '--ci github', summary: 'Generate CI/CD configuration for GitHub Actions. (Default)' }, + { name: '--ci none', summary: 'Do not generate CI/CD configuration.' }, + { name: '', summary: 'Package name.' } + ] + } + ]; + + return commandLineUsage(sections).trim(); +} + +export function printMainUsage() { + console.error(mainUsage()); +} + +export function printErrorWithUsage(e: any) { + console.error(mainUsage()); + console.error(); + printError(e); +} + +export function printError(e: any) { + console.error(chalk.bold.red("error:") + " " + ((e instanceof Error) ? e.message : String(e))); +} From 23585f19059dda9b3a3e93c4f58466606c7f5735 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 7 Jan 2024 23:28:39 -0800 Subject: [PATCH 09/50] rename "release" to "remote-publish" to avoid ambiguity with GitHub Releases --- .../data/templates/ci/github/publish.yml.hbs | 24 +++++++++---------- .../data/templates/package.json.hbs | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pkgs/create-neon/data/templates/ci/github/publish.yml.hbs b/pkgs/create-neon/data/templates/ci/github/publish.yml.hbs index ff315ea4a..2386d5d78 100644 --- a/pkgs/create-neon/data/templates/ci/github/publish.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/publish.yml.hbs @@ -4,8 +4,8 @@ run-name: | {{#$}} (github.event_name == 'workflow_dispatch' && inputs.dryrun && 'Dry run') || (github.event_name == 'workflow_dispatch' && - format('Tag and release: {0}', - (inputs.releaseType == 'custom' && inputs.custom) || inputs.releaseType) + format('Trigger publish: {0}', + (inputs.bumpType == 'custom' && inputs.custom) || inputs.bumpType) ) || format('Publish: {0}', github.event.head_commit.message) {{/$}} @@ -27,8 +27,8 @@ on: required: false type: boolean default: true - releaseType: - description: 'Release type (or custom to specify)' + bumpType: + description: 'Version bump type (or custom to specify)' required: true default: 'patch' type: choice @@ -60,10 +60,10 @@ jobs: Linux: {{#$}} steps.matrix.outputs.Linux {{/$}} steps: - name: Validate Workflow Inputs - if: {{#$}} inputs.releaseType == 'custom' && inputs.custom == '' {{/$}} + if: {{#$}} inputs.bumpType == 'custom' && inputs.custom == '' {{/$}} shell: bash run: | - echo '::error::Missing release version number' + echo '::error::No custom version number provided' exit 1 - id: action name: Determine Action Type @@ -95,7 +95,7 @@ jobs: fi if [[ $action = tag ]] && [[ -z $TAG_TOKEN ]]; then echo "::error::Secret TAG_TOKEN is not defined for this GitHub repo." - echo "::error::To push a release tag, this action requires:" + echo "::error::To push a publish tag, this action requires:" echo "::error:: • a GitHub Personal Access Token;" echo "::error:: • with Read-Write access to this repo;" echo "::error:: • stored as a repo secret named TAG_TOKEN." @@ -126,14 +126,14 @@ jobs: shell: bash run: npm ci working-directory: ./pkgs/cargo-messages - - name: Trigger Release (manual only) + - name: Remote Publish (manual only) if: {{#$}} steps.action.outputs.type == 'tag' {{/$}} shell: bash run: | git checkout {{#$}} steps.branch.outputs.branch {{/$}} git config --global user.name {{#$}} env.ACTIONS_USER {{/$}} git config --global user.email {{#$}} env.ACTIONS_EMAIL {{/$}} - npm run release -- '{{#$}} (inputs.releaseType == 'custom' && inputs.custom) || inputs.releaseType {{/$}}' + npm run remote-publish -- '{{#$}} (inputs.bumpType == 'custom' && inputs.custom) || inputs.bumpType {{/$}}' - name: Compute Platform Matrix id: matrix shell: bash @@ -168,7 +168,7 @@ jobs: git checkout {{#$}} needs.setup.outputs.branch {{/$}} git config --global user.name {{#$}} env.ACTIONS_USER {{/$}} git config --global user.email {{#$}} env.ACTIONS_EMAIL {{/$}} - npm version '{{#$}} (inputs.releaseType == 'custom' && inputs.custom) || inputs.releaseType {{/$}}' -m "[dryrun] v%s" + npm version '{{#$}} (inputs.bumpType == 'custom' && inputs.custom) || inputs.bumpType {{/$}}' -m "[dryrun] v%s" - name: Build uses: neon-actions/build@{{versions.actions.neonBuild}} with: @@ -201,7 +201,7 @@ jobs: git checkout {{#$}} needs.setup.outputs.branch {{/$}} git config --global user.name {{#$}} env.ACTIONS_USER {{/$}} git config --global user.email {{#$}} env.ACTIONS_EMAIL {{/$}} - npm version '{{#$}} (inputs.releaseType == 'custom' && inputs.custom) || inputs.releaseType {{/$}}' -m "[dryrun] v%s" + npm version '{{#$}} (inputs.bumpType == 'custom' && inputs.custom) || inputs.bumpType {{/$}}' -m "[dryrun] v%s" - name: Build uses: neon-actions/build@{{versions.actions.neonBuild}} with: @@ -234,7 +234,7 @@ jobs: git checkout {{#$}} needs.setup.outputs.branch {{/$}} git config --global user.name {{#$}} env.ACTIONS_USER {{/$}} git config --global user.email {{#$}} env.ACTIONS_EMAIL {{/$}} - npm version '{{#$}} (inputs.releaseType == 'custom' && inputs.custom) || inputs.releaseType {{/$}}' -m "[dryrun] v%s" + npm version '{{#$}} (inputs.bumpType == 'custom' && inputs.custom) || inputs.bumpType {{/$}}' -m "[dryrun] v%s" - name: Build uses: neon-actions/build@{{versions.actions.neonBuild}} with: diff --git a/pkgs/create-neon/data/templates/package.json.hbs b/pkgs/create-neon/data/templates/package.json.hbs index bfa83b364..66977276b 100644 --- a/pkgs/create-neon/data/templates/package.json.hbs +++ b/pkgs/create-neon/data/templates/package.json.hbs @@ -47,8 +47,8 @@ "cross": "npm run cross-build -- --release"{{#if package.isLibrary}}, "prepack": "neon update-platforms", "version": "neon bump --binaries platforms && git add .", - "release": "npm version -m 'v%s'", - "postrelease": "git push --follow-tags", + "remote-publish": "npm version -m 'v%s'", + "postremote-publish": "git push --follow-tags", "dryrun": "gh workflow run publish.yml -f dryrun=true"{{/if}} }, "devDependencies": { From 3555443edd3ff37bbe02fae7421b7fc4a191abc7 Mon Sep 17 00:00:00 2001 From: David Herman Date: Mon, 26 Feb 2024 08:08:16 -0800 Subject: [PATCH 10/50] Initial version of `npm init neon --lib` - generates necessary boilerplate to be a portable Node library implemented in Rust - uses TS by default (can be disabled) - generates GitHub Actions boilerplate by default (can be disabled) to make publishing push-button --- package-lock.json | 3898 ++++++++++++++++- .../create-neon/data/templates/.gitignore.hbs | 5 +- .../create-neon/data/templates/.npmignore.hbs | 2 +- pkgs/create-neon/data/templates/README.md.hbs | 17 +- .../data/templates/ci/github/.env.hbs | 4 + .../data/templates/ci/github/build.yml.hbs | 124 + .../data/templates/ci/github/comments.yml.hbs | 40 + .../ci/github/manifest/scripts.json.hbs | 5 + .../data/templates/ci/github/publish.yml.hbs | 246 +- .../data/templates/ci/github/test.yml.hbs | 27 +- .../templates/manifest/base/default.json.hbs | 13 + .../templates/manifest/base/library.json.hbs | 44 + .../data/templates/manifest/scripts.json.hbs | 12 + .../data/templates/package.json.hbs | 63 - .../data/templates/ts/load.cts.hbs | 5 +- .../data/templates/tsconfig.json.hbs | 4 +- pkgs/create-neon/data/versions.json | 14 +- pkgs/create-neon/package.json | 7 +- pkgs/create-neon/src/bin/create-neon.ts | 32 +- pkgs/create-neon/src/cache.ts | 2 +- pkgs/create-neon/src/cache/npm.ts | 6 +- pkgs/create-neon/src/ci.ts | 1 + pkgs/create-neon/src/ci/github.ts | 5 + pkgs/create-neon/src/expand.ts | 23 +- pkgs/create-neon/src/index.ts | 81 +- pkgs/create-neon/src/package.ts | 82 +- pkgs/create-neon/src/versions.ts | 28 +- 27 files changed, 4341 insertions(+), 449 deletions(-) create mode 100644 pkgs/create-neon/data/templates/ci/github/.env.hbs create mode 100644 pkgs/create-neon/data/templates/ci/github/build.yml.hbs create mode 100644 pkgs/create-neon/data/templates/ci/github/comments.yml.hbs create mode 100644 pkgs/create-neon/data/templates/ci/github/manifest/scripts.json.hbs create mode 100644 pkgs/create-neon/data/templates/manifest/base/default.json.hbs create mode 100644 pkgs/create-neon/data/templates/manifest/base/library.json.hbs create mode 100644 pkgs/create-neon/data/templates/manifest/scripts.json.hbs delete mode 100644 pkgs/create-neon/data/templates/package.json.hbs diff --git a/package-lock.json b/package-lock.json index c2758d888..dbbd57a69 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,6 +33,741 @@ "node": ">=12.17" } }, + "node_modules/@ampproject/remapping": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", + "dependencies": { + "@babel/highlight": "^7.23.4", + "chalk": "^2.4.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/code-frame/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/code-frame/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/code-frame/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz", + "integrity": "sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.9.tgz", + "integrity": "sha512-5q0175NOjddqpvvzU+kDiSOAk4PfdO6FvwCWoQ6RO7rTzEe8vlo+4HVfcnAREhD4npMs0e9uZypjTwzZPCf/cw==", + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.6", + "@babel/helper-compilation-targets": "^7.23.6", + "@babel/helper-module-transforms": "^7.23.3", + "@babel/helpers": "^7.23.9", + "@babel/parser": "^7.23.9", + "@babel/template": "^7.23.9", + "@babel/traverse": "^7.23.9", + "@babel/types": "^7.23.9", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", + "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", + "dependencies": { + "@babel/types": "^7.23.6", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-annotate-as-pure": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", + "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz", + "integrity": "sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==", + "dependencies": { + "@babel/compat-data": "^7.23.5", + "@babel/helper-validator-option": "^7.23.5", + "browserslist": "^4.22.2", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + }, + "node_modules/@babel/helper-create-class-features-plugin": { + "version": "7.23.10", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.23.10.tgz", + "integrity": "sha512-2XpP2XhkXzgxecPNEEK8Vz8Asj9aRxt08oKOqtiZoqV2UGZ5T+EkyP9sXQ9nwMxBIG34a7jmasVqoMop7VdPUw==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-member-expression-to-functions": "^7.23.0", + "@babel/helper-optimise-call-expression": "^7.22.5", + "@babel/helper-replace-supers": "^7.22.20", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-environment-visitor": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", + "dependencies": { + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.23.0.tgz", + "integrity": "sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA==", + "dependencies": { + "@babel/types": "^7.23.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", + "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", + "dependencies": { + "@babel/types": "^7.22.15" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz", + "integrity": "sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==", + "dependencies": { + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-module-imports": "^7.22.15", + "@babel/helper-simple-access": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/helper-validator-identifier": "^7.22.20" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-optimise-call-expression": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz", + "integrity": "sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==", + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", + "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-replace-supers": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.22.20.tgz", + "integrity": "sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw==", + "dependencies": { + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-member-expression-to-functions": "^7.22.15", + "@babel/helper-optimise-call-expression": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", + "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz", + "integrity": "sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==", + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz", + "integrity": "sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.9.tgz", + "integrity": "sha512-87ICKgU5t5SzOT7sBMfCOZQ2rHjRU+Pcb9BoILMYz600W6DkVRLFBPwQ18gwUVvggqXivaUakpnxWQGbpywbBQ==", + "dependencies": { + "@babel/template": "^7.23.9", + "@babel/traverse": "^7.23.9", + "@babel/types": "^7.23.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/highlight/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/parser": { + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz", + "integrity": "sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==", + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-syntax-flow": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.23.3.tgz", + "integrity": "sha512-YZiAIpkJAwQXBJLIQbRFayR5c+gJ35Vcz3bg954k7cd73zqjvhacJuL9RbrzPz8qPmZdgqP6EUKwy0PCNhaaPA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz", + "integrity": "sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz", + "integrity": "sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-class-properties": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.23.3.tgz", + "integrity": "sha512-uM+AN8yCIjDPccsKGlw271xjJtGii+xQIF/uMPS8H15L12jZTsLfF4o5vNO7d/oUguOyfdikHGc/yi9ge4SGIg==", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.22.15", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-flow-strip-types": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.23.3.tgz", + "integrity": "sha512-26/pQTf9nQSNVJCrLB1IkHUKyPxR+lMrH2QDPG89+Znu9rAMbtrybdbWeE9bb7gzjmE5iXHEY+e0HUwM6Co93Q==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-flow": "^7.23.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.23.3.tgz", + "integrity": "sha512-aVS0F65LKsdNOtcz6FRCpE4OgsP2OFnW46qNxNIX9h3wuzaNcSQsJysuMwqSibC98HPrf2vCgtxKNwS0DAlgcA==", + "dependencies": { + "@babel/helper-module-transforms": "^7.23.3", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-simple-access": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.23.4.tgz", + "integrity": "sha512-jHE9EVVqHKAQx+VePv5LLGHjmHSJR76vawFPTdlxR/LVJPfOEGxREQwQfjuZEOPTwG92X3LINSh3M40Rv4zpVA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-chaining": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.23.4.tgz", + "integrity": "sha512-ZU8y5zWOfjM5vZ+asjgAPwDaBjJzgufjES89Rs4Lpq63O300R/kOz30WCLo6BxxX6QVEilwSlpClnG5cZaikTA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/plugin-syntax-optional-chaining": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-methods": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.23.3.tgz", + "integrity": "sha512-UzqRcRtWsDMTLrRWFvUBDwmw06tCQH9Rl1uAjfh6ijMSmGYQ+fpdB+cnqRC8EMh5tuuxSv0/TejGL+7vyj+50g==", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.22.15", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-typescript": { + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.23.6.tgz", + "integrity": "sha512-6cBG5mBvUu4VUD04OHKnYzbuHNP8huDsD3EDqqpIpsswTDoqHCjLoHb6+QgsV1WsT2nipRqCPgxD3LXnEO7XfA==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-create-class-features-plugin": "^7.23.6", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-typescript": "^7.23.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-flow": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/preset-flow/-/preset-flow-7.23.3.tgz", + "integrity": "sha512-7yn6hl8RIv+KNk6iIrGZ+D06VhVY35wLVf23Cz/mMu1zOr7u4MMP4j0nZ9tLf8+4ZFpnib8cFYgB/oYg9hfswA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-validator-option": "^7.22.15", + "@babel/plugin-transform-flow-strip-types": "^7.23.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-typescript": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.23.3.tgz", + "integrity": "sha512-17oIGVlqz6CchO9RFYn5U6ZpWRZIngayYCtrPRSgANSwC2V1Jb+iP74nVxzzXJte8b8BYxrL1yY96xfhTBrNNQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-validator-option": "^7.22.15", + "@babel/plugin-syntax-jsx": "^7.23.3", + "@babel/plugin-transform-modules-commonjs": "^7.23.3", + "@babel/plugin-transform-typescript": "^7.23.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/register": { + "version": "7.23.7", + "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.23.7.tgz", + "integrity": "sha512-EjJeB6+kvpk+Y5DAkEAmbOBEFkh9OASx0huoEkqYTFxAZHzOAX2Oh5uwAUuL2rUddqfM0SA+KPXV2TbzoZ2kvQ==", + "dependencies": { + "clone-deep": "^4.0.1", + "find-cache-dir": "^2.0.0", + "make-dir": "^2.1.0", + "pirates": "^4.0.6", + "source-map-support": "^0.5.16" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.23.9.tgz", + "integrity": "sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA==", + "dependencies": { + "@babel/code-frame": "^7.23.5", + "@babel/parser": "^7.23.9", + "@babel/types": "^7.23.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.9.tgz", + "integrity": "sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg==", + "dependencies": { + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.6", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.9", + "@babel/types": "^7.23.9", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.9.tgz", + "integrity": "sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==", + "dependencies": { + "@babel/helper-string-parser": "^7.23.4", + "@babel/helper-validator-identifier": "^7.22.20", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@electron/get": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@electron/get/-/get-2.0.3.tgz", @@ -54,6 +789,57 @@ "global-agent": "^3.0.0" } }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.22", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz", + "integrity": "sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@neon-rs/manifest": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@neon-rs/manifest/-/manifest-0.0.4.tgz", + "integrity": "sha512-gyul4RBV5qc/tgNisCs0+4GAholk2vcIB0vgegwKyIW3qNoCkrRKo46N9eSZfUf9RSVS7YBS8CVXLC0CasVJAQ==", + "dependencies": { + "jscodeshift": "^0.15.1" + } + }, "node_modules/@playwright/test": { "version": "1.40.1", "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.40.1.tgz", @@ -129,6 +915,15 @@ "integrity": "sha512-BwR5KP3Es/CSht0xqBcUXS3qCAUVXwpRKsV2+arxeb65atasuXG9LykC9Ab10Cw3s2raH92ZqOeILaQbsB2ACg==", "dev": true }, + "node_modules/@types/handlebars-helpers": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/@types/handlebars-helpers/-/handlebars-helpers-0.5.6.tgz", + "integrity": "sha512-1/7AJ2Amfyfwjfrt9LykeVheFt6tgVb5n+C1v80S/FoH3uJ0RWAjWWIvf6Y6l+FyS1qX+MdQoj5v+f8oVvF/5w==", + "dev": true, + "dependencies": { + "handlebars": ">=4.1.0" + } + }, "node_modules/@types/http-cache-semantics": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", @@ -150,41 +945,272 @@ "integrity": "sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg==", "dev": true }, - "node_modules/@types/node": { - "version": "20.10.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.1.tgz", - "integrity": "sha512-T2qwhjWwGH81vUEx4EXmBKsTJRXFXNZTL4v0gi01+zyBmCwzE6TyHszqX01m+QHTEq+EZNo13NeJIdEqf+Myrg==", - "dev": true, + "node_modules/@types/node": { + "version": "20.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.1.tgz", + "integrity": "sha512-T2qwhjWwGH81vUEx4EXmBKsTJRXFXNZTL4v0gi01+zyBmCwzE6TyHszqX01m+QHTEq+EZNo13NeJIdEqf+Myrg==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/responselike": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz", + "integrity": "sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/yauzl": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", + "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", + "dev": true, + "optional": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/ansi-bgblack": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-bgblack/-/ansi-bgblack-0.1.1.tgz", + "integrity": "sha512-tp8M/NCmSr6/skdteeo9UgJ2G1rG88X3ZVNZWXUxFw4Wh0PAGaAAWQS61sfBt/1QNcwMTY3EBKOMPujwioJLaw==", + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-bgblue": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-bgblue/-/ansi-bgblue-0.1.1.tgz", + "integrity": "sha512-R8JmX2Xv3+ichUQE99oL+LvjsyK+CDWo/BtVb4QUz3hOfmf2bdEmiDot3fQcpn2WAHW3toSRdjSLm6bgtWRDlA==", + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-bgcyan": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-bgcyan/-/ansi-bgcyan-0.1.1.tgz", + "integrity": "sha512-6SByK9q2H978bmqzuzA5NPT1lRDXl3ODLz/DjC4URO5f/HqK7dnRKfoO/xQLx/makOz7zWIbRf6+Uf7bmaPSkQ==", + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-bggreen": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-bggreen/-/ansi-bggreen-0.1.1.tgz", + "integrity": "sha512-8TRtOKmIPOuxjpklrkhUbqD2NnVb4WZQuIjXrT+TGKFKzl7NrL7wuNvEap3leMt2kQaCngIN1ZzazSbJNzF+Aw==", + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-bgmagenta": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-bgmagenta/-/ansi-bgmagenta-0.1.1.tgz", + "integrity": "sha512-UZYhobiGAlV4NiwOlKAKbkCyxOl1PPZNvdIdl/Ce5by45vwiyNdBetwHk/AjIpo1Ji9z+eE29PUBAjjfVmz5SA==", + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-bgred": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-bgred/-/ansi-bgred-0.1.1.tgz", + "integrity": "sha512-BpPHMnYmRBhcjY5knRWKjQmPDPvYU7wrgBSW34xj7JCH9+a/SEIV7+oSYVOgMFopRIadOz9Qm4zIy+mEBvUOPA==", + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-bgwhite": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-bgwhite/-/ansi-bgwhite-0.1.1.tgz", + "integrity": "sha512-KIF19t+HOYOorUnHTOhZpeZ3bJsjzStBG2hSGM0WZ8YQQe4c7lj9CtwnucscJDPrNwfdz6GBF+pFkVfvHBq6uw==", + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-bgyellow": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-bgyellow/-/ansi-bgyellow-0.1.1.tgz", + "integrity": "sha512-WyRoOFSIvOeM7e7YdlSjfAV82Z6K1+VUVbygIQ7C/VGzWYuO/d30F0PG7oXeo4uSvSywR0ozixDQvtXJEorq4Q==", + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-black": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-black/-/ansi-black-0.1.1.tgz", + "integrity": "sha512-hl7re02lWus7lFOUG6zexhoF5gssAfG5whyr/fOWK9hxNjUFLTjhbU/b4UHWOh2dbJu9/STSUv+80uWYzYkbTQ==", + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-blue": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-blue/-/ansi-blue-0.1.1.tgz", + "integrity": "sha512-8Um59dYNDdQyoczlf49RgWLzYgC2H/28W3JAIyOAU/+WkMcfZmaznm+0i1ikrE0jME6Ypk9CJ9CY2+vxbPs7Fg==", + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-bold": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-bold/-/ansi-bold-0.1.1.tgz", + "integrity": "sha512-wWKwcViX1E28U6FohtWOP4sHFyArELHJ2p7+3BzbibqJiuISeskq6t7JnrLisUngMF5zMhgmXVw8Equjzz9OlA==", + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-cyan": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-cyan/-/ansi-cyan-0.1.1.tgz", + "integrity": "sha512-eCjan3AVo/SxZ0/MyIYRtkpxIu/H3xZN7URr1vXVrISxeyz8fUFz0FJziamK4sS8I+t35y4rHg1b2PklyBe/7A==", + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-dim": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-dim/-/ansi-dim-0.1.1.tgz", + "integrity": "sha512-zAfb1fokXsq4BoZBkL0eK+6MfFctbzX3R4UMcoWrL1n2WHewFKentTvOZv2P11u6P4NtW/V47hVjaN7fJiefOg==", + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-gray": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz", + "integrity": "sha512-HrgGIZUl8h2EHuZaU9hTR/cU5nhKxpVE1V6kdGsQ8e4zirElJ5fvtfc8N7Q1oq1aatO275i8pUFUCpNWCAnVWw==", + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-green": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-green/-/ansi-green-0.1.1.tgz", + "integrity": "sha512-WJ70OI4jCaMy52vGa/ypFSKFb/TrYNPaQ2xco5nUwE0C5H8piume/uAZNNdXXiMQ6DbRmiE7l8oNBHu05ZKkrw==", + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-grey": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-grey/-/ansi-grey-0.1.1.tgz", + "integrity": "sha512-+J1nM4lC+whSvf3T4jsp1KR+C63lypb+VkkwtLQMc1Dlt+nOvdZpFT0wwFTYoSlSwCcLUAaOpHF6kPkYpSa24A==", + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-hidden": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-hidden/-/ansi-hidden-0.1.1.tgz", + "integrity": "sha512-8gB1bo9ym9qZ/Obvrse1flRsfp2RE+40B23DhQcKxY+GSeaOJblLnzBOxzvmLTWbi5jNON3as7wd9rC0fNK73Q==", + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-inverse": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-inverse/-/ansi-inverse-0.1.1.tgz", + "integrity": "sha512-Kq8Z0dBRhQhDMN/Rso1Nu9niwiTsRkJncfJZXiyj7ApbfJrGrrubHXqXI37feJZkYcIx6SlTBdNCeK0OQ6X6ag==", "dependencies": { - "undici-types": "~5.26.4" + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/@types/responselike": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz", - "integrity": "sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==", - "dev": true, + "node_modules/ansi-italic": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-italic/-/ansi-italic-0.1.1.tgz", + "integrity": "sha512-jreCxifSAqbaBvcibeQxcwhQDbEj7gF69XnpA6x83qbECEBaRBD1epqskrmov1z4B+zzQuEdwbWxgzvhKa+PkA==", "dependencies": { - "@types/node": "*" + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/@types/yauzl": { - "version": "2.10.3", - "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", - "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", - "dev": true, - "optional": true, + "node_modules/ansi-magenta": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-magenta/-/ansi-magenta-0.1.1.tgz", + "integrity": "sha512-A1Giu+HRwyWuiXKyXPw2AhG1yWZjNHWO+5mpt+P+VWYkmGRpLPry0O5gmlJQEvpjNpl4RjFV7DJQ4iozWOmkbQ==", "dependencies": { - "@types/node": "*" + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true, + "node_modules/ansi-red": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-red/-/ansi-red-0.1.1.tgz", + "integrity": "sha512-ewaIr5y+9CUTGFwZfpECUbFlGcC0GCw1oqR9RI6h1gQCd9Aj2GxSckCnPsVJnmfMZbwFYE+leZGASgkWl06Jow==", + "dependencies": { + "ansi-wrap": "0.1.0" + }, "engines": { - "node": ">=6" + "node": ">=0.10.0" } }, "node_modules/ansi-regex": { @@ -196,6 +1222,28 @@ "node": ">=8" } }, + "node_modules/ansi-reset": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-reset/-/ansi-reset-0.1.1.tgz", + "integrity": "sha512-n+D0qD3B+h/lP0dSwXX1SZMoXufdUVotLMwUuvXa50LtBAh3f+WV8b5nFMfLL/hgoPBUt+rG/pqqzF8krlZKcw==", + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-strikethrough": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-strikethrough/-/ansi-strikethrough-0.1.1.tgz", + "integrity": "sha512-gWkLPDvHH2pC9YEKqp8dIl0mg3sRglMPvioqGDIOXiwxjxUwIJ1gF86E2o4R5yLNh8IAkwHbaMtASkJfkQ2hIA==", + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -210,6 +1258,47 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/ansi-underline": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-underline/-/ansi-underline-0.1.1.tgz", + "integrity": "sha512-D+Bzwio/0/a0Fu5vJzrIT6bFk43TW46vXfSvzysOTEHcXOAUJTVMHWDbELIzGU4AVxVw2rCTb7YyWS4my2cSKQ==", + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-white": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-white/-/ansi-white-0.1.1.tgz", + "integrity": "sha512-DJHaF2SRzBb9wZBgqIJNjjTa7JUJTO98sHeTS1sDopyKKRopL1KpaJ20R6W2f/ZGras8bYyIZDtNwYOVXNgNFg==", + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-wrap": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", + "integrity": "sha512-ZyznvL8k/FZeQHr2T6LzcJ/+vBApDnMNZvfVFy3At0knswWd6rJ3/0Hhmpu8oqa6C92npmozs890sX9Dl6q+Qw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-yellow": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-yellow/-/ansi-yellow-0.1.1.tgz", + "integrity": "sha512-6E3D4BQLXHLl3c/NwirWVZ+BCkMq2qsYxdeAGGOijKrx09FaqU+HktFL6QwAwNvgJiMLnv6AQ2C1gFZx0h1CBg==", + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -229,6 +1318,30 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, + "node_modules/arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/array-back": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", @@ -237,6 +1350,47 @@ "node": ">=6" } }, + "node_modules/array-sort": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/array-sort/-/array-sort-0.1.4.tgz", + "integrity": "sha512-BNcM+RXxndPxiZ2rd76k6nyQLRZr2/B/sdi8pQ+Joafr5AH279L40dfokSUTp8O+AaqYjXWhblBWa2st2nc4fQ==", + "dependencies": { + "default-compare": "^1.0.0", + "get-value": "^2.0.6", + "kind-of": "^5.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-sort/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/assert": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-2.1.0.tgz", + "integrity": "sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw==", + "dependencies": { + "call-bind": "^1.0.2", + "is-nan": "^1.3.2", + "object-is": "^1.1.5", + "object.assign": "^4.1.4", + "util": "^0.12.5" + } + }, "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", @@ -246,11 +1400,84 @@ "node": "*" } }, + "node_modules/assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ast-types": { + "version": "0.16.1", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.16.1.tgz", + "integrity": "sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg==", + "dependencies": { + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "bin": { + "atob": "bin/atob.js" + }, + "engines": { + "node": ">= 4.5.0" + } + }, + "node_modules/autolinker": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/autolinker/-/autolinker-0.28.1.tgz", + "integrity": "sha512-zQAFO1Dlsn69eXaO6+7YZc+v84aquQKbwpzCE3L0stj56ERn9hutFxPopViLjo9G+rWwjozRhgS5KJ25Xy19cQ==", + "dependencies": { + "gulp-header": "^1.7.1" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/babel-core": { + "version": "7.0.0-bridge.0", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-7.0.0-bridge.0.tgz", + "integrity": "sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg==", + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dependencies": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } }, "node_modules/binary-extensions": { "version": "2.2.0", @@ -281,7 +1508,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, "dependencies": { "fill-range": "^7.0.1" }, @@ -295,6 +1521,37 @@ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, + "node_modules/browserslist": { + "version": "4.22.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.3.tgz", + "integrity": "sha512-UAp55yfwNv0klWNapjs/ktHoguxuQNGnOzxYmfnXIS+8AsRDZkSDxg7R1AX3GKzn078SBI5dzwzj/Yx0Or0e3A==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001580", + "electron-to-chromium": "^1.4.648", + "node-releases": "^2.0.14", + "update-browserslist-db": "^1.0.13" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, "node_modules/buffer-crc32": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", @@ -304,6 +1561,30 @@ "node": "*" } }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + }, + "node_modules/cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dependencies": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/cacheable-lookup": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", @@ -346,6 +1627,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/call-bind": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", + "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", + "dependencies": { + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.1", + "set-function-length": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", @@ -358,6 +1652,25 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/caniuse-lite": { + "version": "1.0.30001581", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001581.tgz", + "integrity": "sha512-whlTkwhqV2tUmP3oYhtNfaWGYHDdS3JYFQBKXxcUR9qqPWsRhFHhoISO2Xnl/g0xyKzht9mI1LZpiNWfMzHixQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] + }, "node_modules/cargo-cp-artifact": { "resolved": "pkgs/cargo-cp-artifact", "link": true @@ -459,6 +1772,43 @@ "fsevents": "~2.3.2" } }, + "node_modules/class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dependencies": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/is-descriptor": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "dependencies": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -470,6 +1820,19 @@ "wrap-ansi": "^7.0.0" } }, + "node_modules/clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dependencies": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/clone-response": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", @@ -482,6 +1845,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw==", + "dependencies": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -542,11 +1917,86 @@ "node": ">=12.17" } }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==" + }, + "node_modules/component-emitter": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz", + "integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/concat-with-sourcemaps": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz", + "integrity": "sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg==", + "dependencies": { + "source-map": "^0.6.1" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" + }, + "node_modules/copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "node_modules/create-frame": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/create-frame/-/create-frame-1.0.0.tgz", + "integrity": "sha512-SnJYqAwa5Jon3cP8e3LMFBoRG2m/hX20vtOnC3ynhyAa6jmy+BqrPoicBtmKUutnJuphXPj7C54yOXF58Tl71Q==", + "dependencies": { + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "isobject": "^3.0.0", + "lazy-cache": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/create-frame/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/create-frame/node_modules/is-descriptor": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "dependencies": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } }, "node_modules/create-neon": { "resolved": "pkgs/create-neon", @@ -566,11 +2016,31 @@ "node": ">= 8" } }, + "node_modules/date.js": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/date.js/-/date.js-0.3.3.tgz", + "integrity": "sha512-HgigOS3h3k6HnW011nAb43c5xx5rBXk8P2v/WIT9Zv4koIaVXiH2BURguI78VVp+5Qc076T7OR378JViCnZtBw==", + "dependencies": { + "debug": "~3.1.0" + } + }, + "node_modules/date.js/node_modules/debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/date.js/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -595,6 +2065,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/decode-uri-component": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", + "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", + "engines": { + "node": ">=0.10" + } + }, "node_modules/decompress-response": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", @@ -634,6 +2112,25 @@ "node": ">=6" } }, + "node_modules/default-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/default-compare/-/default-compare-1.0.0.tgz", + "integrity": "sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ==", + "dependencies": { + "kind-of": "^5.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/default-compare/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/defer-to-connect": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", @@ -647,8 +2144,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", - "dev": true, - "optional": true, "dependencies": { "get-intrinsic": "^1.2.1", "gopd": "^1.0.1", @@ -662,8 +2157,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", - "dev": true, - "optional": true, "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", @@ -676,6 +2169,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/detect-node": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", @@ -714,6 +2218,11 @@ "resolved": "test/electron", "link": true }, + "node_modules/electron-to-chromium": { + "version": "1.4.653", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.653.tgz", + "integrity": "sha512-wA2A2LQCqnEwQAvwADQq3KpMpNwgAUBnRmrFgRzHnPhbQUFArTR32Ab46f4p0MovDLcg4uqd4nCsN2hTltslpA==" + }, "node_modules/electron/node_modules/@types/node": { "version": "18.19.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.0.tgz", @@ -738,6 +2247,11 @@ "once": "^1.4.0" } }, + "node_modules/ent": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", + "integrity": "sha512-GHrMyVZQWvTIdDtpiEXdHZnFQKzeO09apj8Cbl4pKWy4i0Oprcq17usfDt5aO63swf0JOeMWjWQE/LzgSRuWpA==" + }, "node_modules/env-paths": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", @@ -747,6 +2261,14 @@ "node": ">=6" } }, + "node_modules/error-symbol": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/error-symbol/-/error-symbol-0.1.0.tgz", + "integrity": "sha512-VyjaKxUmeDX/m2lxm/aknsJ1GWDWUO2Ze2Ad8S1Pb9dykAm9TjSKp5CjrNyltYqZ5W/PO6TInAmO2/BfwMyT1g==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/es6-error": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", @@ -758,7 +2280,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true, "engines": { "node": ">=6" } @@ -775,6 +2296,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/execa": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", @@ -798,6 +2331,88 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==", + "dependencies": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/expand-brackets/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/is-descriptor": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "dependencies": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/expand-brackets/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dependencies": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/extract-zip": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", @@ -833,6 +2448,25 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/falsey": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/falsey/-/falsey-0.3.2.tgz", + "integrity": "sha512-lxEuefF5MBIVDmE6XeqCdM4BWk1+vYmGZtkbKZ/VFcg6uBBw6fXNEbWmxCjDdQlFc9hy450nkiWwM3VAW6G1qg==", + "dependencies": { + "kind-of": "^5.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/falsey/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/fd-slicer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", @@ -846,7 +2480,6 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -854,6 +2487,19 @@ "node": ">=8" } }, + "node_modules/find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/find-replace": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", @@ -890,6 +2536,60 @@ "flat": "cli.js" } }, + "node_modules/flow-parser": { + "version": "0.227.0", + "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.227.0.tgz", + "integrity": "sha512-nOygtGKcX/siZK/lFzpfdHEfOkfGcTW7rNroR1Zsz6T/JxSahPALXVt5qVHq/fgvMJuv096BTKbgxN3PzVBaDA==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg==", + "dependencies": { + "for-in": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA==", + "dependencies": { + "map-cache": "^0.2.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fs-exists-sync": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz", + "integrity": "sha512-cR/vflFyPZtrN6b38ZyWxpWdhlXrzZEBawlpBQMq7033xVY7/kg0GDMBK5jg8lDYQckdJ5x/YC88lM3C7VMsLg==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -907,8 +2607,7 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, "node_modules/fsevents": { "version": "2.3.3", @@ -928,12 +2627,18 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, - "optional": true, "funding": { "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -956,8 +2661,6 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", - "dev": true, - "optional": true, "dependencies": { "function-bind": "^1.1.2", "has-proto": "^1.0.1", @@ -968,6 +2671,48 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-object": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/get-object/-/get-object-0.2.0.tgz", + "integrity": "sha512-7P6y6k6EzEFmO/XyUyFlXm1YLJy9xeA1x/grNV8276abX5GuwUtYgKFkRFkLixw4hf4Pz9q2vgv/8Ar42R0HuQ==", + "dependencies": { + "is-number": "^2.0.2", + "isobject": "^0.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/get-object/node_modules/is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha512-QUzH43Gfb9+5yckcrSA0VBDwEtDUchrk4F6tfJZQuNzDJbEDB9cZNzSfXGQ1jqmdDY/kl41lUOWM9syA8z8jlg==", + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/get-object/node_modules/isobject": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-0.2.0.tgz", + "integrity": "sha512-VaWq6XYAsbvM0wf4dyBO7WH9D7GosB7ZZlqrawI9BBiTMINBeCyqSKBa35m870MY3O4aM31pYyZi9DfGrYMJrQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/get-object/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/get-stream": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", @@ -980,11 +2725,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -1016,7 +2768,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1026,7 +2777,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -1068,6 +2818,14 @@ "node": ">=10" } }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "engines": { + "node": ">=4" + } + }, "node_modules/globalthis": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", @@ -1088,8 +2846,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, - "optional": true, "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -1125,8 +2881,18 @@ "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, + "node_modules/gulp-header": { + "version": "1.8.12", + "resolved": "https://registry.npmjs.org/gulp-header/-/gulp-header-1.8.12.tgz", + "integrity": "sha512-lh9HLdb53sC7XIZOYzTXM4lFuXElv3EVkSDhsd7DoJBj7hm+Ni7D3qYbb+Rr8DuM8nRanBvkVO9d7askreXGnQ==", + "deprecated": "Removed event-stream from gulp-header", + "dependencies": { + "concat-with-sourcemaps": "*", + "lodash.template": "^4.4.0", + "through2": "^2.0.0" + } }, "node_modules/handlebars": { "version": "4.7.8", @@ -1148,6 +2914,76 @@ "uglify-js": "^3.1.4" } }, + "node_modules/handlebars-helper-create-frame": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/handlebars-helper-create-frame/-/handlebars-helper-create-frame-0.1.0.tgz", + "integrity": "sha512-yR99Rh8JYcWSsARw/unaOUUICqG0M+SV3U4vBl3Psn78r0qXjU+cT9+IGXglNuuI3RfahvFDyEQ0l1KWthavRQ==", + "dependencies": { + "create-frame": "^1.0.0", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/handlebars-helpers": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/handlebars-helpers/-/handlebars-helpers-0.10.0.tgz", + "integrity": "sha512-QiyhQz58u/DbuV41VnfpE0nhy6YCH4vB514ajysV8SoKmP+DxU+pR+fahVyNECHj+jiwEN2VrvxD/34/yHaLUg==", + "dependencies": { + "arr-flatten": "^1.1.0", + "array-sort": "^0.1.4", + "create-frame": "^1.0.0", + "define-property": "^1.0.0", + "falsey": "^0.3.2", + "for-in": "^1.0.2", + "for-own": "^1.0.0", + "get-object": "^0.2.0", + "get-value": "^2.0.6", + "handlebars": "^4.0.11", + "handlebars-helper-create-frame": "^0.1.0", + "handlebars-utils": "^1.0.6", + "has-value": "^1.0.0", + "helper-date": "^1.0.1", + "helper-markdown": "^1.0.0", + "helper-md": "^0.2.2", + "html-tag": "^2.0.0", + "is-even": "^1.0.0", + "is-glob": "^4.0.0", + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "lazy-cache": "^2.0.2", + "logging-helpers": "^1.0.0", + "micromatch": "^3.1.4", + "relative": "^3.0.2", + "striptags": "^3.1.0", + "to-gfm-code-block": "^0.1.1", + "year": "^0.2.1" + }, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/handlebars-helpers/node_modules/is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/handlebars-utils": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/handlebars-utils/-/handlebars-utils-1.0.6.tgz", + "integrity": "sha512-d5mmoQXdeEqSKMtQQZ9WkiUcO1E3tPbWxluCK9hVgIDPzQa9WsKo3Lbe/sGflTe7TomHEeZaOgwIkyIr1kfzkw==", + "dependencies": { + "kind-of": "^6.0.0", + "typeof-article": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -1160,8 +2996,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", - "dev": true, - "optional": true, "dependencies": { "get-intrinsic": "^1.2.2" }, @@ -1173,34 +3007,100 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "dev": true, - "optional": true, "engines": { - "node": ">= 0.4" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw==", + "dependencies": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==", + "dependencies": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", + "dependencies": { + "kind-of": "^3.0.2" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "optional": true, + "node_modules/has-values/node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dependencies": { + "is-buffer": "^1.1.5" + }, "engines": { - "node": ">= 0.4" + "node": ">=0.10.0" + } + }, + "node_modules/has-values/node_modules/kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw==", + "dependencies": { + "is-buffer": "^1.1.5" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=0.10.0" } }, "node_modules/hasown": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", - "dev": true, - "optional": true, "dependencies": { "function-bind": "^1.1.2" }, @@ -1217,6 +3117,68 @@ "he": "bin/he" } }, + "node_modules/helper-date": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/helper-date/-/helper-date-1.0.1.tgz", + "integrity": "sha512-wU3VOwwTJvGr/w5rZr3cprPHO+hIhlblTJHD6aFBrKLuNbf4lAmkawd2iK3c6NbJEvY7HAmDpqjOFSI5/+Ey2w==", + "dependencies": { + "date.js": "^0.3.1", + "handlebars-utils": "^1.0.4", + "moment": "^2.18.1" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/helper-markdown": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/helper-markdown/-/helper-markdown-1.0.0.tgz", + "integrity": "sha512-AnDqMS4ejkQK0MXze7pA9TM3pu01ZY+XXsES6gEE0RmCGk5/NIfvTn0NmItfyDOjRAzyo9z6X7YHbHX4PzIvOA==", + "dependencies": { + "handlebars-utils": "^1.0.2", + "highlight.js": "^9.12.0", + "remarkable": "^1.7.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/helper-md": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/helper-md/-/helper-md-0.2.2.tgz", + "integrity": "sha512-49TaQzK+Ic7ZVTq4i1UZxRUJEmAilTk8hz7q4I0WNUaTclLR8ArJV5B3A1fe1xF2HtsDTr2gYKLaVTof/Lt84Q==", + "dependencies": { + "ent": "^2.2.0", + "extend-shallow": "^2.0.1", + "fs-exists-sync": "^0.1.0", + "remarkable": "^1.6.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/highlight.js": { + "version": "9.18.5", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.18.5.tgz", + "integrity": "sha512-a5bFyofd/BHCX52/8i8uJkjr9DYwXIPnM/plwI6W7ezItLGqzt7X2G2nXuYSfsIJdkwwj/g9DG1LkcGJI/dDoA==", + "deprecated": "Support has ended for 9.x series. Upgrade to @latest", + "hasInstallScript": true, + "engines": { + "node": "*" + } + }, + "node_modules/html-tag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/html-tag/-/html-tag-2.0.0.tgz", + "integrity": "sha512-XxzooSo6oBoxBEUazgjdXj7VwTn/iSTSZzTYKzYY6I916tkaYzypHxy+pbVU1h+0UQ9JlVf5XkNQyxOAiiQO1g==", + "dependencies": { + "is-self-closing": "^1.0.1", + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/http-cache-semantics": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", @@ -1245,21 +3207,61 @@ "node": ">=16.17.0" } }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "engines": { + "node": ">=0.8.19" + } + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" } }, + "node_modules/info-symbol": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/info-symbol/-/info-symbol-0.1.0.tgz", + "integrity": "sha512-qkc9wjLDQ+dYYZnY5uJXGNNHyZ0UOMDUnhvy0SEZGVVYmQ5s4i8cPAin2MbU6OxJgi8dfj/AnwqPx0CJE6+Lsw==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/is-accessor-descriptor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.1.tgz", + "integrity": "sha512-YBUanLI8Yoihw923YeFUS5fs0fF2f5TSFTNiYAAzhhDscDa3lEqYuz1pDOEP5KvX94I9ey3vsqjJcLVFVU+3QA==", + "dependencies": { + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/is-binary-path": { "version": "2.1.0", @@ -1273,11 +3275,68 @@ "node": ">=8" } }, + "node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-descriptor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.1.tgz", + "integrity": "sha512-bc4NlCDiCr28U4aEsQ3Qs2491gVq4V8G7MQyws968ImqjKuYtTJXrl7Vq7jsN7Ly/C3xj5KWFrY7sHNeDkAzXw==", + "dependencies": { + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-descriptor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.3.tgz", + "integrity": "sha512-JCNNGbwWZEVaSPtS45mdtrneRWJFp07LLmykxeFV5F6oBvNF8vHSfJuJgoT472pSfk+Mf8VnlrspaFBHWM8JAw==", + "dependencies": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-even": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-even/-/is-even-1.0.0.tgz", + "integrity": "sha512-LEhnkAdJqic4Dbqn58A0y52IXoHWlsueqQkKfMfdEnIYG8A1sm/GHidKkS6yvXlMoRrkM34csHnXQtOqcb+Jzg==", + "dependencies": { + "is-odd": "^0.1.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -1291,11 +3350,24 @@ "node": ">=8" } }, + "node_modules/is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -1303,15 +3375,62 @@ "node": ">=0.10.0" } }, + "node_modules/is-nan": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz", + "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==", + "dependencies": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, "engines": { "node": ">=0.12.0" } }, + "node_modules/is-odd": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-0.1.2.tgz", + "integrity": "sha512-Ri7C2K7o5IrUU9UEI8losXJCCD/UtsaIrkR5sxIcFg4xQ9cRJXlWA5DQvTE0yDc0krvSNLsRGXN11UPS6KyfBw==", + "dependencies": { + "is-number": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-odd/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-odd/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", @@ -1321,6 +3440,28 @@ "node": ">=8" } }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-self-closing": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-self-closing/-/is-self-closing-1.0.1.tgz", + "integrity": "sha512-E+60FomW7Blv5GXTlYee2KDrnG6srxF7Xt1SjrhWUGUEsTFIqY/nq2y3DaftCsgUMdh89V07IVfhY9KIJhLezg==", + "dependencies": { + "self-closing-tags": "^1.0.1" + }, + "engines": { + "node": ">=0.12.0" + } + }, "node_modules/is-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", @@ -1333,6 +3474,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-typed-array": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", + "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", + "dependencies": { + "which-typed-array": "^1.1.11" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -1345,12 +3500,38 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -1363,6 +3544,67 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jscodeshift": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/jscodeshift/-/jscodeshift-0.15.1.tgz", + "integrity": "sha512-hIJfxUy8Rt4HkJn/zZPU9ChKfKZM1342waJ1QC2e2YsPcWhM+3BJ4dcfQCzArTrk1jJeNLB341H+qOcEHRxJZg==", + "dependencies": { + "@babel/core": "^7.23.0", + "@babel/parser": "^7.23.0", + "@babel/plugin-transform-class-properties": "^7.22.5", + "@babel/plugin-transform-modules-commonjs": "^7.23.0", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.22.11", + "@babel/plugin-transform-optional-chaining": "^7.23.0", + "@babel/plugin-transform-private-methods": "^7.22.5", + "@babel/preset-flow": "^7.22.15", + "@babel/preset-typescript": "^7.23.0", + "@babel/register": "^7.22.15", + "babel-core": "^7.0.0-bridge.0", + "chalk": "^4.1.2", + "flow-parser": "0.*", + "graceful-fs": "^4.2.4", + "micromatch": "^4.0.4", + "neo-async": "^2.5.0", + "node-dir": "^0.1.17", + "recast": "^0.23.3", + "temp": "^0.8.4", + "write-file-atomic": "^2.3.0" + }, + "bin": { + "jscodeshift": "bin/jscodeshift.js" + }, + "peerDependencies": { + "@babel/preset-env": "^7.1.6" + }, + "peerDependenciesMeta": { + "@babel/preset-env": { + "optional": true + } + } + }, + "node_modules/jscodeshift/node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -1376,6 +3618,17 @@ "dev": true, "optional": true }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -1394,6 +3647,25 @@ "json-buffer": "3.0.1" } }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/lazy-cache": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-2.0.2.tgz", + "integrity": "sha512-7vp2Acd2+Kz4XkzxGxaB1FWOi8KjWIWsgdfD5MCb86DWvlLqhRPM+d6Pro3iNEL5VT9mstz5hKAlcd+QR6H3aA==", + "dependencies": { + "set-getter": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -1409,15 +3681,49 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lodash._reinterpolate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", + "integrity": "sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA==" + }, "node_modules/lodash.assignwith": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.assignwith/-/lodash.assignwith-4.2.0.tgz", "integrity": "sha512-ZznplvbvtjK2gMvnQ1BR/zqPFZmS6jbK4p+6Up4xcRYA7yMIwxHCfbTcrYxXKzzqLsQ05eJPVznEW3tuwV7k1g==" }, - "node_modules/lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" + }, + "node_modules/lodash.template": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", + "integrity": "sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==", + "dependencies": { + "lodash._reinterpolate": "^3.0.0", + "lodash.templatesettings": "^4.0.0" + } + }, + "node_modules/lodash.templatesettings": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz", + "integrity": "sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==", + "dependencies": { + "lodash._reinterpolate": "^3.0.0" + } + }, + "node_modules/log-ok": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/log-ok/-/log-ok-0.1.1.tgz", + "integrity": "sha512-cc8VrkS6C+9TFuYAwuHpshrcrGRAv7d0tUJ0GdM72ZBlKXtlgjUZF84O+OhQUdiVHoF7U/nVxwpjOdwUJ8d3Vg==", + "dependencies": { + "ansi-green": "^0.1.1", + "success-symbol": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } }, "node_modules/log-symbols": { "version": "4.1.0", @@ -1435,6 +3741,72 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/log-utils": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/log-utils/-/log-utils-0.2.1.tgz", + "integrity": "sha512-udyegKoMz9eGfpKAX//Khy7sVAZ8b1F7oLDnepZv/1/y8xTvsyPgqQrM94eG8V0vcc2BieYI2kVW4+aa6m+8Qw==", + "dependencies": { + "ansi-colors": "^0.2.0", + "error-symbol": "^0.1.0", + "info-symbol": "^0.1.0", + "log-ok": "^0.1.1", + "success-symbol": "^0.1.0", + "time-stamp": "^1.0.1", + "warning-symbol": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/log-utils/node_modules/ansi-colors": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-0.2.0.tgz", + "integrity": "sha512-ScRNUT0TovnYw6+Xo3iKh6G+VXDw2Ds7ZRnMIuKBgHY02DgvT2T2K22/tc/916Fi0W/5Z1RzDaHQwnp75hqdbA==", + "dependencies": { + "ansi-bgblack": "^0.1.1", + "ansi-bgblue": "^0.1.1", + "ansi-bgcyan": "^0.1.1", + "ansi-bggreen": "^0.1.1", + "ansi-bgmagenta": "^0.1.1", + "ansi-bgred": "^0.1.1", + "ansi-bgwhite": "^0.1.1", + "ansi-bgyellow": "^0.1.1", + "ansi-black": "^0.1.1", + "ansi-blue": "^0.1.1", + "ansi-bold": "^0.1.1", + "ansi-cyan": "^0.1.1", + "ansi-dim": "^0.1.1", + "ansi-gray": "^0.1.1", + "ansi-green": "^0.1.1", + "ansi-grey": "^0.1.1", + "ansi-hidden": "^0.1.1", + "ansi-inverse": "^0.1.1", + "ansi-italic": "^0.1.1", + "ansi-magenta": "^0.1.1", + "ansi-red": "^0.1.1", + "ansi-reset": "^0.1.1", + "ansi-strikethrough": "^0.1.1", + "ansi-underline": "^0.1.1", + "ansi-white": "^0.1.1", + "ansi-yellow": "^0.1.1", + "lazy-cache": "^2.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/logging-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/logging-helpers/-/logging-helpers-1.0.0.tgz", + "integrity": "sha512-qyIh2goLt1sOgQQrrIWuwkRjUx4NUcEqEGAcYqD8VOnOC6ItwkrVE8/tA4smGpjzyp4Svhc6RodDp9IO5ghpyA==", + "dependencies": { + "isobject": "^3.0.0", + "log-utils": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/loupe": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", @@ -1466,6 +3838,45 @@ "node": ">=10" } }, + "node_modules/make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dependencies": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w==", + "dependencies": { + "object-visit": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/matcher": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", @@ -1485,6 +3896,154 @@ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, + "node_modules/micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/micromatch/node_modules/braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dependencies": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/micromatch/node_modules/braces/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/micromatch/node_modules/define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dependencies": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/micromatch/node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/micromatch/node_modules/extend-shallow/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/micromatch/node_modules/fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==", + "dependencies": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/micromatch/node_modules/fill-range/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/micromatch/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/micromatch/node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/micromatch/node_modules/to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==", + "dependencies": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/mimic-fn": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", @@ -1526,6 +4085,29 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dependencies": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mixin-deep/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/mocha": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", @@ -1572,11 +4154,18 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, + "node_modules/moment": { + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", + "engines": { + "node": "*" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/nanoid": { "version": "3.3.3", @@ -1590,6 +4179,62 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nanomatch/node_modules/define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dependencies": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nanomatch/node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nanomatch/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/napi-tests": { "resolved": "test/napi", "link": true @@ -1599,6 +4244,42 @@ "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" }, + "node_modules/node-dir": { + "version": "0.1.17", + "resolved": "https://registry.npmjs.org/node-dir/-/node-dir-0.1.17.tgz", + "integrity": "sha512-tmPX422rYgofd4epzrNoOXiE8XFZYOcCq1vD7MAXCDO+O+zndlA2ztdKKMa+EeuBG5tHETpr4ml4RGgpqDCCAg==", + "dependencies": { + "minimatch": "^3.0.2" + }, + "engines": { + "node": ">= 0.10.5" + } + }, + "node_modules/node-dir/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/node-dir/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/node-releases": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==" + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -1644,24 +4325,122 @@ "node": ">=12" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ==", + "dependencies": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/is-descriptor": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "dependencies": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object-copy/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-is": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", + "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA==", + "dependencies": { + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "optional": true, + "node_modules/object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==", + "dependencies": { + "isobject": "^3.0.1" + }, "engines": { - "node": ">= 0.4" + "node": ">=0.10.0" } }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, "dependencies": { "wrappy": "1" } @@ -1720,6 +4499,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -1733,7 +4528,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -1762,11 +4556,15 @@ "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", "dev": true }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, "engines": { "node": ">=8.6" }, @@ -1774,6 +4572,89 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "engines": { + "node": ">=6" + } + }, + "node_modules/pirates": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "engines": { + "node": ">= 6" + } + }, + "node_modules/pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dependencies": { + "find-up": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-dir/node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-dir/node_modules/locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-dir/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-dir/node_modules/p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-dir/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "engines": { + "node": ">=4" + } + }, "node_modules/playwright": { "version": "1.40.1", "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.40.1.tgz", @@ -1818,6 +4699,14 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/prettier": { "version": "2.8.8", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", @@ -1833,6 +4722,11 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, "node_modules/progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -1879,6 +4773,25 @@ "safe-buffer": "^5.1.0" } }, + "node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -1891,6 +4804,122 @@ "node": ">=8.10.0" } }, + "node_modules/recast": { + "version": "0.23.4", + "resolved": "https://registry.npmjs.org/recast/-/recast-0.23.4.tgz", + "integrity": "sha512-qtEDqIZGVcSZCHniWwZWbRy79Dc6Wp3kT/UmDA2RJKBPg7+7k51aQBZirHmUGn5uvHf2rg8DkjizrN26k61ATw==", + "dependencies": { + "assert": "^2.0.0", + "ast-types": "^0.16.1", + "esprima": "~4.0.0", + "source-map": "~0.6.1", + "tslib": "^2.0.1" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dependencies": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/regex-not/node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/regex-not/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/relative": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/relative/-/relative-3.0.2.tgz", + "integrity": "sha512-Q5W2qeYtY9GbiR8z1yHNZ1DGhyjb4AnLEjt8iE6XfcC1QIu+FAtj3HQaO0wH28H1mX6cqNLvAqWhP402dxJGyA==", + "dependencies": { + "isobject": "^2.0.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/relative/node_modules/isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==", + "dependencies": { + "isarray": "1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/remarkable": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/remarkable/-/remarkable-1.7.4.tgz", + "integrity": "sha512-e6NKUXgX95whv7IgddywbeN/ItCkWbISmc2DiqHJb0wTrqZIexqdco5b8Z3XZoo/48IdNVKM9ZCvTPJ4F5uvhg==", + "dependencies": { + "argparse": "^1.0.10", + "autolinker": "~0.28.0" + }, + "bin": { + "remarkable": "bin/remarkable.js" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/remarkable/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/remarkable/node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" + }, + "node_modules/repeat-element": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", + "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", + "engines": { + "node": ">=0.10" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -1906,6 +4935,12 @@ "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", "dev": true }, + "node_modules/resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg==", + "deprecated": "https://github.com/lydell/resolve-url#deprecated" + }, "node_modules/responselike": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", @@ -1918,6 +4953,25 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "engines": { + "node": ">=0.12" + } + }, + "node_modules/rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, "node_modules/roarr": { "version": "2.15.4", "resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz", @@ -1956,11 +5010,26 @@ } ] }, + "node_modules/safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==", + "dependencies": { + "ret": "~0.1.10" + } + }, + "node_modules/self-closing-tags": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/self-closing-tags/-/self-closing-tags-1.0.1.tgz", + "integrity": "sha512-7t6hNbYMxM+VHXTgJmxwgZgLGktuXtVVD5AivWzNTdJBM4DBjnDKDzkf2SrNjihaArpeJYNjxkELBu1evI4lQA==", + "engines": { + "node": ">=0.12.0" + } + }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, "bin": { "semver": "bin/semver.js" } @@ -1994,40 +5063,188 @@ "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", "dev": true, "dependencies": { - "randombytes": "^2.1.0" + "randombytes": "^2.1.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.0.tgz", + "integrity": "sha512-4DBHDoyHlM1IRPGYcoxexgh67y4ueR53FKV1yyxwFMY7aCqcN/38M1+SwZ/qJQ8iLv7+ck385ot4CcisOAPT9w==", + "dependencies": { + "define-data-property": "^1.1.1", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.2", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-getter": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/set-getter/-/set-getter-0.1.1.tgz", + "integrity": "sha512-9sVWOy+gthr+0G9DzqqLaYNA7+5OKkSmcqjL9cBpDEaZrr3ShQlyX2cZ/O/ozE41oxn/Tt0LGEM/w4Rub3A3gw==", + "dependencies": { + "to-object-path": "^0.3.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dependencies": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dependencies": { + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dependencies": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dependencies": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dependencies": { + "kind-of": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-util/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" } }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, + "node_modules/snapdragon/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", "dependencies": { - "shebang-regex": "^3.0.0" + "is-descriptor": "^0.1.0" }, "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, + "node_modules/snapdragon/node_modules/is-descriptor": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "dependencies": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + }, "engines": { - "node": ">=8" + "node": ">= 0.4" } }, - "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, + "node_modules/snapdragon/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/snapdragon/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=0.10.0" } }, "node_modules/source-map": { @@ -2038,6 +5255,68 @@ "node": ">=0.10.0" } }, + "node_modules/source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated", + "dependencies": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/source-map-url": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", + "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", + "deprecated": "See https://github.com/lydell/source-map-url#deprecated" + }, + "node_modules/split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dependencies": { + "extend-shallow": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/split-string/node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/split-string/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/sprintf-js": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", @@ -2045,6 +5324,41 @@ "dev": true, "optional": true }, + "node_modules/static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g==", + "dependencies": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/is-descriptor": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "dependencies": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/stream-read-all": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/stream-read-all/-/stream-read-all-3.0.1.tgz", @@ -2062,6 +5376,19 @@ "promise-polyfill": "^1.1.6" } }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -2112,6 +5439,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/striptags": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/striptags/-/striptags-3.2.0.tgz", + "integrity": "sha512-g45ZOGzHDMe2bdYMdIvdAfCQkCTDMGBazSw1ypMowwGIee7ZQ5dU0rBJ8Jqgl+jAKIv4dbeE1jscZq9wid1Tkw==" + }, + "node_modules/success-symbol": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/success-symbol/-/success-symbol-0.1.0.tgz", + "integrity": "sha512-7S6uOTxPklNGxOSbDIg4KlVLBQw1UiGVyfCUYgYxrZUKRblUkmGj7r8xlfQoFudvqLv6Ap5gd76/IIFfI9JG2A==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/sumchecker": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-3.0.1.tgz", @@ -2175,11 +5515,90 @@ "node": ">=12.17" } }, + "node_modules/temp": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/temp/-/temp-0.8.4.tgz", + "integrity": "sha512-s0ZZzd0BzYv5tLSptZooSjK8oj6C+c19p7Vqta9+6NPOf7r+fxq0cJe6/oN4LTC79sy5NY8ucOJNgwsKCSbfqg==", + "dependencies": { + "rimraf": "~2.6.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/time-stamp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", + "integrity": "sha512-gLCeArryy2yNTRzTGKbZbloctj64jkZ57hj5zdraXue6aFgd6PmvVtEyiUU+hvU0v7q08oVv8r8ev0tRo6bvgw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "engines": { + "node": ">=4" + } + }, + "node_modules/to-gfm-code-block": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/to-gfm-code-block/-/to-gfm-code-block-0.1.1.tgz", + "integrity": "sha512-LQRZWyn8d5amUKnfR9A9Uu7x9ss7Re8peuWR2gkh1E+ildOfv2aF26JpuDg8JtvCduu5+hOrMIH+XstZtnagqg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg==", + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-object-path/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dependencies": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -2187,12 +5606,52 @@ "node": ">=8.0" } }, + "node_modules/to-regex/node_modules/define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dependencies": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-regex/node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-regex/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/toml": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==", "dev": true }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -2215,6 +5674,28 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/typeof-article": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/typeof-article/-/typeof-article-0.1.1.tgz", + "integrity": "sha512-Vn42zdX3FhmUrzEmitX3iYyLb+Umwpmv8fkZRIknYh84lmdrwqZA5xYaoKiIj2Rc5i/5wcDrpUmZcbk1U51vTw==", + "dependencies": { + "kind-of": "^3.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/typeof-article/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/typescript": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz", @@ -2254,6 +5735,20 @@ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", "dev": true }, + "node_modules/union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dependencies": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -2263,6 +5758,118 @@ "node": ">= 4.0.0" } }, + "node_modules/unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==", + "dependencies": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q==", + "dependencies": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-value/node_modules/isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==", + "dependencies": { + "isarray": "1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", + "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg==", + "deprecated": "Please see https://github.com/lydell/urix#deprecated" + }, + "node_modules/use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/util": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "dependencies": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "node_modules/warning-symbol": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/warning-symbol/-/warning-symbol-0.1.0.tgz", + "integrity": "sha512-1S0lwbHo3kNUKA4VomBAhqn4DPjQkIKSdbOin5K7EFUQNwyIKx+wZMGXKI53RUjla8V2B8ouQduUlgtx8LoSMw==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -2278,6 +5885,24 @@ "node": ">= 8" } }, + "node_modules/which-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.13.tgz", + "integrity": "sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==", + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.4", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -2317,8 +5942,30 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/write-file-atomic": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", + "dependencies": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, + "node_modules/write-file-atomic/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "engines": { + "node": ">=0.4" + } }, "node_modules/y18n": { "version": "5.0.8", @@ -2388,6 +6035,14 @@ "fd-slicer": "~1.1.0" } }, + "node_modules/year": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/year/-/year-0.2.1.tgz", + "integrity": "sha512-9GnJUZ0QM4OgXuOzsKNzTJ5EOkums1Xc+3YQXp+Q+UxFjf7zLucp9dQ8QMIft0Szs1E1hUiXFim1OYfEKFq97w==", + "engines": { + "node": ">=0.8" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", @@ -2411,13 +6066,15 @@ } }, "pkgs/create-neon": { - "version": "0.2.0", + "version": "0.3.0", "license": "MIT", "dependencies": { + "@neon-rs/manifest": "^0.0.4", "chalk": "^5.3.0", "command-line-args": "^5.2.1", "command-line-usage": "^7.0.1", - "handlebars": "^4.7.8" + "handlebars": "^4.7.8", + "handlebars-helpers": "^0.10.0" }, "bin": { "create-neon": "dist/src/bin/create-neon.js" @@ -2427,6 +6084,7 @@ "@types/chai": "^4.3.11", "@types/command-line-args": "^5.2.3", "@types/command-line-usage": "^5.0.4", + "@types/handlebars-helpers": "^0.5.6", "@types/mocha": "^10.0.6", "@types/node": "^20.10.1", "chai": "^4.3.10", diff --git a/pkgs/create-neon/data/templates/.gitignore.hbs b/pkgs/create-neon/data/templates/.gitignore.hbs index 45413ba08..58c2081e6 100644 --- a/pkgs/create-neon/data/templates/.gitignore.hbs +++ b/pkgs/create-neon/data/templates/.gitignore.hbs @@ -3,8 +3,7 @@ index.node **/node_modules **/.DS_Store npm-debug.log* -{{#if package.lang.isTypeScript}} +{{#eq package.library.lang compare="ts"}} lib -{{/if}} -cargo.log +{{/eq}}cargo.log cross.log diff --git a/pkgs/create-neon/data/templates/.npmignore.hbs b/pkgs/create-neon/data/templates/.npmignore.hbs index 5a00bba56..351128a14 100644 --- a/pkgs/create-neon/data/templates/.npmignore.hbs +++ b/pkgs/create-neon/data/templates/.npmignore.hbs @@ -1,3 +1,3 @@ -{{#if package.isLibrary}} +{{#if packageSpec.library}} platforms {{/if}} diff --git a/pkgs/create-neon/data/templates/README.md.hbs b/pkgs/create-neon/data/templates/README.md.hbs index 3dbffaa7c..7fcff1cd5 100644 --- a/pkgs/create-neon/data/templates/README.md.hbs +++ b/pkgs/create-neon/data/templates/README.md.hbs @@ -33,7 +33,7 @@ $ node In the project directory, you can run: -{{#unless package.isLibrary}} +{{#unless packageSpec.library}} ### `npm install` Installs the project, including running `npm run build`. @@ -69,13 +69,13 @@ The directory structure of this project is: {{package.name}}/ ├── Cargo.toml ├── README.md -{{#if package.isLibrary}} +{{#if packageSpec.library}} ├── lib/ -{{#if package.lang.isTypeScript}} +{{#eq packageSpec.library.lang compare="ts"}} ├── ts/ | ├── index.mts | └── index.cts -{{/if}} +{{/eq}} ├── platforms/ {{else}} ├── index.node @@ -94,10 +94,10 @@ The Cargo [manifest file](https://doc.rust-lang.org/cargo/reference/manifest.htm This file. -{{#if package.isLibrary}} +{{#if packageSpec}} ### lib/ -{{#if package.lang.isTypeScript}} +{{#eq packageSpec.library.lang compare="ts"}} The directory containing the generated output from [tsc](https://typescriptlang.org). ### ts/ @@ -111,10 +111,11 @@ Entry point for when this library is loaded via [ESM `import`](https://nodejs.or ### ts/index.cts Entry point for when this library is loaded via [CJS `require`](https://nodejs.org/api/modules.html#requireid). + {{else}} The directory containing the JavaScript source files. -{{/if}} +{{/eq}} ### platforms/ The directory containing distributions of the binary addon backend for each platform supported by this library. @@ -122,7 +123,7 @@ The directory containing distributions of the binary addon backend for each plat {{else}} ### index.node -The Node addon—i.e., a binary Node module—generated by building the project. This is the main module for this package, as dictated by the `"main"` key in `package.json`. +The binary module (aka Node addon) generated by building the project. This is the main module for this package, as dictated by the `"main"` key in `package.json`. Under the hood, a [Node addon](https://nodejs.org/api/addons.html) is a [dynamically-linked shared object](https://en.wikipedia.org/wiki/Library_(computing)#Shared_libraries). The `"build"` script produces this file by copying it from within the `target/` directory, which is where the Rust build produces the shared object. diff --git a/pkgs/create-neon/data/templates/ci/github/.env.hbs b/pkgs/create-neon/data/templates/ci/github/.env.hbs new file mode 100644 index 000000000..868db8f4b --- /dev/null +++ b/pkgs/create-neon/data/templates/ci/github/.env.hbs @@ -0,0 +1,4 @@ +NODE_VERSION=18.x +NPM_REGISTRY=https://registry.npmjs.org +ACTIONS_USER=github-actions +ACTIONS_EMAIL=github-actions@github.com diff --git a/pkgs/create-neon/data/templates/ci/github/build.yml.hbs b/pkgs/create-neon/data/templates/ci/github/build.yml.hbs new file mode 100644 index 000000000..b40b3e1da --- /dev/null +++ b/pkgs/create-neon/data/templates/ci/github/build.yml.hbs @@ -0,0 +1,124 @@ +name: Build + +on: + workflow_call: + inputs: + branch: + description: 'Branch to check out' + required: false + type: string + default: {{#$}} github.event.repository.default_branch {{/$}} + update-version: + description: 'Update version before building?' + required: false + type: boolean + default: false + version: + description: 'Version update (ignored if update-version if false)' + required: false + type: string + default: 'patch' + github-release: + description: 'Publish GitHub release?' + required: false + type: boolean + default: false + +jobs: + matrix: + name: Matrix + runs-on: ubuntu-latest + outputs: + matrix: {{#$}} steps.matrix.outputs.result {{/$}} + steps: + - name: Checkout Code + uses: actions/checkout@{{versions.actions.checkout}} + with: + token: {{#$}} secrets.TAG_TOKEN || github.token {{/$}} + ref: {{#$}} inputs.branch {{/$}} + - name: Set Environment Variables + uses: falti/dotenv-action@{{versions.actions.dotenv}} + with: + path: ./.github/workflows/.env + export-variables: true + keys-case: bypass + - name: Install Node + uses: actions/setup-node@{{versions.actions.setupNode}} + with: + node-version: {{#$}} env.NODE_VERSION {{/$}} + registry-url: {{#$}} env.NPM_REGISTRY {{/$}} + cache: npm + - name: Install Dependencies + shell: bash + run: npm ci + - name: Install cargo-messages + shell: bash + run: npm ci + working-directory: ./pkgs/cargo-messages + - name: Look Up Matrix Data + id: matrixData + shell: bash + run: | + echo "json=$(node ../../dist/cli ci github | jq -rc)" >> "$GITHUB_OUTPUT" + working-directory: ./pkgs/cargo-messages + - name: Compute Matrix + id: matrix + uses: actions/github-script@{{versions.actions.githubScript}} + with: + script: | + const platforms = {{#$}} steps.matrixData.outputs.json {{/$}}; + const macOS = platforms.macOS.map(platform => { + return { os: "macos-latest", platform, cross: false }; + }); + const windows = platforms.Windows.map(platform => { + return { os: "windows-latest", platform, cross: false }; + }); + const linux = platforms.Linux.map(platform => { + return { os: "ubuntu-latest", platform, cross: true }; + }); + return [...macOS, ...windows, ...linux]; + + binaries: + name: Binaries + needs: [matrix] + strategy: + matrix: + cfg: {{#$}} fromJSON(needs.matrix.outputs.matrix) {{/$}} + runs-on: {{#$}} matrix.cfg.os {{/$}} + permissions: + contents: write + steps: + - name: Checkout Code + uses: actions/checkout@{{versions.actions.checkout}} + with: + fetch-depth: 0 + - name: Set Environment Variables + uses: falti/dotenv-action@{{versions.actions.dotenv}} + with: + path: ./.github/workflows/.env + export-variables: true + keys-case: bypass + - name: Diagnostics + shell: bash + run: git log -10 + - name: Install Dependencies + shell: bash + run: npm ci + - name: Update Version + if: {{#$}} inputs.update-version {{/$}} + shell: bash + run: | + git config --global user.name $ACTIONS_USER + git config --global user.email $ACTIONS_EMAIL + npm version {{#$}} inputs.version {{/$}} -m "v%s" + - name: Check Versions + shell: bash + run: ./test/lint/check-versions.sh + - name: Build + uses: neon-actions/build@{{versions.actions.neonBuild}} + with: + working-directory: ./pkgs/cargo-messages + node-version: {{#$}} env.NODE_VERSION {{/$}} + use-cross: {{#$}} !!matrix.cfg.cross {{/$}} + platform: {{#$}} matrix.cfg.platform {{/$}} + github-release: {{#$}} inputs.github-release {{/$}} diff --git a/pkgs/create-neon/data/templates/ci/github/comments.yml.hbs b/pkgs/create-neon/data/templates/ci/github/comments.yml.hbs new file mode 100644 index 000000000..1605098a3 --- /dev/null +++ b/pkgs/create-neon/data/templates/ci/github/comments.yml.hbs @@ -0,0 +1,40 @@ +name: Comments + +run-name: | + {{#$}} (github.event.issue.pull_request + && contains(github.event.comment.body, '/build-all') + && format('Full build (PR #{0})', github.event.issue.number)) + || 'Issue comment (no action)' {{/$}} + +on: + issue_comment: + types: [created] + +jobs: + setup: + name: Setup + runs-on: ubuntu-latest + if: {{#$}} github.event.issue.pull_request && contains(github.event.comment.body, '/build-all') {{/$}} + outputs: + branch: {{#$}} steps.pr-ref.outputs.branch || github.event.repository.default_branch {{/$}} + steps: + - name: PR Branch + if: {{#$}} github.event.issue.pull_request {{/$}} + id: pr-ref + shell: bash + run: echo "branch=$(gh pr view $PR_NO --repo $REPO --json headRefName --jq '.headRefName')" >> "$GITHUB_OUTPUT" + env: + REPO: {{#$}} github.repository {{/$}} + PR_NO: {{#$}} github.event.issue.number {{/$}} + GITHUB_TOKEN: {{#$}} secrets.GITHUB_TOKEN {{/$}} + + build-all: + name: Build + needs: [setup] + permissions: + contents: write + uses: ./.github/workflows/build.yml + with: + branch: {{#$}} needs.setup.outputs.branch {{/$}} + update-version: true + github-release: false diff --git a/pkgs/create-neon/data/templates/ci/github/manifest/scripts.json.hbs b/pkgs/create-neon/data/templates/ci/github/manifest/scripts.json.hbs new file mode 100644 index 000000000..66eeb37ef --- /dev/null +++ b/pkgs/create-neon/data/templates/ci/github/manifest/scripts.json.hbs @@ -0,0 +1,5 @@ +{ + "tag": "npm version -m 'v%s'", + "posttag": "git push --follow-tags", + "dryrun": "gh workflow run publish.yml -f dryrun=true" +} diff --git a/pkgs/create-neon/data/templates/ci/github/publish.yml.hbs b/pkgs/create-neon/data/templates/ci/github/publish.yml.hbs index 2386d5d78..96552073b 100644 --- a/pkgs/create-neon/data/templates/ci/github/publish.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/publish.yml.hbs @@ -1,25 +1,21 @@ name: Publish run-name: | - {{#$}} - (github.event_name == 'workflow_dispatch' && inputs.dryrun && 'Dry run') || - (github.event_name == 'workflow_dispatch' && - format('Trigger publish: {0}', - (inputs.bumpType == 'custom' && inputs.custom) || inputs.bumpType) - ) || - format('Publish: {0}', github.event.head_commit.message) - {{/$}} - -env: - NODE_VERSION: 18.x - NEON_PLATFORMS_DIR: platforms - ACTIONS_USER: github-actions - ACTIONS_EMAIL: github-actions@github.com + {{#$}} (github.event_name == 'workflow_dispatch' && inputs.dryrun + && 'Dry run') + || (github.event_name == 'workflow_dispatch' + && format('Tag release: {0}', (inputs.version == 'custom' && inputs.custom) || inputs.version)) + || format('Publish: {0}', github.event.head_commit.message) {{/$}} on: + # Event: A maintainer has pushed a new release tag for publication. push: tags: - v* + + # Event: A maintainer has used the GitHub Actions UI to initiate + # either tagging a new release for publication or doing a + # dry run. workflow_dispatch: inputs: dryrun: @@ -27,8 +23,8 @@ on: required: false type: boolean default: true - bumpType: - description: 'Version bump type (or custom to specify)' + version: + description: 'Version component to update (or "custom" to provide exact version)' required: true default: 'patch' type: choice @@ -53,37 +49,47 @@ jobs: permissions: contents: write outputs: - action: {{#$}} steps.action.outputs.type {{/$}} - branch: {{#$}} steps.branch.outputs.branch {{/$}} - macOS: {{#$}} steps.matrix.outputs.macOS {{/$}} - Windows: {{#$}} steps.matrix.outputs.Windows {{/$}} - Linux: {{#$}} steps.matrix.outputs.Linux {{/$}} + dryrun: {{#$}} steps.dryrun.outputs.dryrun {{/$}} + tag: {{#$}} steps.tag.outputs.tag {{/$}} + publish: {{#$}} steps.publish.outputs.publish {{/$}} steps: - name: Validate Workflow Inputs - if: {{#$}} inputs.bumpType == 'custom' && inputs.custom == '' {{/$}} + if: {{#$}} inputs.version == 'custom' && inputs.custom == '' {{/$}} shell: bash run: | echo '::error::No custom version number provided' exit 1 - - id: action - name: Determine Action Type + - id: dryrun + name: Validate Dry Run Event + if: {{#$}} github.event_name == 'workflow_dispatch' && inputs.dryrun {{/$}} + shell: bash + run: echo dryrun=true >> "$GITHUB_OUTPUT" + - id: tag + name: Validate Tag Event + if: {{#$}} github.event_name == 'workflow_dispatch' && !inputs.dryrun {{/$}} shell: bash - run: | - case "{{#$}} github.event_name {{/$}},{{#$}} inputs.dryrun {{/$}}" in - workflow_dispatch,true) type=dryrun ;; - workflow_dispatch,*) type=tag ;; - *) type=publish ;; - esac - echo "type=$type" - echo "type=$type" >> "$GITHUB_OUTPUT" - - name: Validate Secrets env: - NPM_TOKEN: {{#$}} secrets.NPM_TOKEN {{/$}} TAG_TOKEN: {{#$}} secrets.TAG_TOKEN {{/$}} + run: | + if [[ -z $TAG_TOKEN ]]; then + echo "::error::Secret TAG_TOKEN is not defined for this GitHub repo." + echo "::error::To push a publish tag, this action requires:" + echo "::error:: • a GitHub Personal Access Token;" + echo "::error:: • with Read-Write access to this repo;" + echo "::error:: • stored as a repo secret named TAG_TOKEN." + echo "::error::See https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens for info about creating GitHub Personal Access Tokens." + echo "::error::See https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions for info about how to store GitHub repo secrets." + exit 1 + fi + echo tag=true >> "$GITHUB_OUTPUT" + - id: publish + name: Validate Publish Event + if: {{#$}} github.event_name == 'push' {{/$}} shell: bash + env: + NPM_TOKEN: {{#$}} secrets.NPM_TOKEN {{/$}} run: | - action={{#$}} steps.action.outputs.type {{/$}} - if [[ $action = publish ]] && [[ -z $NPM_TOKEN ]]; then + if [[ -z $NPM_TOKEN ]]; then echo "::error::Secret NPM_TOKEN is not defined for this GitHub repo." echo "::error::To publish to npm, this action requires:" echo "::error:: • an npm access token;" @@ -93,160 +99,49 @@ jobs: echo "::error::See https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions for info about how to store GitHub repo secrets." exit 1 fi - if [[ $action = tag ]] && [[ -z $TAG_TOKEN ]]; then - echo "::error::Secret TAG_TOKEN is not defined for this GitHub repo." - echo "::error::To push a publish tag, this action requires:" - echo "::error:: • a GitHub Personal Access Token;" - echo "::error:: • with Read-Write access to this repo;" - echo "::error:: • stored as a repo secret named TAG_TOKEN." - echo "::error::See https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens for info about creating GitHub Personal Access Tokens." - echo "::error::See https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions for info about how to store GitHub repo secrets." - exit 1 - fi + echo publish=true >> "$GITHUB_OUTPUT" - name: Checkout Code uses: actions/checkout@{{versions.actions.checkout}} with: token: {{#$}} secrets.TAG_TOKEN || github.token {{/$}} + - name: Set Environment Variables + uses: falti/dotenv-action@{{versions.actions.dotenv}} + with: + path: ./.github/workflows/.env + export-variables: true + keys-case: bypass - name: Install Node uses: actions/setup-node@{{versions.actions.setupNode}} with: node-version: {{#$}} env.NODE_VERSION {{/$}} + registry-url: {{#$}} env.NPM_REGISTRY {{/$}} cache: npm - - name: Compute Default Branch - id: branch - shell: bash - run: | - branch=$(git remote show origin | grep 'HEAD branch' | awk '{ print $3; }') - echo $branch - echo "branch=$branch" >> "$GITHUB_OUTPUT" - - name: Install Dependencies - shell: bash - run: npm ci - - name: Install cargo-messages - shell: bash - run: npm ci - working-directory: ./pkgs/cargo-messages - - name: Remote Publish (manual only) - if: {{#$}} steps.action.outputs.type == 'tag' {{/$}} - shell: bash - run: | - git checkout {{#$}} steps.branch.outputs.branch {{/$}} - git config --global user.name {{#$}} env.ACTIONS_USER {{/$}} - git config --global user.email {{#$}} env.ACTIONS_EMAIL {{/$}} - npm run remote-publish -- '{{#$}} (inputs.bumpType == 'custom' && inputs.custom) || inputs.bumpType {{/$}}' - - name: Compute Platform Matrix - id: matrix - shell: bash - run: | - npx @neon-rs/cli ci github - echo "macOS=$(npx @neon-rs/cli ci github | jq -rc .macOS)" >> "$GITHUB_OUTPUT" - echo "Windows=$(npx @neon-rs/cli ci github | jq -rc .Windows)" >> "$GITHUB_OUTPUT" - echo "Linux=$(npx @neon-rs/cli ci github | jq -rc .Linux)" >> "$GITHUB_OUTPUT" - - macos-builds: - name: Builds (macOS) - if: {{#$}} needs.setup.outputs.action != 'tag' {{/$}} - needs: [setup] - strategy: - matrix: - platform: {{#$}} fromJSON(needs.setup.outputs.macOS) {{/$}} - runs-on: macos-latest - permissions: - contents: write - steps: - - name: Checkout Code - uses: actions/checkout@{{versions.actions.checkout}} - with: - fetch-depth: 0 - - name: Install Dependencies - shell: bash - run: npm ci - - name: Bump Version (dry-run only) - if: {{#$}} needs.setup.outputs.action == 'dryrun' {{/$}} - shell: bash - run: | - git checkout {{#$}} needs.setup.outputs.branch {{/$}} - git config --global user.name {{#$}} env.ACTIONS_USER {{/$}} - git config --global user.email {{#$}} env.ACTIONS_EMAIL {{/$}} - npm version '{{#$}} (inputs.bumpType == 'custom' && inputs.custom) || inputs.bumpType {{/$}}' -m "[dryrun] v%s" - - name: Build - uses: neon-actions/build@{{versions.actions.neonBuild}} - with: - node-version: {{#$}} env.NODE_VERSION {{/$}} - platform: {{#$}} matrix.platform {{/$}} - github-release: {{#$}} needs.setup.outputs.action == 'publish' {{/$}} - - windows-builds: - name: Builds (Windows) - if: {{#$}} needs.setup.outputs.action != 'tag' {{/$}} - needs: [setup] - strategy: - matrix: - platform: {{#$}} fromJSON(needs.setup.outputs.macOS) {{/$}} - runs-on: windows-latest - permissions: - contents: write - steps: - - name: Checkout Code - uses: actions/checkout@{{versions.actions.checkout}} - with: - fetch-depth: 0 - name: Install Dependencies shell: bash run: npm ci - - name: Bump Version (dry-run only) - if: {{#$}} needs.setup.outputs.action == 'dryrun' {{/$}} + - name: Tag Release (manual only) + if: {{#$}} steps.tag.outputs.tag {{/$}} shell: bash run: | - git checkout {{#$}} needs.setup.outputs.branch {{/$}} - git config --global user.name {{#$}} env.ACTIONS_USER {{/$}} - git config --global user.email {{#$}} env.ACTIONS_EMAIL {{/$}} - npm version '{{#$}} (inputs.bumpType == 'custom' && inputs.custom) || inputs.bumpType {{/$}}' -m "[dryrun] v%s" - - name: Build - uses: neon-actions/build@{{versions.actions.neonBuild}} - with: - node-version: {{#$}} env.NODE_VERSION {{/$}} - platform: {{#$}} matrix.platform {{/$}} - github-release: {{#$}} needs.setup.outputs.action == 'publish' {{/$}} + git config --global user.name $ACTIONS_USER + git config --global user.email $ACTIONS_EMAIL + npm run tag -- '{{#$}} (inputs.version == 'custom' && inputs.custom) || inputs.version {{/$}}' - other-builds: - name: Builds (other platforms) - if: {{#$}} needs.setup.outputs.action != 'tag' {{/$}} + build: + name: Build needs: [setup] - strategy: - matrix: - platform: {{#$}} fromJSON(needs.setup.outputs.Linux) {{/$}} - runs-on: ubuntu-latest permissions: contents: write - steps: - - name: Checkout Code - uses: actions/checkout@{{versions.actions.checkout}} - with: - fetch-depth: 0 - - name: Install Dependencies - shell: bash - run: npm ci - - name: Bump Version (dry-run only) - if: {{#$}} needs.setup.outputs.action == 'dryrun' {{/$}} - shell: bash - run: | - git checkout {{#$}} needs.setup.outputs.branch {{/$}} - git config --global user.name {{#$}} env.ACTIONS_USER {{/$}} - git config --global user.email {{#$}} env.ACTIONS_EMAIL {{/$}} - npm version '{{#$}} (inputs.bumpType == 'custom' && inputs.custom) || inputs.bumpType {{/$}}' -m "[dryrun] v%s" - - name: Build - uses: neon-actions/build@{{versions.actions.neonBuild}} - with: - node-version: {{#$}} env.NODE_VERSION {{/$}} - use-cross: true - platform: {{#$}} matrix.platform {{/$}} - github-release: {{#$}} needs.setup.outputs.action == 'publish' {{/$}} + uses: ./.github/workflows/build.yml + with: + update-version: {{#$}} !!needs.setup.outputs.dryrun {{/$}} + version: {{#$}} (inputs.version == 'custom' && inputs.custom) || inputs.version {{/$}} + github-release: {{#$}} !!needs.setup.outputs.publish {{/$}} publish: name: Publish - if: {{#$}} needs.setup.outputs.action == 'publish' {{/$}} - needs: [macos-builds, windows-builds, other-builds] + if: {{#$}} needs.setup.outputs.publish {{/$}} + needs: [setup, build] runs-on: ubuntu-latest permissions: contents: write @@ -255,6 +150,18 @@ jobs: uses: actions/checkout@{{versions.actions.checkout}} with: fetch-depth: 0 + - name: Set Environment Variables + uses: falti/dotenv-action@{{versions.actions.dotenv}} + with: + path: ./.github/workflows/.env + export-variables: true + keys-case: bypass + - name: Install Node + uses: actions/setup-node@{{versions.actions.setupNode}} + with: + node-version: {{#$}} env.NODE_VERSION {{/$}} + registry-url: {{#$}} env.NPM_REGISTRY {{/$}} + cache: npm - name: Install Dependencies shell: bash run: npm ci @@ -264,5 +171,6 @@ jobs: NODE_AUTH_TOKEN: {{#$}} secrets.NPM_TOKEN {{/$}} with: node-version: {{#$}} env.NODE_VERSION {{/$}} + registry-url: {{#$}} env.NPM_REGISTRY {{/$}} fetch-binaries: "*.tgz" github-release: true diff --git a/pkgs/create-neon/data/templates/ci/github/test.yml.hbs b/pkgs/create-neon/data/templates/ci/github/test.yml.hbs index ab23c5d09..b88f717a6 100644 --- a/pkgs/create-neon/data/templates/ci/github/test.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/test.yml.hbs @@ -1,22 +1,18 @@ name: Test run-name: | - {{#$}} - format('Test ({0}): {1}', - (github.event_name == 'pull_request' && 'PR') || 'push', - github.event.head_commit.message - ) - {{/$}} - -env: - NODE_VERSION: {{versions.node}}.x - NEON_PLATFORMS_DIR: platforms + {{#$}} (github.event_name == 'pull_request' && format('Test (PR #{0}): {1}', github.event.number, github.event.pull_request.title)) + || format('Test: {0}', github.event.head_commit.message) {{/$}} on: + # Event: A maintainer has pushed commits or merged a PR to main. push: - # Prevent duplicate runs of this workflow on internal PRs. + # Limiting push events to 'main' prevents duplicate runs of this workflow + # when maintainers push to internal PRs. branches: - main + + # Event: A contributor has created or updated a PR. pull_request: types: [opened, synchronize, reopened, labeled] branches: @@ -31,10 +27,17 @@ jobs: uses: actions/checkout@{{versions.actions.checkout}} with: fetch-depth: 0 + - name: Set Environment Variables + uses: falti/dotenv-action@{{versions.actions.dotenv}} + with: + path: ./.github/workflows/.env + export-variables: true + keys-case: bypass - name: Install Node uses: actions/setup-node@{{versions.actions.setupNode}} with: - node-version: {{#$}}env.NODE_VERSION{{/$}} + node-version: {{#$}} env.NODE_VERSION {{/$}} + registry-url: {{#$}} env.NPM_REGISTRY {{/$}} cache: npm - name: Install Rust uses: actions-rs/toolchain@{{versions.actions.setupRust}} diff --git a/pkgs/create-neon/data/templates/manifest/base/default.json.hbs b/pkgs/create-neon/data/templates/manifest/base/default.json.hbs new file mode 100644 index 000000000..291c547d0 --- /dev/null +++ b/pkgs/create-neon/data/templates/manifest/base/default.json.hbs @@ -0,0 +1,13 @@ + +{ + "name": "{{package.name}}", + "version": "{{package.version}}", + "main": "index.node", + "scripts": {}, + "devDependencies": { + "@neon-rs/cli": "{{versions.neonCLI}}"{{#eq package.library.lang compare="ts"}}, + "@tsconfig/node{{versions.tsconfigNode.major}}": "^{{versions.tsconfigNode.semver}}", + "@types/node": "^{{versions.typesNode}}", + "typescript": "^{{versions.typescript}}"{{/eq}} + } +} diff --git a/pkgs/create-neon/data/templates/manifest/base/library.json.hbs b/pkgs/create-neon/data/templates/manifest/base/library.json.hbs new file mode 100644 index 000000000..701a2e71c --- /dev/null +++ b/pkgs/create-neon/data/templates/manifest/base/library.json.hbs @@ -0,0 +1,44 @@ + +{ + "name": "{{package.name}}", + "version": "{{package.version}}", +{{#eq packageSpec.library.module compare="esm"}} + "exports": { + ".": { + "import": { + "types": "./lib/index.d.mts", + "default": "./lib/index.mjs" + }, + "require": { + "types": "./lib/index.d.cts", + "default": "./lib/index.cjs" + } + } + }, +{{/eq}} + "types": "./lib/index.d.cts", + "main": "./lib/index.cjs", + "files": [ + "lib/**/*.?({c,m}){t,j}s" + ], + "scripts": {}, + "neon": { + "type": "library", +{{#eq packageSpec.library.cache.type compare="npm"}} +{{#if packageSpec.library.cache.org}} + "org": "{{packageSpec.library.cache.org}}", +{{/if}} +{{/eq}} + "platforms": {}, + "load": "./ts/load.cts" + }, + "devDependencies": { + "@neon-rs/cli": "^{{versions.neonCLI}}"{{#eq packageSpec.library.lang compare="ts"}}, + "@tsconfig/node{{versions.tsconfigNode.major}}": "^{{versions.tsconfigNode.semver}}", + "@types/node": "^{{versions.typesNode}}", + "typescript": "^{{versions.typescript}}"{{/eq}} + }, + "dependencies": { + "@neon-rs/load": "^{{versions.neonLoad}}" + } +} diff --git a/pkgs/create-neon/data/templates/manifest/scripts.json.hbs b/pkgs/create-neon/data/templates/manifest/scripts.json.hbs new file mode 100644 index 000000000..8a6663db5 --- /dev/null +++ b/pkgs/create-neon/data/templates/manifest/scripts.json.hbs @@ -0,0 +1,12 @@ +{ + "test": "{{#eq packageSpec.library.lang compare="ts"}}tsc && {{/eq}}cargo test", + "cargo-build": "{{#eq packageSpec.library.lang compare="ts"}}tsc && {{/eq}}cargo build --message-format=json > cargo.log", + "cross-build": "{{#eq packageSpec.library.lang compare="ts"}}tsc && {{/eq}}cross build --message-format=json > cross.log", + "postcargo-build": "neon dist < cargo.log", + "postcross-build": "neon dist -m /target < cross.log", + "debug": "npm run cargo-build --", + "build": "npm run cargo-build -- --release", + "cross": "npm run cross-build -- --release"{{#if packageSpec.library}}, + "prepack": "neon update-platforms", + "version": "neon bump --binaries platforms && git add ."{{/if}} +} diff --git a/pkgs/create-neon/data/templates/package.json.hbs b/pkgs/create-neon/data/templates/package.json.hbs deleted file mode 100644 index 66977276b..000000000 --- a/pkgs/create-neon/data/templates/package.json.hbs +++ /dev/null @@ -1,63 +0,0 @@ - -{ - "name": "{{package.name}}", - "version": "{{package.version}}", -{{#if package.isLibrary}} -{{#if package.module.isESM}} - "exports": { - ".": { - "import": { - "types": "./lib/index.d.mts", - "default": "./lib/index.mjs" - }, - "require": { - "types": "./lib/index.d.cts", - "default": "./lib/index.cjs" - } - } - }, -{{/if}} - "types": "./lib/index.d.cts", - "main": "./lib/index.cjs", - "files": [ - "lib/**/*.cjs", - "lib/**/*.d.cts", - "lib/**/*.mjs", - "lib/**/*.d.mts", - "lib/**/*.js", - "lib/**/*.d.ts" - ], - "neon": { - "type": "library", - "org": "{{package.org}}", - "platforms": {}, - "load": "./ts/load.cts" - }, -{{#else}} - "main": "index.node", -{{/if}} - "scripts": { - "test": "{{#if package.lang.isTypeScript}}tsc && {{/if}}cargo test", - "cargo-build": "{{#if package.lang.isTypeScript}}tsc && {{/if}}cargo build --message-format=json > cargo.log", - "cross-build": "{{#if package.lang.isTypeScript}}tsc && {{/if}}cross build --message-format=json > cross.log", - "postcargo-build": "neon dist < cargo.log", - "postcross-build": "neon dist -m /target < cross.log", - "debug": "npm run cargo-build --", - "build": "npm run cargo-build -- --release", - "cross": "npm run cross-build -- --release"{{#if package.isLibrary}}, - "prepack": "neon update-platforms", - "version": "neon bump --binaries platforms && git add .", - "remote-publish": "npm version -m 'v%s'", - "postremote-publish": "git push --follow-tags", - "dryrun": "gh workflow run publish.yml -f dryrun=true"{{/if}} - }, - "devDependencies": { - "@neon-rs/cli": "{{versions.neonCLI}}"{{#if package.lang.isTypeScript}}, - "@tsconfig/node{{versions.tsconfigNode.major}}": "^{{versions.tsconfigNode.semver}}", - "@types/node": "^{{versions.typesNode}}", - "typescript": "^{{versions.typescript}}"{{/if}} - }{{#if package.isLibrary}}, - "dependencies": { - "@neon-rs/load": "{{versions.neonLoad}}" - }{{/if}} -} diff --git a/pkgs/create-neon/data/templates/ts/load.cts.hbs b/pkgs/create-neon/data/templates/ts/load.cts.hbs index 962910b43..3b579437f 100644 --- a/pkgs/create-neon/data/templates/ts/load.cts.hbs +++ b/pkgs/create-neon/data/templates/ts/load.cts.hbs @@ -1 +1,4 @@ -module.exports = require('@neon-rs/load').proxy({}); +module.exports = require('@neon-rs/load').proxy({ + platforms: {}, + debug: () => require('../index.node') +}); diff --git a/pkgs/create-neon/data/templates/tsconfig.json.hbs b/pkgs/create-neon/data/templates/tsconfig.json.hbs index 9866d086d..405e127f5 100644 --- a/pkgs/create-neon/data/templates/tsconfig.json.hbs +++ b/pkgs/create-neon/data/templates/tsconfig.json.hbs @@ -1,5 +1,5 @@ { -{{#if package.lang.isTypeScript}} +{{#eq packageSpec.library.lang compare="ts"}} "extends": "@tsconfig/node{{versions.tsconfigNode.major}}/tsconfig.json", "compilerOptions": { "module": "node{{versions.tsconfigNode.module}}", @@ -9,5 +9,5 @@ "exclude": ["lib"] {{else}} "extends": "@tsconfig/node{{versions.tsconfigNode.major}}/tsconfig.json" -{{/if}} +{{/eq}} } diff --git a/pkgs/create-neon/data/versions.json b/pkgs/create-neon/data/versions.json index f89023490..d8e2e998f 100644 --- a/pkgs/create-neon/data/versions.json +++ b/pkgs/create-neon/data/versions.json @@ -1,20 +1,22 @@ { "neon": "1", - "neonCLI": "0.0.185", - "neonLoad": "0.0.185", - "typescript": "5", - "typesNode": "20", + "neonCLI": "0.1.0", + "neonLoad": "0.1.0", + "typescript": "5.3.3", + "typesNode": "20.11.16", "tsconfigNode": { "major": "18", - "semver": "18", + "semver": "18.2.2", "module": "16" }, "node": "18", "actions": { "checkout": "v3", + "githubScript": "v7", "setupNode": "v3", "setupRust": "v1", "neonBuild": "v0.9", - "neonPublish": "v0.4.1" + "neonPublish": "v0.4.1", + "dotenv": "v1" } } diff --git a/pkgs/create-neon/package.json b/pkgs/create-neon/package.json index cb39213ed..8311bcea7 100644 --- a/pkgs/create-neon/package.json +++ b/pkgs/create-neon/package.json @@ -22,7 +22,7 @@ "prepublishOnly": "npm run build", "pretest": "npm run build", "test": "mocha", - "manual-test": "npm run build && rm -rf create-neon-manual-test-project && node ./dist/src/bin/create-neon.js create-neon-manual-test-project" + "manual-test": "npm run build && rm -rf create-neon-manual-test-project && node ./dist/src/bin/create-neon.js --lib --yes create-neon-manual-test-project" }, "repository": { "type": "git", @@ -36,6 +36,7 @@ "@types/chai": "^4.3.11", "@types/command-line-args": "^5.2.3", "@types/command-line-usage": "^5.0.4", + "@types/handlebars-helpers": "^0.5.6", "@types/mocha": "^10.0.6", "@types/node": "^20.10.1", "chai": "^4.3.10", @@ -46,9 +47,11 @@ "typescript": "^5.3.2" }, "dependencies": { + "@neon-rs/manifest": "^0.0.4", "chalk": "^5.3.0", "command-line-args": "^5.2.1", "command-line-usage": "^7.0.1", - "handlebars": "^4.7.8" + "handlebars": "^4.7.8", + "handlebars-helpers": "^0.10.0" } } diff --git a/pkgs/create-neon/src/bin/create-neon.ts b/pkgs/create-neon/src/bin/create-neon.ts index 98344e1f8..3c73c9c67 100644 --- a/pkgs/create-neon/src/bin/create-neon.ts +++ b/pkgs/create-neon/src/bin/create-neon.ts @@ -8,9 +8,12 @@ import { Cache } from '../cache.js'; import { NPM } from '../cache/npm.js'; import { CI } from '../ci.js'; import { GitHub } from '../ci/github.js'; +import { Lang, ModuleType } from '../package.js'; +import { PlatformPreset, assertIsPlatformPreset, isPlatformPreset } from '@neon-rs/manifest/platform'; const TEMPLATES: Record = { ".gitignore.hbs": ".gitignore", + ".npmignore.hbs": ".npmignore", "Cargo.toml.hbs": "Cargo.toml", "README.md.hbs": "README.md", "lib.rs.hbs": path.join("src", "lib.rs"), @@ -19,8 +22,9 @@ const TEMPLATES: Record = { const OPTIONS = [ { name: 'lib', type: Boolean, defaultValue: false }, { name: 'bins', type: String, defaultValue: 'none' }, - { name: 'platform', type: String, multiple: true, defaultValue: [] }, - { name: 'ci', alias: 'c', type: String, defaultValue: 'github' } + { name: 'platform', type: String, multiple: true, defaultValue: ['common'] }, + { name: 'ci', alias: 'c', type: String, defaultValue: 'github' }, + { name: 'yes', alias: 'y', type: Boolean, defaultValue: false } ]; try { @@ -38,26 +42,36 @@ try { const platforms = parsePlatforms(opts.platform); const cache = parseCache(opts.lib, opts.bins, pkg); const ci = parseCI(opts.ci); + const yes = !!opts.yes; createNeon(pkg, { templates: TEMPLATES, - library: opts.lib, - cache, - ci, - platforms + library: opts.lib ? { + lang: Lang.TS, + module: ModuleType.ESM, + cache, + ci, + platforms + } : null, + yes }); } catch (e) { printErrorWithUsage(e); process.exit(1); } -function parsePlatforms(platforms: string[]): string | string[] | undefined { +function parsePlatforms(platforms: string[]): PlatformPreset | PlatformPreset[] | undefined { if (platforms.length === 0) { return undefined; } else if (platforms.length === 1) { - return platforms[0]; + const preset = platforms[0]; + assertIsPlatformPreset(preset); + return preset; } else { - return platforms; + return platforms.map(preset => { + assertIsPlatformPreset(preset); + return preset; + }); } } diff --git a/pkgs/create-neon/src/cache.ts b/pkgs/create-neon/src/cache.ts index 2a8dfe91c..8d2f633ee 100644 --- a/pkgs/create-neon/src/cache.ts +++ b/pkgs/create-neon/src/cache.ts @@ -1,3 +1,3 @@ export interface Cache { - + readonly type: string; } diff --git a/pkgs/create-neon/src/cache/npm.ts b/pkgs/create-neon/src/cache/npm.ts index 8d6f6dc12..e720e533b 100644 --- a/pkgs/create-neon/src/cache/npm.ts +++ b/pkgs/create-neon/src/cache/npm.ts @@ -1,9 +1,11 @@ import { Cache } from '../cache.js'; export class NPM implements Cache { - private _org: string | null; + readonly org: string | null; + + readonly type: string = "npm"; constructor(org: string | null) { - this._org = org; + this.org = org; } } diff --git a/pkgs/create-neon/src/ci.ts b/pkgs/create-neon/src/ci.ts index 9103a0077..1cd13e077 100644 --- a/pkgs/create-neon/src/ci.ts +++ b/pkgs/create-neon/src/ci.ts @@ -1,3 +1,4 @@ export interface CI { + readonly type: string; templates(): Record; } diff --git a/pkgs/create-neon/src/ci/github.ts b/pkgs/create-neon/src/ci/github.ts index b304c8227..4726aa0a3 100644 --- a/pkgs/create-neon/src/ci/github.ts +++ b/pkgs/create-neon/src/ci/github.ts @@ -2,6 +2,9 @@ import { CI } from '../ci.js'; import path from 'node:path'; const TEMPLATES: Record = { + ".env.hbs": path.join(".github", "workflows", ".env"), + "build.yml.hbs": path.join(".github", "workflows", "build.yml"), + "comments.yml.hbs": path.join(".github", "workflows", "comments.yml"), "publish.yml.hbs": path.join(".github", "workflows", "publish.yml"), "test.yml.hbs": path.join(".github", "workflows", "test.yml") }; @@ -9,6 +12,8 @@ const TEMPLATES: Record = { export class GitHub implements CI { constructor() { } + readonly type: string = "github"; + templates(): Record { return TEMPLATES; } diff --git a/pkgs/create-neon/src/expand.ts b/pkgs/create-neon/src/expand.ts index c252772ed..1d563711b 100644 --- a/pkgs/create-neon/src/expand.ts +++ b/pkgs/create-neon/src/expand.ts @@ -1,30 +1,41 @@ import { promises as fs } from 'fs'; import handlebars from 'handlebars'; +import helpers from 'handlebars-helpers'; import * as path from 'path'; -import Package from './package.js'; +import Package, { PackageSpec, Lang } from './package.js'; import { Versions } from './versions.js'; const TEMPLATES_DIR = new URL(path.join('..', 'data', 'templates', '/'), import.meta.url); export interface Metadata { - package: Package; + packageSpec: PackageSpec; + package?: Package | undefined; versions: Versions; } +// FIXME: move this into the GitHub plugin function ghaDelegate(this: any, options: handlebars.HelperOptions): handlebars.SafeString { return new handlebars.SafeString("${{" + options.fn(this) +"}}"); } +const COMPARISON_HELPERS = helpers('comparison'); + handlebars.registerHelper('$', ghaDelegate); +handlebars.registerHelper('eq', COMPARISON_HELPERS.eq); -export default async function expand( +export async function expand(source: string, metadata: Metadata): Promise { + let template = await fs.readFile(new URL(source, TEMPLATES_DIR), "utf8"); + let compiled = handlebars.compile(template, { noEscape: true }); + return compiled(metadata); +} + +export async function expandTo( source: string, target: string, metadata: Metadata ) { - let template = await fs.readFile(new URL(source, TEMPLATES_DIR), "utf8"); - let compiled = handlebars.compile(template, { noEscape: true }); - let expanded = compiled(metadata); + await fs.mkdir(path.dirname(target), { recursive: true }); + const expanded = await expand(source, metadata); // The 'wx' flag creates the file but fails if it already exists. await fs.writeFile(target, expanded, { flag: "wx" }); } diff --git a/pkgs/create-neon/src/index.ts b/pkgs/create-neon/src/index.ts index 706fa6776..435258c28 100644 --- a/pkgs/create-neon/src/index.ts +++ b/pkgs/create-neon/src/index.ts @@ -1,25 +1,32 @@ import { promises as fs } from 'fs'; import * as path from 'path'; import die from './die.js'; -import Package from './package.js'; +import Package, { PackageSpec, LibrarySpec, Lang, ModuleType, LANG_TEMPLATES } from './package.js'; import { VERSIONS } from './versions.js'; -import expand from './expand.js'; -import { Cache } from './cache.js'; -import { CI } from './ci.js'; +import { Metadata, expandTo } from './expand.js'; +import { LibraryManifest } from '@neon-rs/manifest'; +import { PlatformPreset } from '@neon-rs/manifest/platform'; export type CreateNeonOptions = { templates: Record, - library?: boolean, - cache?: Cache, - ci?: CI, - platforms?: string | string[] + library: LibrarySpec | null, + yes: boolean | undefined, }; export async function createNeon(name: string, options: CreateNeonOptions) { - options.library ??= false; - options.platforms ??= 'common'; + const packageSpec: PackageSpec = { + name, + library: options.library, + yes: options.yes + }; + + const metadata: Metadata = { + packageSpec, + versions: VERSIONS + }; let tmpFolderName: string = ""; + let tmpPackagePath: string = ""; try { // pretty lightweight way to check both that folder doesn't exist and @@ -27,7 +34,9 @@ export async function createNeon(name: string, options: CreateNeonOptions) { await fs.mkdir(name); await fs.rmdir(name); - tmpFolderName = await fs.mkdtemp(`${name}-`); + tmpFolderName = await fs.mkdtemp(`neon-`); + tmpPackagePath = path.join(tmpFolderName, name); + await fs.mkdir(tmpPackagePath); } catch (err: any) { await die(`Could not create \`${name}\`: ${err.message}`, tmpFolderName); } @@ -35,25 +44,55 @@ export async function createNeon(name: string, options: CreateNeonOptions) { let pkg: Package | undefined; try { - pkg = await Package.create(name, tmpFolderName); - await fs.mkdir(path.join(tmpFolderName, "src")); + pkg = await Package.create(metadata, tmpPackagePath); + metadata.package = pkg; + await fs.mkdir(path.join(tmpPackagePath, "src")); } catch (err: any) { - await die("Could not create `package.json`: " + err.message, tmpFolderName); + await die("Could not create `package.json`: " + err.message, tmpPackagePath); } if (pkg) { - for (let source of Object.keys(options.templates)) { - let target = path.join(tmpFolderName, options.templates[source]); - await expand(source, target, { - package: pkg, - versions: VERSIONS, - }); + for (const source of Object.keys(options.templates)) { + const target = path.join(tmpPackagePath, options.templates[source]); + await expandTo(source, target, metadata); + } + } + + if (options.library) { + const templates = LANG_TEMPLATES[options.library.lang]; + for (const source of Object.keys(templates)) { + const target = path.join(tmpPackagePath, templates[source]); + await expandTo(source, target, metadata); + } + + if (options.library.ci) { + const templates = options.library.ci.templates(); + for (const source of Object.keys(templates)) { + const target = path.join(tmpPackagePath, templates[source]); + await expandTo(`ci/${options.library.ci.type}/${source}`, target, metadata); + } } + + const manifest = await LibraryManifest.load(tmpPackagePath); + + const platformPresets: PlatformPreset[] = Array.isArray(options.library.platforms) + ? options.library.platforms + : !options.library.platforms + ? ['common'] + : [options.library.platforms]; + + for (const preset of platformPresets) { + await manifest.addPlatformPreset(preset); + } + + await manifest.saveChanges(msg => {}); } try { - await fs.rename(tmpFolderName, name); + await fs.rename(tmpPackagePath, name); + await fs.rmdir(tmpFolderName); } catch (err: any) { await die(`Could not create \`${name}\`: ${err.message}`, tmpFolderName); } + console.log(`✨ Created Neon project \`${name}\`. Happy 🦀 hacking! ✨`); } diff --git a/pkgs/create-neon/src/package.ts b/pkgs/create-neon/src/package.ts index 743a60b12..88562808f 100644 --- a/pkgs/create-neon/src/package.ts +++ b/pkgs/create-neon/src/package.ts @@ -2,6 +2,48 @@ import { promises as fs } from 'fs'; import * as path from 'path'; import shell from './shell.js'; import { VERSIONS } from './versions.js'; +import { Cache } from './cache.js'; +import { CI } from './ci.js'; +import { Metadata, expand, expandTo } from './expand.js'; +import { PlatformPreset } from '@neon-rs/manifest/platform'; + +export enum Lang { + JS = "js", + DTS = "dts", + TS = "ts" +} + +export const LANG_TEMPLATES: Record> = { + [Lang.JS]: {}, + [Lang.DTS]: {}, + [Lang.TS]: { + "tsconfig.json.hbs": "tsconfig.json", + "ts/index.cts.hbs": path.join("ts", "index.cts"), + "ts/index.mts.hbs": path.join("ts", "index.mts"), + "ts/load.cts.hbs": path.join("ts", "load.cts") + } +}; + +export enum ModuleType { + ESM = "esm", + CJS = "cjs" +} + +export type LibrarySpec = { + lang: Lang, + module: ModuleType, + cache?: Cache, + ci?: CI, + platforms?: PlatformPreset | PlatformPreset[] +}; + +export type PackageSpec = { + name: string, + library: LibrarySpec | null, + cache?: Cache | undefined, + ci?: CI | undefined, + yes: boolean | undefined +}; const KEYS = [ "name", @@ -32,33 +74,33 @@ export default class Package { description: string; quotedDescription: string; - static async create(name: string, dir: string): Promise { - let seed = { - name: name, - version: "0.1.0", - main: "index.node", - scripts: { - build: "cargo-cp-artifact -nc index.node -- cargo build --message-format=json-render-diagnostics", - "build-debug": "npm run build --", - "build-release": "npm run build -- --release", - install: "npm run build-release", - test: "cargo test", - }, - devDependencies: { - "cargo-cp-artifact": `^${VERSIONS["cargo-cp-artifact"]}`, - }, - }; - - let filename = path.join(dir, "package.json"); + static async create(metadata: Metadata, dir: string): Promise { + const baseTemplate = metadata.packageSpec.library + ? 'manifest/base/library.json.hbs' + : 'manifest/base/default.json.hbs'; + + // 1. Load the base contents of the manifest from the base template. + const seed = JSON.parse(await expand(baseTemplate, metadata)); + + // 2. Mixin the scripts from the scripts template. + seed.scripts = JSON.parse(await expand('manifest/scripts.json.hbs', metadata)); + + // 3. Mixin any scripts from the CI scripts template. + if (metadata.packageSpec.library && metadata.packageSpec.library.ci) { + const mixinTemplate = `ci/${metadata.packageSpec.library.ci.type}/manifest/scripts.json.hbs`; + Object.assign(seed.scripts, JSON.parse(await expand(mixinTemplate, metadata))); + } + + const filename = path.join(dir, "package.json"); // 1. Write initial values to prevent `npm init` from asking unnecessary questions. await fs.writeFile(filename, JSON.stringify(seed)); // 2. Call `npm init` to ask the user remaining questions. - await shell("npm", ["init"], dir); + await shell("npm", ["init", ...(metadata.packageSpec.yes ? ["--yes"] : [])], dir); // 3. Sort the values in idiomatic `npm init` order. - let sorted = sort(JSON.parse(await fs.readFile(filename, "utf8"))); + const sorted = sort(JSON.parse(await fs.readFile(filename, "utf8"))); // 4. Save the result to package.json. await fs.writeFile(filename, JSON.stringify(sorted, undefined, 2)); diff --git a/pkgs/create-neon/src/versions.ts b/pkgs/create-neon/src/versions.ts index 5de9bd195..0f35c1d96 100644 --- a/pkgs/create-neon/src/versions.ts +++ b/pkgs/create-neon/src/versions.ts @@ -12,11 +12,33 @@ import { createRequire } from 'module'; export type Versions = { - neon: string, - "cargo-cp-artifact": string + "neon": string, + "neonCLI": string, + "neonLoad": string, + "typescript": string, + "typesNode": string, + "tsconfigNode": { + "major": string, + "semver": string, + "module": string + }, + "node": string, + "actions": { + "checkout": string, + "githubScript": string, + "setupNode": string, + "setupRust": string, + "neonBuild": string, + "neonPublish": string, + "dotenv": string + } }; -const KEYS = ['neon', 'cargo-cp-artifact']; +const KEYS = [ + "neon", "neonCLI", "neonLoad", + "typescript", "typesNode", "tsconfigNode", + "node", "actions" +]; function assertIsVersions(data: unknown): asserts data is Versions { if (!data || typeof data !== 'object') { From a2ce7a5554717d4a65c466550b5ddad53e563728 Mon Sep 17 00:00:00 2001 From: David Herman Date: Tue, 26 Mar 2024 21:39:16 -0700 Subject: [PATCH 11/50] First working draft of build automation for libraries! - README improveements * copy edits * coalesce directory layout docs into a table - build.yml takes ref instead of branch - setup action shares common setup routines - scripts contain a `"release"` script instead of `"tag"`, which simply dispatches release.yml --- pkgs/create-neon/data/templates/README.md.hbs | 84 +++------ .../data/templates/ci/github/.env.hbs | 1 + .../data/templates/ci/github/build.yml.hbs | 110 ++++++----- .../ci/github/manifest/scripts.json.hbs | 3 +- .../data/templates/ci/github/publish.yml.hbs | 176 ------------------ .../data/templates/ci/github/release.yml.hbs | 134 +++++++++++++ .../data/templates/ci/github/setup.yml.hbs | 78 ++++++++ .../data/templates/ci/github/test.yml.hbs | 23 +-- pkgs/create-neon/data/versions.json | 7 +- pkgs/create-neon/src/ci/github.ts | 5 +- 10 files changed, 316 insertions(+), 305 deletions(-) delete mode 100644 pkgs/create-neon/data/templates/ci/github/publish.yml.hbs create mode 100644 pkgs/create-neon/data/templates/ci/github/release.yml.hbs create mode 100644 pkgs/create-neon/data/templates/ci/github/setup.yml.hbs diff --git a/pkgs/create-neon/data/templates/README.md.hbs b/pkgs/create-neon/data/templates/README.md.hbs index 7fcff1cd5..31fd5555c 100644 --- a/pkgs/create-neon/data/templates/README.md.hbs +++ b/pkgs/create-neon/data/templates/README.md.hbs @@ -16,11 +16,11 @@ To run the build, run: $ npm run build ``` -This command uses the [@neon-rs/cli](https://github.com/neon-rs/cli) utility to assemble the binary Node addon from the output of `cargo`. +This command uses the [@neon-rs/cli](https://www.npmjs.com/package/@neon-rs/cli) utility to assemble the binary Node addon from the output of `cargo`. ## Exploring {{package.name}} -After building {{package.name}}, you can explore its exports at the Node REPL: +After building {{package.name}}, you can explore its exports at the Node console: ```sh $ npm run build @@ -34,12 +34,12 @@ $ node In the project directory, you can run: {{#unless packageSpec.library}} -### `npm install` +#### `npm install` Installs the project, including running `npm run build`. {{/unless}} -### `npm run build` +#### `npm run build` Builds the Node addon (`index.node`) from source, generating a release build with `cargo --release`. @@ -57,7 +57,7 @@ Similar to `npm run build` but generates a debug build with `cargo`. Similar to `npm run build` but uses [cross-rs](https://github.com/cross-rs/cross) to cross-compile for another platform. Use the [`CARGO_BUILD_TARGET`](https://doc.rust-lang.org/cargo/reference/config.html#buildtarget) environment variable to select the build target. -### `npm test` +#### `npm test` Runs the unit tests by calling `cargo test`. You can learn more about [adding tests to your Rust code](https://doc.rust-lang.org/book/ch11-01-writing-tests.html) from the [Rust book](https://doc.rust-lang.org/book/). @@ -86,68 +86,32 @@ The directory structure of this project is: └── target/ ``` -### Cargo.toml - -The Cargo [manifest file](https://doc.rust-lang.org/cargo/reference/manifest.html), which informs the `cargo` command. - -### README.md - -This file. - +| Entry | Purpose | +|----------------|------------------------------------------------------------------------------------------------------------------------------------------| +| `Cargo.toml` | The Cargo [manifest file](https://doc.rust-lang.org/cargo/reference/manifest.html), which informs the `cargo` command. | +| `README.md` | This file. | {{#if packageSpec}} -### lib/ - {{#eq packageSpec.library.lang compare="ts"}} -The directory containing the generated output from [tsc](https://typescriptlang.org). - -### ts/ - -The directory containing the TypeScript source files. - -### ts/index.mts - -Entry point for when this library is loaded via [ESM `import`](https://nodejs.org/api/esm.html#modules-ecmascript-modules) syntax. - -### ts/index.cts - -Entry point for when this library is loaded via [CJS `require`](https://nodejs.org/api/modules.html#requireid). - +| `lib` | The directory containing the generated output from [tsc](https://typescriptlang.org). | +| `ts` | The directory containing the TypeScript source files. | +| `ts/index.mts` | Entry point for when this library is loaded via [ESM `import`](https://nodejs.org/api/esm.html#modules-ecmascript-modules) syntax. | +| `ts/index.cts` | Entry point for when this library is loaded via [CJS `require`](https://nodejs.org/api/modules.html#requireid). | {{else}} -The directory containing the JavaScript source files. - +| `lib` | The directory containing The directory containing the JavaScript source files. | {{/eq}} -### platforms/ - -The directory containing distributions of the binary addon backend for each platform supported by this library. - +| `platforms` | The directory containing distributions of the binary addon backend for each platform supported by this library. | {{else}} -### index.node - -The binary module (aka Node addon) generated by building the project. This is the main module for this package, as dictated by the `"main"` key in `package.json`. - -Under the hood, a [Node addon](https://nodejs.org/api/addons.html) is a [dynamically-linked shared object](https://en.wikipedia.org/wiki/Library_(computing)#Shared_libraries). The `"build"` script produces this file by copying it from within the `target/` directory, which is where the Rust build produces the shared object. - +| `index.node` | The main module, a [Node addon](https://nodejs.org/api/addons.html) generated by the build and pointed to by `"main"` in `package.json`. | {{/if}} -### package.json - -The npm [manifest file](https://docs.npmjs.com/cli/v7/configuring-npm/package-json), which informs the `npm` command. - -### src/ - -The directory tree containing the Rust source code for the project. - -### src/lib.rs - -The Rust library's main module. - -### target/ - -Binary artifacts generated by the Rust build. +| `package.json` | The npm [manifest file](https://docs.npmjs.com/cli/v7/configuring-npm/package-json), which informs the `npm` command. | +| `src` | The directory tree containing the Rust source code for the project. | +| `src/lib.rs` | The Rust library's main module. | +| `target` | Binary artifacts generated by the Rust build. | ## Learn More -To learn more about Neon, see the [Neon documentation](https://neon-bindings.com). - -To learn more about Rust, see the [Rust documentation](https://www.rust-lang.org). +Learn more about: -To learn more about Node, see the [Node documentation](https://nodejs.org). +- [Neon](https://neon-bindings.com). +- [Rust](https://www.rust-lang.org). +- [Node](https://nodejs.org). diff --git a/pkgs/create-neon/data/templates/ci/github/.env.hbs b/pkgs/create-neon/data/templates/ci/github/.env.hbs index 868db8f4b..0d2d2eb1b 100644 --- a/pkgs/create-neon/data/templates/ci/github/.env.hbs +++ b/pkgs/create-neon/data/templates/ci/github/.env.hbs @@ -1,4 +1,5 @@ NODE_VERSION=18.x NPM_REGISTRY=https://registry.npmjs.org +RUST_VERSION=stable ACTIONS_USER=github-actions ACTIONS_EMAIL=github-actions@github.com diff --git a/pkgs/create-neon/data/templates/ci/github/build.yml.hbs b/pkgs/create-neon/data/templates/ci/github/build.yml.hbs index b40b3e1da..2c752b696 100644 --- a/pkgs/create-neon/data/templates/ci/github/build.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/build.yml.hbs @@ -3,11 +3,10 @@ name: Build on: workflow_call: inputs: - branch: - description: 'Branch to check out' - required: false + ref: + description: 'The branch, tag, or SHA to check out' + required: true type: string - default: {{#$}} github.event.repository.default_branch {{/$}} update-version: description: 'Update version before building?' required: false @@ -23,6 +22,11 @@ on: required: false type: boolean default: false + tag: + description: 'The release tag (ignored if github-release is false)' + required: false + type: string + default: '' jobs: matrix: @@ -34,33 +38,15 @@ jobs: - name: Checkout Code uses: actions/checkout@{{versions.actions.checkout}} with: - token: {{#$}} secrets.TAG_TOKEN || github.token {{/$}} - ref: {{#$}} inputs.branch {{/$}} - - name: Set Environment Variables - uses: falti/dotenv-action@{{versions.actions.dotenv}} - with: - path: ./.github/workflows/.env - export-variables: true - keys-case: bypass - - name: Install Node - uses: actions/setup-node@{{versions.actions.setupNode}} + ref: {{#$}} inputs.ref {{/$}} + - name: Setup Neon Environment + uses: ./.github/actions/setup with: - node-version: {{#$}} env.NODE_VERSION {{/$}} - registry-url: {{#$}} env.NPM_REGISTRY {{/$}} - cache: npm - - name: Install Dependencies - shell: bash - run: npm ci - - name: Install cargo-messages - shell: bash - run: npm ci - working-directory: ./pkgs/cargo-messages + use-rust: false - name: Look Up Matrix Data id: matrixData shell: bash - run: | - echo "json=$(node ../../dist/cli ci github | jq -rc)" >> "$GITHUB_OUTPUT" - working-directory: ./pkgs/cargo-messages + run: echo "json=$(npx neon ci github | jq -rc)" >> "$GITHUB_OUTPUT" - name: Compute Matrix id: matrix uses: actions/github-script@{{versions.actions.githubScript}} @@ -91,19 +77,15 @@ jobs: - name: Checkout Code uses: actions/checkout@{{versions.actions.checkout}} with: + ref: {{#$}} inputs.ref {{/$}} fetch-depth: 0 - - name: Set Environment Variables - uses: falti/dotenv-action@{{versions.actions.dotenv}} + - name: Setup Neon Environment + id: neon + uses: ./.github/actions/setup with: - path: ./.github/workflows/.env - export-variables: true - keys-case: bypass - - name: Diagnostics - shell: bash - run: git log -10 - - name: Install Dependencies - shell: bash - run: npm ci + use-cross: {{#$}} matrix.cfg.script == 'cross' {{/$}} + platform: {{#$}} matrix.cfg.platform {{/$}} + workspace: ./pkgs/cargo-messages - name: Update Version if: {{#$}} inputs.update-version {{/$}} shell: bash @@ -111,14 +93,48 @@ jobs: git config --global user.name $ACTIONS_USER git config --global user.email $ACTIONS_EMAIL npm version {{#$}} inputs.version {{/$}} -m "v%s" - - name: Check Versions - shell: bash - run: ./test/lint/check-versions.sh - name: Build - uses: neon-actions/build@{{versions.actions.neonBuild}} + shell: bash + env: + CARGO_BUILD_TARGET: {{#$}} steps.neon.outputs.target {{/$}} + NEON_BUILD_PLATFORM: {{#$}} matrix.cfg.platform {{/$}} + run: npm run ${{ matrix.cfg.script }} + - name: Pack + id: pack + shell: bash + run: | + mkdir -p dist + echo filename=$(basename $(npm pack ./platforms/{{#$}} matrix.cfg.platform {{/$}} --pack-destination=./dist --json | jq -r '.[0].filename')) >> $GITHUB_OUTPUT + - name: Release + if: {{#$}} inputs.github-release {{/$}} + uses: softprops/action-gh-release@{{versions.actions.ghRelease}} with: - working-directory: ./pkgs/cargo-messages - node-version: {{#$}} env.NODE_VERSION {{/$}} - use-cross: {{#$}} !!matrix.cfg.cross {{/$}} - platform: {{#$}} matrix.cfg.platform {{/$}} - github-release: {{#$}} inputs.github-release {{/$}} + files: ./dist/{{#$}} steps.build.outputs.filename {{/$}} + tag_name: {{#$}} inputs.tag {{/$}} + + main: + name: Main + needs: [matrix] + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@{{versions.actions.checkout}} + with: + ref: {{#$}} inputs.ref {{/$}} + fetch-depth: 0 + - name: Setup Neon Environment + uses: ./.github/actions/setup + with: + use-rust: false + - name: Pack + id: pack + shell: bash + run: | + mkdir -p dist + echo "filename=$(npm pack --pack-destination=./dist)" >> $GITHUB_OUTPUT + - name: Release + if: {{#$}} inputs.github-release {{/$}} + uses: softprops/action-gh-release@{{versions.actions.ghRelease}} + with: + files: ./dist/{{#$}} steps.build.outputs.filename {{/$}} + tag_name: {{#$}} inputs.tag {{/$}} diff --git a/pkgs/create-neon/data/templates/ci/github/manifest/scripts.json.hbs b/pkgs/create-neon/data/templates/ci/github/manifest/scripts.json.hbs index 66eeb37ef..368ed351e 100644 --- a/pkgs/create-neon/data/templates/ci/github/manifest/scripts.json.hbs +++ b/pkgs/create-neon/data/templates/ci/github/manifest/scripts.json.hbs @@ -1,5 +1,4 @@ { - "tag": "npm version -m 'v%s'", - "posttag": "git push --follow-tags", + "release": "gh workflow run release.yml -f dryrun=false -f version=patch", "dryrun": "gh workflow run publish.yml -f dryrun=true" } diff --git a/pkgs/create-neon/data/templates/ci/github/publish.yml.hbs b/pkgs/create-neon/data/templates/ci/github/publish.yml.hbs deleted file mode 100644 index 96552073b..000000000 --- a/pkgs/create-neon/data/templates/ci/github/publish.yml.hbs +++ /dev/null @@ -1,176 +0,0 @@ -name: Publish - -run-name: | - {{#$}} (github.event_name == 'workflow_dispatch' && inputs.dryrun - && 'Dry run') - || (github.event_name == 'workflow_dispatch' - && format('Tag release: {0}', (inputs.version == 'custom' && inputs.custom) || inputs.version)) - || format('Publish: {0}', github.event.head_commit.message) {{/$}} - -on: - # Event: A maintainer has pushed a new release tag for publication. - push: - tags: - - v* - - # Event: A maintainer has used the GitHub Actions UI to initiate - # either tagging a new release for publication or doing a - # dry run. - workflow_dispatch: - inputs: - dryrun: - description: 'Dry run (no npm publish)' - required: false - type: boolean - default: true - version: - description: 'Version component to update (or "custom" to provide exact version)' - required: true - default: 'patch' - type: choice - options: - - patch - - minor - - major - - prepatch - - preminor - - premajor - - prerelease - - custom - custom: - description: 'Custom version' - required: false - default: '' - -jobs: - setup: - name: Setup - runs-on: ubuntu-latest - permissions: - contents: write - outputs: - dryrun: {{#$}} steps.dryrun.outputs.dryrun {{/$}} - tag: {{#$}} steps.tag.outputs.tag {{/$}} - publish: {{#$}} steps.publish.outputs.publish {{/$}} - steps: - - name: Validate Workflow Inputs - if: {{#$}} inputs.version == 'custom' && inputs.custom == '' {{/$}} - shell: bash - run: | - echo '::error::No custom version number provided' - exit 1 - - id: dryrun - name: Validate Dry Run Event - if: {{#$}} github.event_name == 'workflow_dispatch' && inputs.dryrun {{/$}} - shell: bash - run: echo dryrun=true >> "$GITHUB_OUTPUT" - - id: tag - name: Validate Tag Event - if: {{#$}} github.event_name == 'workflow_dispatch' && !inputs.dryrun {{/$}} - shell: bash - env: - TAG_TOKEN: {{#$}} secrets.TAG_TOKEN {{/$}} - run: | - if [[ -z $TAG_TOKEN ]]; then - echo "::error::Secret TAG_TOKEN is not defined for this GitHub repo." - echo "::error::To push a publish tag, this action requires:" - echo "::error:: • a GitHub Personal Access Token;" - echo "::error:: • with Read-Write access to this repo;" - echo "::error:: • stored as a repo secret named TAG_TOKEN." - echo "::error::See https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens for info about creating GitHub Personal Access Tokens." - echo "::error::See https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions for info about how to store GitHub repo secrets." - exit 1 - fi - echo tag=true >> "$GITHUB_OUTPUT" - - id: publish - name: Validate Publish Event - if: {{#$}} github.event_name == 'push' {{/$}} - shell: bash - env: - NPM_TOKEN: {{#$}} secrets.NPM_TOKEN {{/$}} - run: | - if [[ -z $NPM_TOKEN ]]; then - echo "::error::Secret NPM_TOKEN is not defined for this GitHub repo." - echo "::error::To publish to npm, this action requires:" - echo "::error:: • an npm access token;" - echo "::error:: • with Read-Write access to this project's npm packages;" - echo "::error:: • stored as a repo secret named NPM_TOKEN." - echo "::error::See https://docs.npmjs.com/about-access-tokens for info about creating npm tokens." - echo "::error::See https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions for info about how to store GitHub repo secrets." - exit 1 - fi - echo publish=true >> "$GITHUB_OUTPUT" - - name: Checkout Code - uses: actions/checkout@{{versions.actions.checkout}} - with: - token: {{#$}} secrets.TAG_TOKEN || github.token {{/$}} - - name: Set Environment Variables - uses: falti/dotenv-action@{{versions.actions.dotenv}} - with: - path: ./.github/workflows/.env - export-variables: true - keys-case: bypass - - name: Install Node - uses: actions/setup-node@{{versions.actions.setupNode}} - with: - node-version: {{#$}} env.NODE_VERSION {{/$}} - registry-url: {{#$}} env.NPM_REGISTRY {{/$}} - cache: npm - - name: Install Dependencies - shell: bash - run: npm ci - - name: Tag Release (manual only) - if: {{#$}} steps.tag.outputs.tag {{/$}} - shell: bash - run: | - git config --global user.name $ACTIONS_USER - git config --global user.email $ACTIONS_EMAIL - npm run tag -- '{{#$}} (inputs.version == 'custom' && inputs.custom) || inputs.version {{/$}}' - - build: - name: Build - needs: [setup] - permissions: - contents: write - uses: ./.github/workflows/build.yml - with: - update-version: {{#$}} !!needs.setup.outputs.dryrun {{/$}} - version: {{#$}} (inputs.version == 'custom' && inputs.custom) || inputs.version {{/$}} - github-release: {{#$}} !!needs.setup.outputs.publish {{/$}} - - publish: - name: Publish - if: {{#$}} needs.setup.outputs.publish {{/$}} - needs: [setup, build] - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Checkout Code - uses: actions/checkout@{{versions.actions.checkout}} - with: - fetch-depth: 0 - - name: Set Environment Variables - uses: falti/dotenv-action@{{versions.actions.dotenv}} - with: - path: ./.github/workflows/.env - export-variables: true - keys-case: bypass - - name: Install Node - uses: actions/setup-node@{{versions.actions.setupNode}} - with: - node-version: {{#$}} env.NODE_VERSION {{/$}} - registry-url: {{#$}} env.NPM_REGISTRY {{/$}} - cache: npm - - name: Install Dependencies - shell: bash - run: npm ci - - name: Publish - uses: neon-actions/publish@{{versions.actions.neonPublish}} - env: - NODE_AUTH_TOKEN: {{#$}} secrets.NPM_TOKEN {{/$}} - with: - node-version: {{#$}} env.NODE_VERSION {{/$}} - registry-url: {{#$}} env.NPM_REGISTRY {{/$}} - fetch-binaries: "*.tgz" - github-release: true diff --git a/pkgs/create-neon/data/templates/ci/github/release.yml.hbs b/pkgs/create-neon/data/templates/ci/github/release.yml.hbs new file mode 100644 index 000000000..48fcdb1f1 --- /dev/null +++ b/pkgs/create-neon/data/templates/ci/github/release.yml.hbs @@ -0,0 +1,134 @@ +name: Release + +run-name: | + {{#$}} (inputs.dryrun && 'Dry run') + || format('Release: {0}', (inputs.version == 'custom' && inputs.custom) || inputs.version) {{/$}} + +on: + workflow_dispatch: + inputs: + dryrun: + description: 'Dry run (no npm publish)' + required: false + type: boolean + default: true + version: + description: 'Version component to update (or "custom" to provide exact version)' + required: true + default: 'patch' + type: choice + options: + - patch + - minor + - major + - prepatch + - preminor + - premajor + - prerelease + - custom + custom: + description: 'Custom version' + required: false + default: '' + +jobs: + setup: + name: Setup + runs-on: ubuntu-latest + permissions: + contents: write + outputs: + dryrun: {{#$}} steps.dryrun.outputs.dryrun {{/$}} + publish: {{#$}} steps.publish.outputs.publish {{/$}} + ref: {{#$}} steps.tag.outputs.tag || github.event.repository.default_branch {{/$}} + tag: {{#$}} steps.tag.outputs.tag || '' {{/$}} + steps: + - name: Validate Workflow Inputs + if: {{#$}} inputs.version == 'custom' && inputs.custom == '' {{/$}} + shell: bash + run: | + echo '::error::No custom version number provided' + exit 1 + - id: dryrun + name: Validate Dry Run Event + if: {{#$}} inputs.dryrun {{/$}} + shell: bash + run: echo dryrun=true >> "$GITHUB_OUTPUT" + - id: publish + name: Validate Publish Event + if: {{#$}} !inputs.dryrun {{/$}} + shell: bash + env: + NPM_TOKEN: {{#$}} secrets.NPM_TOKEN {{/$}} + run: | + if [[ -z $NPM_TOKEN ]]; then + echo "::error::Secret NPM_TOKEN is not defined for this GitHub repo." + echo "::error::To publish to npm, this action requires:" + echo "::error:: • an npm access token;" + echo "::error:: • with Read-Write access to this project's npm packages;" + echo "::error:: • stored as a repo secret named NPM_TOKEN." + echo "::error::See https://docs.npmjs.com/about-access-tokens for info about creating npm tokens." + echo "::error::See https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions for info about how to store GitHub repo secrets." + exit 1 + fi + echo publish=true >> "$GITHUB_OUTPUT" + - name: Checkout Code + uses: actions/checkout@{{versions.actions.checkout}} + - name: Setup Neon Environment + uses: ./.github/actions/setup + with: + use-rust: false + - name: Tag Release (manual only) + if: {{#$}} !inputs.dryrun {{/$}} + shell: bash + run: | + git config --global user.name $ACTIONS_USER + git config --global user.email $ACTIONS_EMAIL + npm version -m 'v%s' '{{#$}} (inputs.version == 'custom' && inputs.custom) || inputs.version {{/$}}' + git push --follow-tags + echo tag=$(git describe --abbrev=0) >> "$GITHUB_OUTPUT" + + build: + name: Build + needs: [setup] + permissions: + contents: write + uses: ./.github/workflows/build.yml + with: + ref: {{#$}} needs.setup.outputs.ref {{/$}} + tag: {{#$}} needs.setup.outputs.tag {{/$}} + update-version: {{#$}} !!needs.setup.outputs.dryrun {{/$}} + version: {{#$}} (inputs.version == 'custom' && inputs.custom) || inputs.version {{/$}} + github-release: {{#$}} !!needs.setup.outputs.publish {{/$}} + + publish: + name: Publish + if: {{#$}} needs.setup.outputs.publish {{/$}} + needs: [setup, build] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout Code + uses: actions/checkout@{{versions.actions.checkout}} + with: + fetch-depth: 0 + ref: {{#$}} needs.setup.outputs.ref {{/$}} + - name: Setup Neon Environment + uses: ./.github/actions/setup + with: + use-rust: false + - name: Fetch + uses: robinraju/release-downloader@{{versions.actions.releaseDownloader}} + with: + tag: {{#$}} needs.setup.outputs.tag {{/$}} + fileName: "*.tgz" + out-file-path: ./dist + - name: Publish + shell: bash + env: + NODE_AUTH_TOKEN: {{#$}} secrets.NPM_TOKEN {{/$}} + run: | + for p in ./dist/*.tgz ; do + npm publish --access public $p + done diff --git a/pkgs/create-neon/data/templates/ci/github/setup.yml.hbs b/pkgs/create-neon/data/templates/ci/github/setup.yml.hbs new file mode 100644 index 000000000..7e3dee085 --- /dev/null +++ b/pkgs/create-neon/data/templates/ci/github/setup.yml.hbs @@ -0,0 +1,78 @@ +name: 'Setup Neon' +description: 'Setup the Neon toolchain.' +inputs: + platform: + description: 'Platform being built for.' + required: false + default: '' + use-rust: + description: 'Install Rust?' + required: false + default: 'true' + use-cross: + description: 'Install cross-rs?' + required: false + default: 'false' + workspace: + description: 'Path to workspace being setup.' + required: false + default: '.' +outputs: + rust: + description: 'Rust version installed.' + value: {{#$}} steps.rust.outputs.version {{/$}} + node: + description: 'Node version installed.' + value: {{#$}} steps.node.outputs.version {{/$}} + target: + description: 'Rust target architecture installed.' + value: {{#$}} steps.target.outputs.target {{/$}} +runs: + using: "composite" + steps: + - name: Set Environment Variables + uses: falti/dotenv-action@{{versions.actions.dotenv}} + with: + path: ./.github/.env + export-variables: true + keys-case: bypass + - name: Install Node + uses: actions/setup-node@{{versions.actions.setupNode}} + with: + node-version: {{#$}} env.NODE_VERSION {{/$}} + registry-url: {{#$}} env.NPM_REGISTRY {{/$}} + cache: npm + - name: Install Dependencies + shell: bash + run: npm ci + - name: Compute Rust Target + if: {{#$}} inputs['use-rust'] == 'true' {{/$}} + id: target + shell: bash + run: echo target=$(npx neon list-platforms | jq -r '.["{{#$}} inputs.platform {{/$}}"]') >> $GITHUB_OUTPUT + working-directory: {{#$}} inputs.workspace {{/$}} + - name: Install Rust + if: {{#$}} inputs['use-rust'] == 'true' {{/$}} + uses: actions-rs/toolchain@{{versions.actions.setupRust}} + with: + toolchain: {{#$}} env.RUST_VERSION {{/$}} + target: {{#$}} steps.target.outputs.target {{/$}} + override: true + - name: Install cross-rs + if: {{#$}} inputs['use-cross'] == 'true' {{/$}} + uses: baptiste0928/cargo-install@{{versions.actions.cargoInstall}} + with: + crate: cross + - name: Node Version + id: node + shell: bash + run: | + # Trim the leading 'v' (e.g. "v18.19.0" ==> "18.19.0") + echo version=$(node --version | cut -c 2-) >> $GITHUB_OUTPUT + - name: Rust Version + if: {{#$}} inputs['use-rust'] == 'true' {{/$}} + id: rust + shell: bash + run: | + # Trim extraneous metadata (e.g. "rustc 1.70.0 (90c541806 2023-05-31)" ==> "1.70.0") + echo version=$(rustc --version | awk '{ print $2; }') >> $GITHUB_OUTPUT diff --git a/pkgs/create-neon/data/templates/ci/github/test.yml.hbs b/pkgs/create-neon/data/templates/ci/github/test.yml.hbs index b88f717a6..66090ac14 100644 --- a/pkgs/create-neon/data/templates/ci/github/test.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/test.yml.hbs @@ -27,25 +27,16 @@ jobs: uses: actions/checkout@{{versions.actions.checkout}} with: fetch-depth: 0 - - name: Set Environment Variables - uses: falti/dotenv-action@{{versions.actions.dotenv}} + - name: Setup Neon Environment + id: neon + uses: ./.github/actions/setup with: - path: ./.github/workflows/.env - export-variables: true - keys-case: bypass - - name: Install Node - uses: actions/setup-node@{{versions.actions.setupNode}} - with: - node-version: {{#$}} env.NODE_VERSION {{/$}} - registry-url: {{#$}} env.NPM_REGISTRY {{/$}} - cache: npm - - name: Install Rust - uses: actions-rs/toolchain@{{versions.actions.setupRust}} - - name: Install Dependencies - shell: bash - run: npm ci --verbose + platform: linux-x64-gnu - name: Build shell: bash + env: + CARGO_BUILD_TARGET: {{#$}} steps.neon.outputs.target {{/$}} + NEON_BUILD_PLATFORM: linux-x64-gnu run: npm run debug - name: Test shell: bash diff --git a/pkgs/create-neon/data/versions.json b/pkgs/create-neon/data/versions.json index d8e2e998f..797dab112 100644 --- a/pkgs/create-neon/data/versions.json +++ b/pkgs/create-neon/data/versions.json @@ -1,6 +1,6 @@ { "neon": "1", - "neonCLI": "0.1.0", + "neonCLI": "0.1.64", "neonLoad": "0.1.0", "typescript": "5.3.3", "typesNode": "20.11.16", @@ -15,8 +15,11 @@ "githubScript": "v7", "setupNode": "v3", "setupRust": "v1", + "cargoInstall": "v2", "neonBuild": "v0.9", "neonPublish": "v0.4.1", - "dotenv": "v1" + "dotenv": "v1", + "ghRelease": "v1", + "releaseDownloader": "v1.7" } } diff --git a/pkgs/create-neon/src/ci/github.ts b/pkgs/create-neon/src/ci/github.ts index 4726aa0a3..8dd1beaa2 100644 --- a/pkgs/create-neon/src/ci/github.ts +++ b/pkgs/create-neon/src/ci/github.ts @@ -2,10 +2,11 @@ import { CI } from '../ci.js'; import path from 'node:path'; const TEMPLATES: Record = { - ".env.hbs": path.join(".github", "workflows", ".env"), + "setup.yml.hbs": path.join(".github", "actions", "setup", "action.yml"), + ".env.hbs": path.join(".github", ".env"), "build.yml.hbs": path.join(".github", "workflows", "build.yml"), "comments.yml.hbs": path.join(".github", "workflows", "comments.yml"), - "publish.yml.hbs": path.join(".github", "workflows", "publish.yml"), + "release.yml.hbs": path.join(".github", "workflows", "release.yml"), "test.yml.hbs": path.join(".github", "workflows", "test.yml") }; From 7460c7c60a64e8ae542b2c90c82b5f12ce7ffbd7 Mon Sep 17 00:00:00 2001 From: David Herman Date: Wed, 27 Mar 2024 08:58:54 -0700 Subject: [PATCH 12/50] move hbs delegate into GitHub CI plugin --- pkgs/create-neon/src/ci.ts | 1 + pkgs/create-neon/src/ci/github.ts | 9 +++++++++ pkgs/create-neon/src/expand.ts | 5 ----- pkgs/create-neon/src/index.ts | 4 ++++ 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/pkgs/create-neon/src/ci.ts b/pkgs/create-neon/src/ci.ts index 1cd13e077..de18547bc 100644 --- a/pkgs/create-neon/src/ci.ts +++ b/pkgs/create-neon/src/ci.ts @@ -1,4 +1,5 @@ export interface CI { readonly type: string; templates(): Record; + setup(): void; } diff --git a/pkgs/create-neon/src/ci/github.ts b/pkgs/create-neon/src/ci/github.ts index 8dd1beaa2..65ec39e8e 100644 --- a/pkgs/create-neon/src/ci/github.ts +++ b/pkgs/create-neon/src/ci/github.ts @@ -1,3 +1,4 @@ +import handlebars from 'handlebars'; import { CI } from '../ci.js'; import path from 'node:path'; @@ -10,6 +11,10 @@ const TEMPLATES: Record = { "test.yml.hbs": path.join(".github", "workflows", "test.yml") }; +function githubDelegate(this: any, options: handlebars.HelperOptions): handlebars.SafeString { + return new handlebars.SafeString("${{" + options.fn(this) +"}}"); +} + export class GitHub implements CI { constructor() { } @@ -18,4 +23,8 @@ export class GitHub implements CI { templates(): Record { return TEMPLATES; } + + setup(): void { + handlebars.registerHelper('$', githubDelegate); + } } diff --git a/pkgs/create-neon/src/expand.ts b/pkgs/create-neon/src/expand.ts index 1d563711b..15d56d366 100644 --- a/pkgs/create-neon/src/expand.ts +++ b/pkgs/create-neon/src/expand.ts @@ -13,14 +13,9 @@ export interface Metadata { versions: Versions; } -// FIXME: move this into the GitHub plugin -function ghaDelegate(this: any, options: handlebars.HelperOptions): handlebars.SafeString { - return new handlebars.SafeString("${{" + options.fn(this) +"}}"); -} const COMPARISON_HELPERS = helpers('comparison'); -handlebars.registerHelper('$', ghaDelegate); handlebars.registerHelper('eq', COMPARISON_HELPERS.eq); export async function expand(source: string, metadata: Metadata): Promise { diff --git a/pkgs/create-neon/src/index.ts b/pkgs/create-neon/src/index.ts index 435258c28..b8041f169 100644 --- a/pkgs/create-neon/src/index.ts +++ b/pkgs/create-neon/src/index.ts @@ -51,6 +51,10 @@ export async function createNeon(name: string, options: CreateNeonOptions) { await die("Could not create `package.json`: " + err.message, tmpPackagePath); } if (pkg) { + if (options.library && options.library.ci) { + options.library.ci.setup(); + } + for (const source of Object.keys(options.templates)) { const target = path.join(tmpPackagePath, options.templates[source]); await expandTo(source, target, metadata); From 00394f8c98fdbe843445750b6ea47b7636ce0d5f Mon Sep 17 00:00:00 2001 From: David Herman Date: Wed, 27 Mar 2024 09:20:18 -0700 Subject: [PATCH 13/50] update versions --- pkgs/create-neon/data/versions.json | 2 +- pkgs/create-neon/src/versions.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/create-neon/data/versions.json b/pkgs/create-neon/data/versions.json index 797dab112..24968012e 100644 --- a/pkgs/create-neon/data/versions.json +++ b/pkgs/create-neon/data/versions.json @@ -1,7 +1,7 @@ { "neon": "1", "neonCLI": "0.1.64", - "neonLoad": "0.1.0", + "neonLoad": "0.1.64", "typescript": "5.3.3", "typesNode": "20.11.16", "tsconfigNode": { diff --git a/pkgs/create-neon/src/versions.ts b/pkgs/create-neon/src/versions.ts index 0f35c1d96..0e4764e86 100644 --- a/pkgs/create-neon/src/versions.ts +++ b/pkgs/create-neon/src/versions.ts @@ -28,9 +28,12 @@ export type Versions = { "githubScript": string, "setupNode": string, "setupRust": string, + "cargoInstall": string, "neonBuild": string, "neonPublish": string, - "dotenv": string + "dotenv": string, + "ghRelease": string, + "releaseDownloader": string } }; From 88e8bb710b87e5722b41892783b63924002ceab4 Mon Sep 17 00:00:00 2001 From: David Herman Date: Wed, 27 Mar 2024 10:23:06 -0700 Subject: [PATCH 14/50] npm run prettier --- pkgs/create-neon/src/bin/create-neon.ts | 88 ++++++++++++++---------- pkgs/create-neon/src/cache/npm.ts | 2 +- pkgs/create-neon/src/ci/github.ts | 19 +++--- pkgs/create-neon/src/die.ts | 2 +- pkgs/create-neon/src/expand.ts | 27 +++++--- pkgs/create-neon/src/index.ts | 51 +++++++++----- pkgs/create-neon/src/package.ts | 63 +++++++++-------- pkgs/create-neon/src/print.ts | 90 ++++++++++++++++--------- pkgs/create-neon/src/shell.ts | 6 +- pkgs/create-neon/src/versions.ts | 65 +++++++++--------- pkgs/create-neon/test/create-neon.ts | 20 +++--- 11 files changed, 259 insertions(+), 174 deletions(-) diff --git a/pkgs/create-neon/src/bin/create-neon.ts b/pkgs/create-neon/src/bin/create-neon.ts index 3c73c9c67..edc1a5d21 100644 --- a/pkgs/create-neon/src/bin/create-neon.ts +++ b/pkgs/create-neon/src/bin/create-neon.ts @@ -1,15 +1,19 @@ #!/usr/bin/env node -import * as path from 'path'; -import commandLineArgs from 'command-line-args'; -import { printErrorWithUsage } from '../print.js'; -import { createNeon } from '../index.js'; -import { Cache } from '../cache.js'; -import { NPM } from '../cache/npm.js'; -import { CI } from '../ci.js'; -import { GitHub } from '../ci/github.js'; -import { Lang, ModuleType } from '../package.js'; -import { PlatformPreset, assertIsPlatformPreset, isPlatformPreset } from '@neon-rs/manifest/platform'; +import * as path from "path"; +import commandLineArgs from "command-line-args"; +import { printErrorWithUsage } from "../print.js"; +import { createNeon } from "../index.js"; +import { Cache } from "../cache.js"; +import { NPM } from "../cache/npm.js"; +import { CI } from "../ci.js"; +import { GitHub } from "../ci/github.js"; +import { Lang, ModuleType } from "../package.js"; +import { + PlatformPreset, + assertIsPlatformPreset, + isPlatformPreset, +} from "@neon-rs/manifest/platform"; const TEMPLATES: Record = { ".gitignore.hbs": ".gitignore", @@ -20,18 +24,18 @@ const TEMPLATES: Record = { }; const OPTIONS = [ - { name: 'lib', type: Boolean, defaultValue: false }, - { name: 'bins', type: String, defaultValue: 'none' }, - { name: 'platform', type: String, multiple: true, defaultValue: ['common'] }, - { name: 'ci', alias: 'c', type: String, defaultValue: 'github' }, - { name: 'yes', alias: 'y', type: Boolean, defaultValue: false } + { name: "lib", type: Boolean, defaultValue: false }, + { name: "bins", type: String, defaultValue: "none" }, + { name: "platform", type: String, multiple: true, defaultValue: ["common"] }, + { name: "ci", alias: "c", type: String, defaultValue: "github" }, + { name: "yes", alias: "y", type: Boolean, defaultValue: false }, ]; try { const opts = commandLineArgs(OPTIONS, { stopAtFirstUnknown: true }); if (!opts._unknown || opts._unknown.length === 0) { - throw new Error('No package name given'); + throw new Error("No package name given"); } if (opts._unknown.length > 1) { @@ -46,21 +50,25 @@ try { createNeon(pkg, { templates: TEMPLATES, - library: opts.lib ? { - lang: Lang.TS, - module: ModuleType.ESM, - cache, - ci, - platforms - } : null, - yes + library: opts.lib + ? { + lang: Lang.TS, + module: ModuleType.ESM, + cache, + ci, + platforms, + } + : null, + yes, }); } catch (e) { printErrorWithUsage(e); process.exit(1); } -function parsePlatforms(platforms: string[]): PlatformPreset | PlatformPreset[] | undefined { +function parsePlatforms( + platforms: string[] +): PlatformPreset | PlatformPreset[] | undefined { if (platforms.length === 0) { return undefined; } else if (platforms.length === 1) { @@ -68,7 +76,7 @@ function parsePlatforms(platforms: string[]): PlatformPreset | PlatformPreset[] assertIsPlatformPreset(preset); return preset; } else { - return platforms.map(preset => { + return platforms.map((preset) => { assertIsPlatformPreset(preset); return preset; }); @@ -77,27 +85,37 @@ function parsePlatforms(platforms: string[]): PlatformPreset | PlatformPreset[] function parseCI(ci: string): CI | undefined { switch (ci) { - case 'none': return undefined; - case 'github': return new GitHub(); + case "none": + return undefined; + case "github": + return new GitHub(); default: - throw new Error(`Unrecognized CI system ${ci}, expected 'github' or 'none'`); + throw new Error( + `Unrecognized CI system ${ci}, expected 'github' or 'none'` + ); } } -function parseCache(lib: boolean, bins: string, pkg: string): Cache | undefined { - const defaultOrg = '@' + pkg; +function parseCache( + lib: boolean, + bins: string, + pkg: string +): Cache | undefined { + const defaultOrg = "@" + pkg; - if (bins === 'none') { + if (bins === "none") { return lib ? new NPM(defaultOrg) : undefined; } - if (bins === 'npm') { + if (bins === "npm") { return new NPM(defaultOrg); } - if (bins.startsWith('npm:')) { + if (bins.startsWith("npm:")) { return new NPM(bins.substring(4)); } - throw new Error(`Unrecognized binaries cache ${bins}, expected 'npm[:org]' or 'none'`) + throw new Error( + `Unrecognized binaries cache ${bins}, expected 'npm[:org]' or 'none'` + ); } diff --git a/pkgs/create-neon/src/cache/npm.ts b/pkgs/create-neon/src/cache/npm.ts index e720e533b..fe69c65dc 100644 --- a/pkgs/create-neon/src/cache/npm.ts +++ b/pkgs/create-neon/src/cache/npm.ts @@ -1,4 +1,4 @@ -import { Cache } from '../cache.js'; +import { Cache } from "../cache.js"; export class NPM implements Cache { readonly org: string | null; diff --git a/pkgs/create-neon/src/ci/github.ts b/pkgs/create-neon/src/ci/github.ts index 65ec39e8e..17fc687c5 100644 --- a/pkgs/create-neon/src/ci/github.ts +++ b/pkgs/create-neon/src/ci/github.ts @@ -1,6 +1,6 @@ -import handlebars from 'handlebars'; -import { CI } from '../ci.js'; -import path from 'node:path'; +import handlebars from "handlebars"; +import { CI } from "../ci.js"; +import path from "node:path"; const TEMPLATES: Record = { "setup.yml.hbs": path.join(".github", "actions", "setup", "action.yml"), @@ -8,15 +8,18 @@ const TEMPLATES: Record = { "build.yml.hbs": path.join(".github", "workflows", "build.yml"), "comments.yml.hbs": path.join(".github", "workflows", "comments.yml"), "release.yml.hbs": path.join(".github", "workflows", "release.yml"), - "test.yml.hbs": path.join(".github", "workflows", "test.yml") + "test.yml.hbs": path.join(".github", "workflows", "test.yml"), }; -function githubDelegate(this: any, options: handlebars.HelperOptions): handlebars.SafeString { - return new handlebars.SafeString("${{" + options.fn(this) +"}}"); +function githubDelegate( + this: any, + options: handlebars.HelperOptions +): handlebars.SafeString { + return new handlebars.SafeString("${{" + options.fn(this) + "}}"); } export class GitHub implements CI { - constructor() { } + constructor() {} readonly type: string = "github"; @@ -25,6 +28,6 @@ export class GitHub implements CI { } setup(): void { - handlebars.registerHelper('$', githubDelegate); + handlebars.registerHelper("$", githubDelegate); } } diff --git a/pkgs/create-neon/src/die.ts b/pkgs/create-neon/src/die.ts index 31f066c41..b1b34f0a7 100644 --- a/pkgs/create-neon/src/die.ts +++ b/pkgs/create-neon/src/die.ts @@ -1,4 +1,4 @@ -import { promises as fs } from 'fs'; +import { promises as fs } from "fs"; function deleteNeonDir(dir: string): Promise { return fs.rm(dir, { force: true, recursive: true }); diff --git a/pkgs/create-neon/src/expand.ts b/pkgs/create-neon/src/expand.ts index 15d56d366..9e1ca8f05 100644 --- a/pkgs/create-neon/src/expand.ts +++ b/pkgs/create-neon/src/expand.ts @@ -1,11 +1,14 @@ -import { promises as fs } from 'fs'; -import handlebars from 'handlebars'; -import helpers from 'handlebars-helpers'; -import * as path from 'path'; -import Package, { PackageSpec, Lang } from './package.js'; -import { Versions } from './versions.js'; +import { promises as fs } from "fs"; +import handlebars from "handlebars"; +import helpers from "handlebars-helpers"; +import * as path from "path"; +import Package, { PackageSpec, Lang } from "./package.js"; +import { Versions } from "./versions.js"; -const TEMPLATES_DIR = new URL(path.join('..', 'data', 'templates', '/'), import.meta.url); +const TEMPLATES_DIR = new URL( + path.join("..", "data", "templates", "/"), + import.meta.url +); export interface Metadata { packageSpec: PackageSpec; @@ -13,12 +16,14 @@ export interface Metadata { versions: Versions; } +const COMPARISON_HELPERS = helpers("comparison"); -const COMPARISON_HELPERS = helpers('comparison'); +handlebars.registerHelper("eq", COMPARISON_HELPERS.eq); -handlebars.registerHelper('eq', COMPARISON_HELPERS.eq); - -export async function expand(source: string, metadata: Metadata): Promise { +export async function expand( + source: string, + metadata: Metadata +): Promise { let template = await fs.readFile(new URL(source, TEMPLATES_DIR), "utf8"); let compiled = handlebars.compile(template, { noEscape: true }); return compiled(metadata); diff --git a/pkgs/create-neon/src/index.ts b/pkgs/create-neon/src/index.ts index b8041f169..e246996be 100644 --- a/pkgs/create-neon/src/index.ts +++ b/pkgs/create-neon/src/index.ts @@ -1,28 +1,34 @@ -import { promises as fs } from 'fs'; -import * as path from 'path'; -import die from './die.js'; -import Package, { PackageSpec, LibrarySpec, Lang, ModuleType, LANG_TEMPLATES } from './package.js'; -import { VERSIONS } from './versions.js'; -import { Metadata, expandTo } from './expand.js'; -import { LibraryManifest } from '@neon-rs/manifest'; -import { PlatformPreset } from '@neon-rs/manifest/platform'; +import { promises as fs } from "fs"; +import * as path from "path"; +import die from "./die.js"; +import Package, { + PackageSpec, + LibrarySpec, + Lang, + ModuleType, + LANG_TEMPLATES, +} from "./package.js"; +import { VERSIONS } from "./versions.js"; +import { Metadata, expandTo } from "./expand.js"; +import { LibraryManifest } from "@neon-rs/manifest"; +import { PlatformPreset } from "@neon-rs/manifest/platform"; export type CreateNeonOptions = { - templates: Record, - library: LibrarySpec | null, - yes: boolean | undefined, + templates: Record; + library: LibrarySpec | null; + yes: boolean | undefined; }; export async function createNeon(name: string, options: CreateNeonOptions) { const packageSpec: PackageSpec = { name, library: options.library, - yes: options.yes + yes: options.yes, }; const metadata: Metadata = { packageSpec, - versions: VERSIONS + versions: VERSIONS, }; let tmpFolderName: string = ""; @@ -48,7 +54,10 @@ export async function createNeon(name: string, options: CreateNeonOptions) { metadata.package = pkg; await fs.mkdir(path.join(tmpPackagePath, "src")); } catch (err: any) { - await die("Could not create `package.json`: " + err.message, tmpPackagePath); + await die( + "Could not create `package.json`: " + err.message, + tmpPackagePath + ); } if (pkg) { if (options.library && options.library.ci) { @@ -72,23 +81,29 @@ export async function createNeon(name: string, options: CreateNeonOptions) { const templates = options.library.ci.templates(); for (const source of Object.keys(templates)) { const target = path.join(tmpPackagePath, templates[source]); - await expandTo(`ci/${options.library.ci.type}/${source}`, target, metadata); + await expandTo( + `ci/${options.library.ci.type}/${source}`, + target, + metadata + ); } } const manifest = await LibraryManifest.load(tmpPackagePath); - const platformPresets: PlatformPreset[] = Array.isArray(options.library.platforms) + const platformPresets: PlatformPreset[] = Array.isArray( + options.library.platforms + ) ? options.library.platforms : !options.library.platforms - ? ['common'] + ? ["common"] : [options.library.platforms]; for (const preset of platformPresets) { await manifest.addPlatformPreset(preset); } - await manifest.saveChanges(msg => {}); + await manifest.saveChanges((msg) => {}); } try { diff --git a/pkgs/create-neon/src/package.ts b/pkgs/create-neon/src/package.ts index 88562808f..726b7b983 100644 --- a/pkgs/create-neon/src/package.ts +++ b/pkgs/create-neon/src/package.ts @@ -1,16 +1,16 @@ -import { promises as fs } from 'fs'; -import * as path from 'path'; -import shell from './shell.js'; -import { VERSIONS } from './versions.js'; -import { Cache } from './cache.js'; -import { CI } from './ci.js'; -import { Metadata, expand, expandTo } from './expand.js'; -import { PlatformPreset } from '@neon-rs/manifest/platform'; +import { promises as fs } from "fs"; +import * as path from "path"; +import shell from "./shell.js"; +import { VERSIONS } from "./versions.js"; +import { Cache } from "./cache.js"; +import { CI } from "./ci.js"; +import { Metadata, expand, expandTo } from "./expand.js"; +import { PlatformPreset } from "@neon-rs/manifest/platform"; export enum Lang { JS = "js", DTS = "dts", - TS = "ts" + TS = "ts", } export const LANG_TEMPLATES: Record> = { @@ -20,29 +20,29 @@ export const LANG_TEMPLATES: Record> = { "tsconfig.json.hbs": "tsconfig.json", "ts/index.cts.hbs": path.join("ts", "index.cts"), "ts/index.mts.hbs": path.join("ts", "index.mts"), - "ts/load.cts.hbs": path.join("ts", "load.cts") - } + "ts/load.cts.hbs": path.join("ts", "load.cts"), + }, }; export enum ModuleType { ESM = "esm", - CJS = "cjs" + CJS = "cjs", } export type LibrarySpec = { - lang: Lang, - module: ModuleType, - cache?: Cache, - ci?: CI, - platforms?: PlatformPreset | PlatformPreset[] + lang: Lang; + module: ModuleType; + cache?: Cache; + ci?: CI; + platforms?: PlatformPreset | PlatformPreset[]; }; export type PackageSpec = { - name: string, - library: LibrarySpec | null, - cache?: Cache | undefined, - ci?: CI | undefined, - yes: boolean | undefined + name: string; + library: LibrarySpec | null; + cache?: Cache | undefined; + ci?: CI | undefined; + yes: boolean | undefined; }; const KEYS = [ @@ -76,19 +76,24 @@ export default class Package { static async create(metadata: Metadata, dir: string): Promise { const baseTemplate = metadata.packageSpec.library - ? 'manifest/base/library.json.hbs' - : 'manifest/base/default.json.hbs'; + ? "manifest/base/library.json.hbs" + : "manifest/base/default.json.hbs"; // 1. Load the base contents of the manifest from the base template. const seed = JSON.parse(await expand(baseTemplate, metadata)); // 2. Mixin the scripts from the scripts template. - seed.scripts = JSON.parse(await expand('manifest/scripts.json.hbs', metadata)); + seed.scripts = JSON.parse( + await expand("manifest/scripts.json.hbs", metadata) + ); // 3. Mixin any scripts from the CI scripts template. if (metadata.packageSpec.library && metadata.packageSpec.library.ci) { const mixinTemplate = `ci/${metadata.packageSpec.library.ci.type}/manifest/scripts.json.hbs`; - Object.assign(seed.scripts, JSON.parse(await expand(mixinTemplate, metadata))); + Object.assign( + seed.scripts, + JSON.parse(await expand(mixinTemplate, metadata)) + ); } const filename = path.join(dir, "package.json"); @@ -97,7 +102,11 @@ export default class Package { await fs.writeFile(filename, JSON.stringify(seed)); // 2. Call `npm init` to ask the user remaining questions. - await shell("npm", ["init", ...(metadata.packageSpec.yes ? ["--yes"] : [])], dir); + await shell( + "npm", + ["init", ...(metadata.packageSpec.yes ? ["--yes"] : [])], + dir + ); // 3. Sort the values in idiomatic `npm init` order. const sorted = sort(JSON.parse(await fs.readFile(filename, "utf8"))); diff --git a/pkgs/create-neon/src/print.ts b/pkgs/create-neon/src/print.ts index 79dc8f8b8..df0c08db7 100644 --- a/pkgs/create-neon/src/print.ts +++ b/pkgs/create-neon/src/print.ts @@ -1,8 +1,8 @@ -import commandLineUsage from 'command-line-usage'; -import chalk from 'chalk'; +import commandLineUsage from "command-line-usage"; +import chalk from "chalk"; function pink(text: string): string { - return chalk.bold.hex('#e75480')(text); + return chalk.bold.hex("#e75480")(text); } function green(text: string): string { @@ -24,41 +24,65 @@ function bold(text: string): string { function mainUsage(): string { const sections = [ { - content: `✨ ${pink('create-neon:')} create a new Neon project with zero configuration ✨`, - raw: true + content: `✨ ${pink( + "create-neon:" + )} create a new Neon project with zero configuration ✨`, + raw: true, }, { - header: green('Examples:'), + header: green("Examples:"), content: [ - `${blue('$')} ${bold('npm init neon my-package')}`, - '', - 'Create a Neon project `my-package`.', - '', - `${blue('$')} ${bold('npm init neon --lib my-lib')}`, - '', - 'Create a Neon library `my-lib`, pre-configured to publish pre-builds for common Node target platforms as binary packages under the `@my-lib` org. The generated project includes GitHub CI/CD actions for testing and publishing.', - '', - `${blue('$')} ${bold('npm init neon --lib my-library --target desktop')}`, - '', - 'Similar but configured to target just common Node desktop platforms.' - ] + `${blue("$")} ${bold("npm init neon my-package")}`, + "", + "Create a Neon project `my-package`.", + "", + `${blue("$")} ${bold("npm init neon --lib my-lib")}`, + "", + "Create a Neon library `my-lib`, pre-configured to publish pre-builds for common Node target platforms as binary packages under the `@my-lib` org. The generated project includes GitHub CI/CD actions for testing and publishing.", + "", + `${blue("$")} ${bold( + "npm init neon --lib my-library --target desktop" + )}`, + "", + "Similar but configured to target just common Node desktop platforms.", + ], }, { - header: blue('Usage:'), - content: `${blue('$')} npm init neon [--lib] [--bins ] [--ci ] [--target ]* ` + header: blue("Usage:"), + content: `${blue( + "$" + )} npm init neon [--lib] [--bins ] [--ci ] [--target ]* `, }, { - header: yellow('Options:'), + header: yellow("Options:"), content: [ - { name: '--lib', summary: 'Configure package as a library. (Implied defaults: `--bins npm` and `--ci github`)' }, - { name: '--bins npm[:@]', summary: 'Configure for pre-built binaries published to npm. (Default org: )' }, - { name: '--bins none', summary: 'Do not configure for pre-built binaries. (Default)' }, - { name: '--target ', summary: 'May be used to specify one or more targets for pre-built binaries. (Default: common)' }, - { name: '--ci github', summary: 'Generate CI/CD configuration for GitHub Actions. (Default)' }, - { name: '--ci none', summary: 'Do not generate CI/CD configuration.' }, - { name: '', summary: 'Package name.' } - ] - } + { + name: "--lib", + summary: + "Configure package as a library. (Implied defaults: `--bins npm` and `--ci github`)", + }, + { + name: "--bins npm[:@]", + summary: + "Configure for pre-built binaries published to npm. (Default org: )", + }, + { + name: "--bins none", + summary: "Do not configure for pre-built binaries. (Default)", + }, + { + name: "--target ", + summary: + "May be used to specify one or more targets for pre-built binaries. (Default: common)", + }, + { + name: "--ci github", + summary: "Generate CI/CD configuration for GitHub Actions. (Default)", + }, + { name: "--ci none", summary: "Do not generate CI/CD configuration." }, + { name: "", summary: "Package name." }, + ], + }, ]; return commandLineUsage(sections).trim(); @@ -75,5 +99,9 @@ export function printErrorWithUsage(e: any) { } export function printError(e: any) { - console.error(chalk.bold.red("error:") + " " + ((e instanceof Error) ? e.message : String(e))); + console.error( + chalk.bold.red("error:") + + " " + + (e instanceof Error ? e.message : String(e)) + ); } diff --git a/pkgs/create-neon/src/shell.ts b/pkgs/create-neon/src/shell.ts index c7e3db15f..ec061ea44 100644 --- a/pkgs/create-neon/src/shell.ts +++ b/pkgs/create-neon/src/shell.ts @@ -1,6 +1,6 @@ -import { spawn } from 'child_process'; -import { promises as fs } from 'fs'; -import path from 'path'; +import { spawn } from "child_process"; +import { promises as fs } from "fs"; +import path from "path"; /** * Transparently shell out to an executable with a list of arguments. diff --git a/pkgs/create-neon/src/versions.ts b/pkgs/create-neon/src/versions.ts index 0e4764e86..19e4de458 100644 --- a/pkgs/create-neon/src/versions.ts +++ b/pkgs/create-neon/src/versions.ts @@ -9,45 +9,50 @@ // and generates a stable format that Node doesn't complain about, we can eliminate this // boilerplate wrapper module. -import { createRequire } from 'module'; +import { createRequire } from "module"; export type Versions = { - "neon": string, - "neonCLI": string, - "neonLoad": string, - "typescript": string, - "typesNode": string, - "tsconfigNode": { - "major": string, - "semver": string, - "module": string - }, - "node": string, - "actions": { - "checkout": string, - "githubScript": string, - "setupNode": string, - "setupRust": string, - "cargoInstall": string, - "neonBuild": string, - "neonPublish": string, - "dotenv": string, - "ghRelease": string, - "releaseDownloader": string - } + neon: string; + neonCLI: string; + neonLoad: string; + typescript: string; + typesNode: string; + tsconfigNode: { + major: string; + semver: string; + module: string; + }; + node: string; + actions: { + checkout: string; + githubScript: string; + setupNode: string; + setupRust: string; + cargoInstall: string; + neonBuild: string; + neonPublish: string; + dotenv: string; + ghRelease: string; + releaseDownloader: string; + }; }; const KEYS = [ - "neon", "neonCLI", "neonLoad", - "typescript", "typesNode", "tsconfigNode", - "node", "actions" + "neon", + "neonCLI", + "neonLoad", + "typescript", + "typesNode", + "tsconfigNode", + "node", + "actions", ]; function assertIsVersions(data: unknown): asserts data is Versions { - if (!data || typeof data !== 'object') { + if (!data || typeof data !== "object") { throw new TypeError("expected object"); } - KEYS.forEach(key => { + KEYS.forEach((key) => { if (!(key in data)) { throw new TypeError(`require '${key}' property not found`); } @@ -57,7 +62,7 @@ function assertIsVersions(data: unknown): asserts data is Versions { const dynamicRequire = createRequire(import.meta.url); function load(): Versions { - const data = dynamicRequire('../data/versions.json'); + const data = dynamicRequire("../data/versions.json"); assertIsVersions(data); return data; } diff --git a/pkgs/create-neon/test/create-neon.ts b/pkgs/create-neon/test/create-neon.ts index b759993e2..fdeacf8a6 100644 --- a/pkgs/create-neon/test/create-neon.ts +++ b/pkgs/create-neon/test/create-neon.ts @@ -1,14 +1,16 @@ -import { assert } from 'chai'; -import { spawn } from 'child_process'; -import * as path from 'path'; -import { promises as fs } from 'fs'; -import * as TOML from 'toml'; -import expect from '../dev/expect.js'; -import { execa } from 'execa'; -import { fileURLToPath } from 'url'; +import { assert } from "chai"; +import { spawn } from "child_process"; +import * as path from "path"; +import { promises as fs } from "fs"; +import * as TOML from "toml"; +import expect from "../dev/expect.js"; +import { execa } from "execa"; +import { fileURLToPath } from "url"; const NODE: string = process.execPath; -const CREATE_NEON = fileURLToPath(new URL(path.join('..', 'src', 'bin', 'create-neon.js'), import.meta.url)); +const CREATE_NEON = fileURLToPath( + new URL(path.join("..", "src", "bin", "create-neon.js"), import.meta.url) +); describe("Command-line argument validation", () => { it("requires an argument", async () => { From 74fe46ab2595b3ff8177e8289851935b8fb6204a Mon Sep 17 00:00:00 2001 From: David Herman Date: Wed, 27 Mar 2024 19:03:18 -0700 Subject: [PATCH 15/50] bugfix: PackageSpec needs version (default is "0.1.0") and manifest template references packageSpec not package --- .../data/templates/manifest/base/default.json.hbs | 6 +++--- .../data/templates/manifest/base/library.json.hbs | 4 ++-- pkgs/create-neon/src/index.ts | 1 + pkgs/create-neon/src/package.ts | 1 + 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/create-neon/data/templates/manifest/base/default.json.hbs b/pkgs/create-neon/data/templates/manifest/base/default.json.hbs index 291c547d0..1da7e61da 100644 --- a/pkgs/create-neon/data/templates/manifest/base/default.json.hbs +++ b/pkgs/create-neon/data/templates/manifest/base/default.json.hbs @@ -1,11 +1,11 @@ { - "name": "{{package.name}}", - "version": "{{package.version}}", + "name": "{{packageSpec.name}}", + "version": "{{packageSpec.version}}", "main": "index.node", "scripts": {}, "devDependencies": { - "@neon-rs/cli": "{{versions.neonCLI}}"{{#eq package.library.lang compare="ts"}}, + "@neon-rs/cli": "{{versions.neonCLI}}"{{#eq packageSpec.library.lang compare="ts"}}, "@tsconfig/node{{versions.tsconfigNode.major}}": "^{{versions.tsconfigNode.semver}}", "@types/node": "^{{versions.typesNode}}", "typescript": "^{{versions.typescript}}"{{/eq}} diff --git a/pkgs/create-neon/data/templates/manifest/base/library.json.hbs b/pkgs/create-neon/data/templates/manifest/base/library.json.hbs index 701a2e71c..1a35fb4f1 100644 --- a/pkgs/create-neon/data/templates/manifest/base/library.json.hbs +++ b/pkgs/create-neon/data/templates/manifest/base/library.json.hbs @@ -1,7 +1,7 @@ { - "name": "{{package.name}}", - "version": "{{package.version}}", + "name": "{{packageSpec.name}}", + "version": "{{packageSpec.version}}", {{#eq packageSpec.library.module compare="esm"}} "exports": { ".": { diff --git a/pkgs/create-neon/src/index.ts b/pkgs/create-neon/src/index.ts index e246996be..fa28321cc 100644 --- a/pkgs/create-neon/src/index.ts +++ b/pkgs/create-neon/src/index.ts @@ -22,6 +22,7 @@ export type CreateNeonOptions = { export async function createNeon(name: string, options: CreateNeonOptions) { const packageSpec: PackageSpec = { name, + version: "0.1.0", library: options.library, yes: options.yes, }; diff --git a/pkgs/create-neon/src/package.ts b/pkgs/create-neon/src/package.ts index 726b7b983..1ff9fce68 100644 --- a/pkgs/create-neon/src/package.ts +++ b/pkgs/create-neon/src/package.ts @@ -39,6 +39,7 @@ export type LibrarySpec = { export type PackageSpec = { name: string; + version: string; library: LibrarySpec | null; cache?: Cache | undefined; ci?: CI | undefined; From 2a683749328ac29a048ac97b15edf075511c53aa Mon Sep 17 00:00:00 2001 From: David Herman Date: Wed, 27 Mar 2024 19:22:50 -0700 Subject: [PATCH 16/50] add a newline to the manifest --- pkgs/create-neon/src/package.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/create-neon/src/package.ts b/pkgs/create-neon/src/package.ts index 1ff9fce68..cc2fd2c5f 100644 --- a/pkgs/create-neon/src/package.ts +++ b/pkgs/create-neon/src/package.ts @@ -113,7 +113,7 @@ export default class Package { const sorted = sort(JSON.parse(await fs.readFile(filename, "utf8"))); // 4. Save the result to package.json. - await fs.writeFile(filename, JSON.stringify(sorted, undefined, 2)); + await fs.writeFile(filename, JSON.stringify(sorted, undefined, 2) + "\n"); return new Package(sorted); } From e54a1de881e526405ea69a6cf21baa14007a6f8e Mon Sep 17 00:00:00 2001 From: David Herman Date: Wed, 27 Mar 2024 19:28:04 -0700 Subject: [PATCH 17/50] diagnostics --- pkgs/create-neon/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/create-neon/package.json b/pkgs/create-neon/package.json index 8311bcea7..caa532c62 100644 --- a/pkgs/create-neon/package.json +++ b/pkgs/create-neon/package.json @@ -18,7 +18,7 @@ "dist/data/**/*" ], "scripts": { - "build": "tsc && cp -r data/templates dist/data && cp data/*.json dist/data/", + "build": "tsc && cp -r data/templates dist/data && cp data/*.json dist/data/ && ls -R dist/data", "prepublishOnly": "npm run build", "pretest": "npm run build", "test": "mocha", From 4b301e3f1965393bf81d720213a81aaa5a617171 Mon Sep 17 00:00:00 2001 From: David Herman Date: Wed, 27 Mar 2024 20:31:16 -0700 Subject: [PATCH 18/50] build fix --- pkgs/create-neon/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/create-neon/package.json b/pkgs/create-neon/package.json index caa532c62..16de6b33e 100644 --- a/pkgs/create-neon/package.json +++ b/pkgs/create-neon/package.json @@ -18,7 +18,7 @@ "dist/data/**/*" ], "scripts": { - "build": "tsc && cp -r data/templates dist/data && cp data/*.json dist/data/ && ls -R dist/data", + "build": "tsc && cp -r data dist/data/ && ls -R dist/data", "prepublishOnly": "npm run build", "pretest": "npm run build", "test": "mocha", From d995950c9e60a25c7d49d66aeba1973d03198105 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 7 Apr 2024 12:58:36 -0700 Subject: [PATCH 19/50] export * from './index.cts' --- pkgs/create-neon/data/templates/ts/index.mts.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/create-neon/data/templates/ts/index.mts.hbs b/pkgs/create-neon/data/templates/ts/index.mts.hbs index 8777f29df..147a58772 100644 --- a/pkgs/create-neon/data/templates/ts/index.mts.hbs +++ b/pkgs/create-neon/data/templates/ts/index.mts.hbs @@ -1 +1 @@ -export { hello, Greeting } from './index.cjs'; +export * from './index.cjs'; From b2e05359bf93a6d5060d91ed5417be03764fbb44 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 7 Apr 2024 12:58:54 -0700 Subject: [PATCH 20/50] better ways to extract node and rust versions --- pkgs/create-neon/data/templates/ci/github/setup.yml.hbs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkgs/create-neon/data/templates/ci/github/setup.yml.hbs b/pkgs/create-neon/data/templates/ci/github/setup.yml.hbs index 7e3dee085..ddc15631f 100644 --- a/pkgs/create-neon/data/templates/ci/github/setup.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/setup.yml.hbs @@ -67,12 +67,10 @@ runs: id: node shell: bash run: | - # Trim the leading 'v' (e.g. "v18.19.0" ==> "18.19.0") - echo version=$(node --version | cut -c 2-) >> $GITHUB_OUTPUT + echo version=$(node -e 'console.log(process.versions.node)') | tee -a $GITHUB_OUTPUT - name: Rust Version if: {{#$}} inputs['use-rust'] == 'true' {{/$}} id: rust shell: bash run: | - # Trim extraneous metadata (e.g. "rustc 1.70.0 (90c541806 2023-05-31)" ==> "1.70.0") - echo version=$(rustc --version | awk '{ print $2; }') >> $GITHUB_OUTPUT + echo version=$(cargo -Vv | fgrep release: | cut -d' ' -f2) | tee -a $GITHUB_OUTPUT From 86cfc2f551dceecb56cf513c7db0e35cc539e41b Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 7 Apr 2024 13:18:48 -0700 Subject: [PATCH 21/50] bugfix: steps.build.outputs.filename => steps.pack.outputs.filename --- pkgs/create-neon/data/templates/ci/github/build.yml.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/create-neon/data/templates/ci/github/build.yml.hbs b/pkgs/create-neon/data/templates/ci/github/build.yml.hbs index 2c752b696..2f195ca88 100644 --- a/pkgs/create-neon/data/templates/ci/github/build.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/build.yml.hbs @@ -109,7 +109,7 @@ jobs: if: {{#$}} inputs.github-release {{/$}} uses: softprops/action-gh-release@{{versions.actions.ghRelease}} with: - files: ./dist/{{#$}} steps.build.outputs.filename {{/$}} + files: ./dist/{{#$}} steps.pack.outputs.filename {{/$}} tag_name: {{#$}} inputs.tag {{/$}} main: @@ -136,5 +136,5 @@ jobs: if: {{#$}} inputs.github-release {{/$}} uses: softprops/action-gh-release@{{versions.actions.ghRelease}} with: - files: ./dist/{{#$}} steps.build.outputs.filename {{/$}} + files: ./dist/{{#$}} steps.pack.outputs.filename {{/$}} tag_name: {{#$}} inputs.tag {{/$}} From 4741f2a6b10fd8fed13513cad99460340e31dc44 Mon Sep 17 00:00:00 2001 From: Dave Herman Date: Sun, 7 Apr 2024 13:24:37 -0700 Subject: [PATCH 22/50] Update pkgs/create-neon/data/templates/ci/github/build.yml.hbs fix typo in build.yml description Co-authored-by: K.J. Valencik --- pkgs/create-neon/data/templates/ci/github/build.yml.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/create-neon/data/templates/ci/github/build.yml.hbs b/pkgs/create-neon/data/templates/ci/github/build.yml.hbs index 2f195ca88..ccd897301 100644 --- a/pkgs/create-neon/data/templates/ci/github/build.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/build.yml.hbs @@ -13,7 +13,7 @@ on: type: boolean default: false version: - description: 'Version update (ignored if update-version if false)' + description: 'Version update (ignored if update-version is false)' required: false type: string default: 'patch' From cda4804faeb891ce89d5a26c31d578007adee6c4 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 7 Apr 2024 13:49:09 -0700 Subject: [PATCH 23/50] bugfix: packageSpec.library not package.library --- pkgs/create-neon/data/templates/.gitignore.hbs | 6 +++--- pkgs/create-neon/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/create-neon/data/templates/.gitignore.hbs b/pkgs/create-neon/data/templates/.gitignore.hbs index 58c2081e6..17b9e6149 100644 --- a/pkgs/create-neon/data/templates/.gitignore.hbs +++ b/pkgs/create-neon/data/templates/.gitignore.hbs @@ -2,8 +2,8 @@ target index.node **/node_modules **/.DS_Store -npm-debug.log* -{{#eq package.library.lang compare="ts"}} +npm-debug.log*{{#eq packageSpec.library.lang compare="ts"}} lib -{{/eq}}cargo.log +{{/eq}} +cargo.log cross.log diff --git a/pkgs/create-neon/package.json b/pkgs/create-neon/package.json index 16de6b33e..b1e0c4cf5 100644 --- a/pkgs/create-neon/package.json +++ b/pkgs/create-neon/package.json @@ -18,7 +18,7 @@ "dist/data/**/*" ], "scripts": { - "build": "tsc && cp -r data dist/data/ && ls -R dist/data", + "build": "tsc && rm -rf dist/data && cp -r data dist/data/ && ls -R dist/data", "prepublishOnly": "npm run build", "pretest": "npm run build", "test": "mocha", From 86c7daa1f2d696f785aca1276f38d2a6af11b435 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 14 Apr 2024 12:15:31 -0700 Subject: [PATCH 24/50] node 20.x --- pkgs/create-neon/data/templates/ci/github/.env.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/create-neon/data/templates/ci/github/.env.hbs b/pkgs/create-neon/data/templates/ci/github/.env.hbs index 0d2d2eb1b..cbe24b0d8 100644 --- a/pkgs/create-neon/data/templates/ci/github/.env.hbs +++ b/pkgs/create-neon/data/templates/ci/github/.env.hbs @@ -1,4 +1,4 @@ -NODE_VERSION=18.x +NODE_VERSION=20.x NPM_REGISTRY=https://registry.npmjs.org RUST_VERSION=stable ACTIONS_USER=github-actions From e965176a550a8bbe69aa982b98a705d84dc49edf Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 14 Apr 2024 13:07:43 -0700 Subject: [PATCH 25/50] remove .npmignore since it's only for libraries, which already use `"files"` --- pkgs/create-neon/data/templates/.npmignore.hbs | 3 --- pkgs/create-neon/src/bin/create-neon.ts | 1 - 2 files changed, 4 deletions(-) delete mode 100644 pkgs/create-neon/data/templates/.npmignore.hbs diff --git a/pkgs/create-neon/data/templates/.npmignore.hbs b/pkgs/create-neon/data/templates/.npmignore.hbs deleted file mode 100644 index 351128a14..000000000 --- a/pkgs/create-neon/data/templates/.npmignore.hbs +++ /dev/null @@ -1,3 +0,0 @@ -{{#if packageSpec.library}} -platforms -{{/if}} diff --git a/pkgs/create-neon/src/bin/create-neon.ts b/pkgs/create-neon/src/bin/create-neon.ts index edc1a5d21..bac6db5cd 100644 --- a/pkgs/create-neon/src/bin/create-neon.ts +++ b/pkgs/create-neon/src/bin/create-neon.ts @@ -17,7 +17,6 @@ import { const TEMPLATES: Record = { ".gitignore.hbs": ".gitignore", - ".npmignore.hbs": ".npmignore", "Cargo.toml.hbs": "Cargo.toml", "README.md.hbs": "README.md", "lib.rs.hbs": path.join("src", "lib.rs"), From 24e8898fea377f90c604954eb4d34899d5e72c02 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 14 Apr 2024 13:16:48 -0700 Subject: [PATCH 26/50] complete the node v20 changes --- pkgs/create-neon/data/templates/ci/github/.env.hbs | 2 +- pkgs/create-neon/data/versions.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/create-neon/data/templates/ci/github/.env.hbs b/pkgs/create-neon/data/templates/ci/github/.env.hbs index cbe24b0d8..289c787bc 100644 --- a/pkgs/create-neon/data/templates/ci/github/.env.hbs +++ b/pkgs/create-neon/data/templates/ci/github/.env.hbs @@ -1,4 +1,4 @@ -NODE_VERSION=20.x +NODE_VERSION={{versions.node}}.x NPM_REGISTRY=https://registry.npmjs.org RUST_VERSION=stable ACTIONS_USER=github-actions diff --git a/pkgs/create-neon/data/versions.json b/pkgs/create-neon/data/versions.json index 24968012e..7c1bf5946 100644 --- a/pkgs/create-neon/data/versions.json +++ b/pkgs/create-neon/data/versions.json @@ -5,11 +5,11 @@ "typescript": "5.3.3", "typesNode": "20.11.16", "tsconfigNode": { - "major": "18", - "semver": "18.2.2", + "major": "20", + "semver": "20.1.4", "module": "16" }, - "node": "18", + "node": "20", "actions": { "checkout": "v3", "githubScript": "v7", From a36e17025ae4b59c43f07dae4fdbef29b89d5213 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 14 Apr 2024 14:12:25 -0700 Subject: [PATCH 27/50] generate the right README details for the more nested repo layout of libraries --- pkgs/create-neon/data/templates/README.md.hbs | 40 +++++++++++++------ pkgs/create-neon/src/package.ts | 2 +- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/pkgs/create-neon/data/templates/README.md.hbs b/pkgs/create-neon/data/templates/README.md.hbs index 31fd5555c..02be70575 100644 --- a/pkgs/create-neon/data/templates/README.md.hbs +++ b/pkgs/create-neon/data/templates/README.md.hbs @@ -57,6 +57,16 @@ Similar to `npm run build` but generates a debug build with `cargo`. Similar to `npm run build` but uses [cross-rs](https://github.com/cross-rs/cross) to cross-compile for another platform. Use the [`CARGO_BUILD_TARGET`](https://doc.rust-lang.org/cargo/reference/config.html#buildtarget) environment variable to select the build target. +{{#eq packageSpec.library.ci.type compare="github"}} +#### `npm run release` + +Initiate a full build and publication of a new patch release of this library via GitHub Actions. + +#### `npm run dryrun` + +Initiate a dry run of a patch release of this library via GitHub Actions. This performs a full build but does not publish the final result. + +{{/eq}} #### `npm test` Runs the unit tests by calling `cargo test`. You can learn more about [adding tests to your Rust code](https://doc.rust-lang.org/book/ch11-01-writing-tests.html) from the [Rust book](https://doc.rust-lang.org/book/). @@ -72,7 +82,7 @@ The directory structure of this project is: {{#if packageSpec.library}} ├── lib/ {{#eq packageSpec.library.lang compare="ts"}} -├── ts/ +├── src/ | ├── index.mts | └── index.cts {{/eq}} @@ -81,8 +91,10 @@ The directory structure of this project is: ├── index.node {{/if}} ├── package.json -├── src/ -| └── lib.rs +├── crates/ +| └── {{package.name}}/ +| └── src/ +| └── lib.rs └── target/ ``` @@ -90,23 +102,25 @@ The directory structure of this project is: |----------------|------------------------------------------------------------------------------------------------------------------------------------------| | `Cargo.toml` | The Cargo [manifest file](https://doc.rust-lang.org/cargo/reference/manifest.html), which informs the `cargo` command. | | `README.md` | This file. | -{{#if packageSpec}} +{{#if packageSpec.library}} {{#eq packageSpec.library.lang compare="ts"}} -| `lib` | The directory containing the generated output from [tsc](https://typescriptlang.org). | -| `ts` | The directory containing the TypeScript source files. | -| `ts/index.mts` | Entry point for when this library is loaded via [ESM `import`](https://nodejs.org/api/esm.html#modules-ecmascript-modules) syntax. | -| `ts/index.cts` | Entry point for when this library is loaded via [CJS `require`](https://nodejs.org/api/modules.html#requireid). | +| `lib/` | The directory containing the generated output from [tsc](https://typescriptlang.org). | +| `src/` | The directory containing the TypeScript source files. | +| `index.mts` | Entry point for when this library is loaded via [ESM `import`](https://nodejs.org/api/esm.html#modules-ecmascript-modules) syntax. | +| `index.cts` | Entry point for when this library is loaded via [CJS `require`](https://nodejs.org/api/modules.html#requireid). | +| `crates/` | The directory tree containing the Rust source code for the project. | +| `lib.rs` | Entry point for the Rust source code. | {{else}} -| `lib` | The directory containing The directory containing the JavaScript source files. | +| `lib/` | The directory containing The directory containing the JavaScript source files. | {{/eq}} -| `platforms` | The directory containing distributions of the binary addon backend for each platform supported by this library. | +| `platforms/` | The directory containing distributions of the binary addon backend for each platform supported by this library. | {{else}} +| `src/` | The directory tree containing the Rust source code for the project. | +| `lib.rs` | Entry point for the Rust source code. | | `index.node` | The main module, a [Node addon](https://nodejs.org/api/addons.html) generated by the build and pointed to by `"main"` in `package.json`. | {{/if}} | `package.json` | The npm [manifest file](https://docs.npmjs.com/cli/v7/configuring-npm/package-json), which informs the `npm` command. | -| `src` | The directory tree containing the Rust source code for the project. | -| `src/lib.rs` | The Rust library's main module. | -| `target` | Binary artifacts generated by the Rust build. | +| `target/` | Binary artifacts generated by the Rust build. | ## Learn More diff --git a/pkgs/create-neon/src/package.ts b/pkgs/create-neon/src/package.ts index cc2fd2c5f..871c66cef 100644 --- a/pkgs/create-neon/src/package.ts +++ b/pkgs/create-neon/src/package.ts @@ -33,7 +33,7 @@ export type LibrarySpec = { lang: Lang; module: ModuleType; cache?: Cache; - ci?: CI; + ci?: CI | undefined; platforms?: PlatformPreset | PlatformPreset[]; }; From 66148cf74eadb4afeb4e5af9ad7e99cf4e04c5a5 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 14 Apr 2024 14:15:29 -0700 Subject: [PATCH 28/50] fix the conditional logic for the directory layout in README --- pkgs/create-neon/data/templates/README.md.hbs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/create-neon/data/templates/README.md.hbs b/pkgs/create-neon/data/templates/README.md.hbs index 02be70575..f468e4caa 100644 --- a/pkgs/create-neon/data/templates/README.md.hbs +++ b/pkgs/create-neon/data/templates/README.md.hbs @@ -85,16 +85,18 @@ The directory structure of this project is: ├── src/ | ├── index.mts | └── index.cts +├── crates/ +| └── {{package.name}}/ +| └── src/ +| └── lib.rs {{/eq}} ├── platforms/ {{else}} +├── src/ +| └── lib.rs ├── index.node {{/if}} ├── package.json -├── crates/ -| └── {{package.name}}/ -| └── src/ -| └── lib.rs └── target/ ``` From d27655db4b5e1ffaa20a479595fc13b43556a32a Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 14 Apr 2024 14:42:50 -0700 Subject: [PATCH 29/50] create-neon now generates the nested directory structure for TS libraries --- pkgs/create-neon/data/templates/Workspace.toml.hbs | 3 +++ .../data/templates/manifest/base/library.json.hbs | 2 +- pkgs/create-neon/src/bin/create-neon.ts | 14 ++++++++++++-- pkgs/create-neon/src/index.ts | 1 - pkgs/create-neon/src/package.ts | 6 +++--- 5 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 pkgs/create-neon/data/templates/Workspace.toml.hbs diff --git a/pkgs/create-neon/data/templates/Workspace.toml.hbs b/pkgs/create-neon/data/templates/Workspace.toml.hbs new file mode 100644 index 000000000..64a80289c --- /dev/null +++ b/pkgs/create-neon/data/templates/Workspace.toml.hbs @@ -0,0 +1,3 @@ +[workspace] +members = ["crates/{{package.name}}"] +resolver = "2" diff --git a/pkgs/create-neon/data/templates/manifest/base/library.json.hbs b/pkgs/create-neon/data/templates/manifest/base/library.json.hbs index 1a35fb4f1..902289b51 100644 --- a/pkgs/create-neon/data/templates/manifest/base/library.json.hbs +++ b/pkgs/create-neon/data/templates/manifest/base/library.json.hbs @@ -30,7 +30,7 @@ {{/if}} {{/eq}} "platforms": {}, - "load": "./ts/load.cts" + "load": "./src/load.cts" }, "devDependencies": { "@neon-rs/cli": "^{{versions.neonCLI}}"{{#eq packageSpec.library.lang compare="ts"}}, diff --git a/pkgs/create-neon/src/bin/create-neon.ts b/pkgs/create-neon/src/bin/create-neon.ts index bac6db5cd..0c27bd59f 100644 --- a/pkgs/create-neon/src/bin/create-neon.ts +++ b/pkgs/create-neon/src/bin/create-neon.ts @@ -15,13 +15,23 @@ import { isPlatformPreset, } from "@neon-rs/manifest/platform"; -const TEMPLATES: Record = { +const JS_TEMPLATES: Record = { ".gitignore.hbs": ".gitignore", "Cargo.toml.hbs": "Cargo.toml", "README.md.hbs": "README.md", "lib.rs.hbs": path.join("src", "lib.rs"), }; +function tsTemplates(pkg: string): Record { + return { + ".gitignore.hbs": ".gitignore", + "Cargo.toml.hbs": path.join("crates", pkg, "Cargo.toml"), + "Workspace.toml.hbs": "Cargo.toml", + "README.md.hbs": "README.md", + "lib.rs.hbs": path.join("crates", pkg, "src", "lib.rs"), + }; +} + const OPTIONS = [ { name: "lib", type: Boolean, defaultValue: false }, { name: "bins", type: String, defaultValue: "none" }, @@ -48,7 +58,7 @@ try { const yes = !!opts.yes; createNeon(pkg, { - templates: TEMPLATES, + templates: opts.lib ? tsTemplates(pkg) : JS_TEMPLATES, library: opts.lib ? { lang: Lang.TS, diff --git a/pkgs/create-neon/src/index.ts b/pkgs/create-neon/src/index.ts index fa28321cc..853733715 100644 --- a/pkgs/create-neon/src/index.ts +++ b/pkgs/create-neon/src/index.ts @@ -53,7 +53,6 @@ export async function createNeon(name: string, options: CreateNeonOptions) { try { pkg = await Package.create(metadata, tmpPackagePath); metadata.package = pkg; - await fs.mkdir(path.join(tmpPackagePath, "src")); } catch (err: any) { await die( "Could not create `package.json`: " + err.message, diff --git a/pkgs/create-neon/src/package.ts b/pkgs/create-neon/src/package.ts index 871c66cef..55fef31fa 100644 --- a/pkgs/create-neon/src/package.ts +++ b/pkgs/create-neon/src/package.ts @@ -18,9 +18,9 @@ export const LANG_TEMPLATES: Record> = { [Lang.DTS]: {}, [Lang.TS]: { "tsconfig.json.hbs": "tsconfig.json", - "ts/index.cts.hbs": path.join("ts", "index.cts"), - "ts/index.mts.hbs": path.join("ts", "index.mts"), - "ts/load.cts.hbs": path.join("ts", "load.cts"), + "ts/index.cts.hbs": path.join("src", "index.cts"), + "ts/index.mts.hbs": path.join("src", "index.mts"), + "ts/load.cts.hbs": path.join("src", "load.cts"), }, }; From c8b804e88ee92b7c920c89041fe5f56bcfab7800 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 14 Apr 2024 16:27:16 -0700 Subject: [PATCH 30/50] command-line option documentation in the main README --- pkgs/create-neon/README.md | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/pkgs/create-neon/README.md b/pkgs/create-neon/README.md index 2384de5cb..79211316a 100644 --- a/pkgs/create-neon/README.md +++ b/pkgs/create-neon/README.md @@ -6,6 +6,42 @@ The `create-neon` tool bootstraps [Neon](https://neon-bindings.com) projects, wh You can conveniently use this tool with the [`npm init`](https://docs.npmjs.com/cli/v7/commands/npm-init) syntax: +### Creating a Simple Project + +To create a simple Neon project that consists purely of Rust code: + +```sh +$ npm init neon [ ...] my-project +``` + +#### Global Options + +```sh +-y|--yes Skip interactive `npm init` questionnaire. +``` + +### Creating a Portable Library + +To create a portable npm library with pre-built binaries: + +```sh +$ npm init neon [ ...] --lib [ ...] my-project +``` + +This will generate a project that can be used by pure JavaScript or TypeScript consumers without them even being aware of the use of Rust under the hood. It achieves this by publishing pre-built binaries for common Node platform architectures that are loaded just-in-time by a JS wrapper module. + +This command generates the necessary npm and CI/CD configuration boilerplate to require nearly zero manual installation on typical GitHub-hosted repos. The only manual step required is to configure GitHub Actions with the necessary npm access token to enable automated publishing. + +This command chooses the most common setup by default, but allows customization with fine-grained configuration options. These configuration options can also be modified later with the [Neon CLI](https://www.npmjs.com/package/@neon-rs/cli). + +#### Library Options + ```sh -$ npm init neon my-project +--ci none|github CI/CD provider to generate config for. + (Default: github) +--bins none|npm[:org] Cache provider to publish pre-built binaries. + (Default: npm, with org inferred from package) +--platform Binary platform to add support to this library for. + This option can be specified multiple times. + (Default: macos, linux, windows) ``` From 4bbafb2a6f1a9482019f1a9f43a9b46a320ac313 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 14 Apr 2024 16:37:46 -0700 Subject: [PATCH 31/50] tee all the GITHUB_OUTPUT for simple diagnostics --- pkgs/create-neon/data/templates/ci/github/build.yml.hbs | 6 +++--- pkgs/create-neon/data/templates/ci/github/comments.yml.hbs | 2 +- pkgs/create-neon/data/templates/ci/github/release.yml.hbs | 6 +++--- pkgs/create-neon/data/templates/ci/github/setup.yml.hbs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/create-neon/data/templates/ci/github/build.yml.hbs b/pkgs/create-neon/data/templates/ci/github/build.yml.hbs index ccd897301..0cec92770 100644 --- a/pkgs/create-neon/data/templates/ci/github/build.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/build.yml.hbs @@ -46,7 +46,7 @@ jobs: - name: Look Up Matrix Data id: matrixData shell: bash - run: echo "json=$(npx neon ci github | jq -rc)" >> "$GITHUB_OUTPUT" + run: echo "json=$(npx neon ci github | jq -rc)" | tee -a $GITHUB_OUTPUT - name: Compute Matrix id: matrix uses: actions/github-script@{{versions.actions.githubScript}} @@ -104,7 +104,7 @@ jobs: shell: bash run: | mkdir -p dist - echo filename=$(basename $(npm pack ./platforms/{{#$}} matrix.cfg.platform {{/$}} --pack-destination=./dist --json | jq -r '.[0].filename')) >> $GITHUB_OUTPUT + echo filename=$(basename $(npm pack ./platforms/{{#$}} matrix.cfg.platform {{/$}} --pack-destination=./dist --json | jq -r '.[0].filename')) | tee -a $GITHUB_OUTPUT - name: Release if: {{#$}} inputs.github-release {{/$}} uses: softprops/action-gh-release@{{versions.actions.ghRelease}} @@ -131,7 +131,7 @@ jobs: shell: bash run: | mkdir -p dist - echo "filename=$(npm pack --pack-destination=./dist)" >> $GITHUB_OUTPUT + echo "filename=$(npm pack --pack-destination=./dist)" | tee -a $GITHUB_OUTPUT - name: Release if: {{#$}} inputs.github-release {{/$}} uses: softprops/action-gh-release@{{versions.actions.ghRelease}} diff --git a/pkgs/create-neon/data/templates/ci/github/comments.yml.hbs b/pkgs/create-neon/data/templates/ci/github/comments.yml.hbs index 1605098a3..039ac5e63 100644 --- a/pkgs/create-neon/data/templates/ci/github/comments.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/comments.yml.hbs @@ -22,7 +22,7 @@ jobs: if: {{#$}} github.event.issue.pull_request {{/$}} id: pr-ref shell: bash - run: echo "branch=$(gh pr view $PR_NO --repo $REPO --json headRefName --jq '.headRefName')" >> "$GITHUB_OUTPUT" + run: echo "branch=$(gh pr view $PR_NO --repo $REPO --json headRefName --jq '.headRefName')" | tee -a $GITHUB_OUTPUT env: REPO: {{#$}} github.repository {{/$}} PR_NO: {{#$}} github.event.issue.number {{/$}} diff --git a/pkgs/create-neon/data/templates/ci/github/release.yml.hbs b/pkgs/create-neon/data/templates/ci/github/release.yml.hbs index 48fcdb1f1..7769ff023 100644 --- a/pkgs/create-neon/data/templates/ci/github/release.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/release.yml.hbs @@ -53,7 +53,7 @@ jobs: name: Validate Dry Run Event if: {{#$}} inputs.dryrun {{/$}} shell: bash - run: echo dryrun=true >> "$GITHUB_OUTPUT" + run: echo dryrun=true | tee -a $GITHUB_OUTPUT - id: publish name: Validate Publish Event if: {{#$}} !inputs.dryrun {{/$}} @@ -71,7 +71,7 @@ jobs: echo "::error::See https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions for info about how to store GitHub repo secrets." exit 1 fi - echo publish=true >> "$GITHUB_OUTPUT" + echo publish=true | tee -a $GITHUB_OUTPUT - name: Checkout Code uses: actions/checkout@{{versions.actions.checkout}} - name: Setup Neon Environment @@ -86,7 +86,7 @@ jobs: git config --global user.email $ACTIONS_EMAIL npm version -m 'v%s' '{{#$}} (inputs.version == 'custom' && inputs.custom) || inputs.version {{/$}}' git push --follow-tags - echo tag=$(git describe --abbrev=0) >> "$GITHUB_OUTPUT" + echo tag=$(git describe --abbrev=0) | tee -a $GITHUB_OUTPUT build: name: Build diff --git a/pkgs/create-neon/data/templates/ci/github/setup.yml.hbs b/pkgs/create-neon/data/templates/ci/github/setup.yml.hbs index ddc15631f..3f8ccced0 100644 --- a/pkgs/create-neon/data/templates/ci/github/setup.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/setup.yml.hbs @@ -49,7 +49,7 @@ runs: if: {{#$}} inputs['use-rust'] == 'true' {{/$}} id: target shell: bash - run: echo target=$(npx neon list-platforms | jq -r '.["{{#$}} inputs.platform {{/$}}"]') >> $GITHUB_OUTPUT + run: echo target=$(npx neon list-platforms | jq -r '.["{{#$}} inputs.platform {{/$}}"]') | tee -a $GITHUB_OUTPUT working-directory: {{#$}} inputs.workspace {{/$}} - name: Install Rust if: {{#$}} inputs['use-rust'] == 'true' {{/$}} From 4ec45b3500b6b8ce23c004c64b64c454652669f3 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 14 Apr 2024 16:40:07 -0700 Subject: [PATCH 32/50] no default since it's required --- pkgs/create-neon/data/templates/ci/github/release.yml.hbs | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/create-neon/data/templates/ci/github/release.yml.hbs b/pkgs/create-neon/data/templates/ci/github/release.yml.hbs index 7769ff023..a78604c1b 100644 --- a/pkgs/create-neon/data/templates/ci/github/release.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/release.yml.hbs @@ -15,7 +15,6 @@ on: version: description: 'Version component to update (or "custom" to provide exact version)' required: true - default: 'patch' type: choice options: - patch From eb6ac1541d40ec9c74eaef2c2e390c3958a2ad6f Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 14 Apr 2024 21:17:24 -0700 Subject: [PATCH 33/50] a few more GHA details: - no need for `fetch-depth: 0` when checking out git - fix GH_TOKEN for `gh` cli to use the built-in ${{ github.token }} - add `--silent` to `npm pack` to work around https://github.com/npm/cli/issues/7354 --- pkgs/create-neon/data/templates/ci/github/build.yml.hbs | 6 ++---- pkgs/create-neon/data/templates/ci/github/comments.yml.hbs | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pkgs/create-neon/data/templates/ci/github/build.yml.hbs b/pkgs/create-neon/data/templates/ci/github/build.yml.hbs index 0cec92770..187566558 100644 --- a/pkgs/create-neon/data/templates/ci/github/build.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/build.yml.hbs @@ -78,7 +78,6 @@ jobs: uses: actions/checkout@{{versions.actions.checkout}} with: ref: {{#$}} inputs.ref {{/$}} - fetch-depth: 0 - name: Setup Neon Environment id: neon uses: ./.github/actions/setup @@ -104,7 +103,7 @@ jobs: shell: bash run: | mkdir -p dist - echo filename=$(basename $(npm pack ./platforms/{{#$}} matrix.cfg.platform {{/$}} --pack-destination=./dist --json | jq -r '.[0].filename')) | tee -a $GITHUB_OUTPUT + echo filename=$(basename $(npm pack ./platforms/{{#$}} matrix.cfg.platform {{/$}} --silent --pack-destination=./dist --json | jq -r '.[0].filename')) | tee -a $GITHUB_OUTPUT - name: Release if: {{#$}} inputs.github-release {{/$}} uses: softprops/action-gh-release@{{versions.actions.ghRelease}} @@ -121,7 +120,6 @@ jobs: uses: actions/checkout@{{versions.actions.checkout}} with: ref: {{#$}} inputs.ref {{/$}} - fetch-depth: 0 - name: Setup Neon Environment uses: ./.github/actions/setup with: @@ -131,7 +129,7 @@ jobs: shell: bash run: | mkdir -p dist - echo "filename=$(npm pack --pack-destination=./dist)" | tee -a $GITHUB_OUTPUT + echo "filename=$(npm pack --silent --pack-destination=./dist)" | tee -a $GITHUB_OUTPUT - name: Release if: {{#$}} inputs.github-release {{/$}} uses: softprops/action-gh-release@{{versions.actions.ghRelease}} diff --git a/pkgs/create-neon/data/templates/ci/github/comments.yml.hbs b/pkgs/create-neon/data/templates/ci/github/comments.yml.hbs index 039ac5e63..18fbb0ff4 100644 --- a/pkgs/create-neon/data/templates/ci/github/comments.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/comments.yml.hbs @@ -26,7 +26,7 @@ jobs: env: REPO: {{#$}} github.repository {{/$}} PR_NO: {{#$}} github.event.issue.number {{/$}} - GITHUB_TOKEN: {{#$}} secrets.GITHUB_TOKEN {{/$}} + GH_TOKEN: {{#$}} github.token {{/$}} build-all: name: Build From d3aa32cbbaf5da9b8cb08b64cb42a065416f6cf9 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 14 Apr 2024 23:37:54 -0700 Subject: [PATCH 34/50] replace the magic comments with a magic label --- .../data/templates/ci/github/comments.yml.hbs | 40 ------------------- .../data/templates/ci/github/test.yml.hbs | 30 ++++++++++++++ 2 files changed, 30 insertions(+), 40 deletions(-) delete mode 100644 pkgs/create-neon/data/templates/ci/github/comments.yml.hbs diff --git a/pkgs/create-neon/data/templates/ci/github/comments.yml.hbs b/pkgs/create-neon/data/templates/ci/github/comments.yml.hbs deleted file mode 100644 index 18fbb0ff4..000000000 --- a/pkgs/create-neon/data/templates/ci/github/comments.yml.hbs +++ /dev/null @@ -1,40 +0,0 @@ -name: Comments - -run-name: | - {{#$}} (github.event.issue.pull_request - && contains(github.event.comment.body, '/build-all') - && format('Full build (PR #{0})', github.event.issue.number)) - || 'Issue comment (no action)' {{/$}} - -on: - issue_comment: - types: [created] - -jobs: - setup: - name: Setup - runs-on: ubuntu-latest - if: {{#$}} github.event.issue.pull_request && contains(github.event.comment.body, '/build-all') {{/$}} - outputs: - branch: {{#$}} steps.pr-ref.outputs.branch || github.event.repository.default_branch {{/$}} - steps: - - name: PR Branch - if: {{#$}} github.event.issue.pull_request {{/$}} - id: pr-ref - shell: bash - run: echo "branch=$(gh pr view $PR_NO --repo $REPO --json headRefName --jq '.headRefName')" | tee -a $GITHUB_OUTPUT - env: - REPO: {{#$}} github.repository {{/$}} - PR_NO: {{#$}} github.event.issue.number {{/$}} - GH_TOKEN: {{#$}} github.token {{/$}} - - build-all: - name: Build - needs: [setup] - permissions: - contents: write - uses: ./.github/workflows/build.yml - with: - branch: {{#$}} needs.setup.outputs.branch {{/$}} - update-version: true - github-release: false diff --git a/pkgs/create-neon/data/templates/ci/github/test.yml.hbs b/pkgs/create-neon/data/templates/ci/github/test.yml.hbs index 66090ac14..8ce887209 100644 --- a/pkgs/create-neon/data/templates/ci/github/test.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/test.yml.hbs @@ -19,6 +19,36 @@ on: - main jobs: + pr: + name: Pull Request Details + runs-on: ubuntu-latest + if: {{#$}} github.event_name == 'pull_request' {{/$}} + outputs: + branch: {{#$}} steps.pr-ref.outputs.branch || github.event.repository.default_branch {{/$}} + steps: + - name: PR Branch + id: pr-ref + shell: bash + run: echo "branch=$(gh pr view $PR_NO --repo $REPO --json headRefName --jq '.headRefName')" | tee -a "$GITHUB_OUTPUT" + env: + REPO: {{#$}} github.repository {{/$}} + PR_NO: {{#$}} github.event.number {{/$}} + GH_TOKEN: {{#$}} github.token {{/$}} + + # Labeling a PR with a `ci:full-matrix` label to a PR also runs a full + # matrix build on every run of this workflow for that PR. + full-matrix: + name: Build + if: {{#$}} github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci:full-matrix') {{/$}} + needs: [pr] + permissions: + contents: write + uses: ./.github/workflows/build.yml + with: + ref: {{#$}} needs.pr.outputs.branch {{/$}} + update-version: true + github-release: false + unit-tests: name: Unit Tests runs-on: ubuntu-latest From 8de9b1432e79295a210287858cea7c2cf8a68895 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 14 Apr 2024 23:38:35 -0700 Subject: [PATCH 35/50] remove comments.yml.hbs from templates --- pkgs/create-neon/src/ci/github.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/create-neon/src/ci/github.ts b/pkgs/create-neon/src/ci/github.ts index 17fc687c5..56f39cd04 100644 --- a/pkgs/create-neon/src/ci/github.ts +++ b/pkgs/create-neon/src/ci/github.ts @@ -6,7 +6,6 @@ const TEMPLATES: Record = { "setup.yml.hbs": path.join(".github", "actions", "setup", "action.yml"), ".env.hbs": path.join(".github", ".env"), "build.yml.hbs": path.join(".github", "workflows", "build.yml"), - "comments.yml.hbs": path.join(".github", "workflows", "comments.yml"), "release.yml.hbs": path.join(".github", "workflows", "release.yml"), "test.yml.hbs": path.join(".github", "workflows", "test.yml"), }; From 11506687cbe83cd03fd1e2f7a795e7cca555b931 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 14 Apr 2024 23:40:25 -0700 Subject: [PATCH 36/50] comment copy-edits --- pkgs/create-neon/data/templates/ci/github/test.yml.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/create-neon/data/templates/ci/github/test.yml.hbs b/pkgs/create-neon/data/templates/ci/github/test.yml.hbs index 8ce887209..4dbf475df 100644 --- a/pkgs/create-neon/data/templates/ci/github/test.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/test.yml.hbs @@ -35,8 +35,8 @@ jobs: PR_NO: {{#$}} github.event.number {{/$}} GH_TOKEN: {{#$}} github.token {{/$}} - # Labeling a PR with a `ci:full-matrix` label to a PR also runs a full - # matrix build on every run of this workflow for that PR. + # Labeling a PR with a `ci:full-matrix` label does a full matrix build on + # every run of this workflow for that PR, in addition to the other tests. full-matrix: name: Build if: {{#$}} github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci:full-matrix') {{/$}} From 36a002f53349f6591dfb66b357415b48ccbdb5ad Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 14 Apr 2024 23:54:06 -0700 Subject: [PATCH 37/50] eliminate two more magic feathers --- pkgs/create-neon/data/templates/ci/github/release.yml.hbs | 1 - pkgs/create-neon/data/templates/ci/github/test.yml.hbs | 2 -- 2 files changed, 3 deletions(-) diff --git a/pkgs/create-neon/data/templates/ci/github/release.yml.hbs b/pkgs/create-neon/data/templates/ci/github/release.yml.hbs index a78604c1b..5391d5e66 100644 --- a/pkgs/create-neon/data/templates/ci/github/release.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/release.yml.hbs @@ -111,7 +111,6 @@ jobs: - name: Checkout Code uses: actions/checkout@{{versions.actions.checkout}} with: - fetch-depth: 0 ref: {{#$}} needs.setup.outputs.ref {{/$}} - name: Setup Neon Environment uses: ./.github/actions/setup diff --git a/pkgs/create-neon/data/templates/ci/github/test.yml.hbs b/pkgs/create-neon/data/templates/ci/github/test.yml.hbs index 4dbf475df..8abb7043b 100644 --- a/pkgs/create-neon/data/templates/ci/github/test.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/test.yml.hbs @@ -55,8 +55,6 @@ jobs: steps: - name: Checkout Code uses: actions/checkout@{{versions.actions.checkout}} - with: - fetch-depth: 0 - name: Setup Neon Environment id: neon uses: ./.github/actions/setup From e6eef731c0b083e6c045aa2457e646b683ff886a Mon Sep 17 00:00:00 2001 From: David Herman Date: Mon, 15 Apr 2024 09:54:07 -0700 Subject: [PATCH 38/50] slight improvements to the generated index.cts boilerplate: - use a wrapper type instead of a string subtype as the example wrapper logic, for clarity - use `declare module` for a better suggested style of interacting with the addon (to avoid the any type) --- pkgs/create-neon/data/templates/ts/index.cts.hbs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pkgs/create-neon/data/templates/ts/index.cts.hbs b/pkgs/create-neon/data/templates/ts/index.cts.hbs index 92d36d576..5eebd6c84 100644 --- a/pkgs/create-neon/data/templates/ts/index.cts.hbs +++ b/pkgs/create-neon/data/templates/ts/index.cts.hbs @@ -1,7 +1,14 @@ -const addon = require('./load.cjs'); +import * as addon from './load.cjs'; -export type Greeting = "hello node"; +declare module "./load.cjs" { + function hello(): string; +} + +export type Greeting = { + message: string +}; -export function hello(): Greeting { - return addon.hello(); +export function greeting(): Greeting { + const message = addon.hello(); + return { message }; } From 970aff83fa1ef7e9fd92a660fea5d232c45785ae Mon Sep 17 00:00:00 2001 From: David Herman Date: Mon, 15 Apr 2024 13:26:39 -0700 Subject: [PATCH 39/50] different hello world for libraries vs simple projects --- pkgs/create-neon/data/templates/README.md.hbs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/create-neon/data/templates/README.md.hbs b/pkgs/create-neon/data/templates/README.md.hbs index f468e4caa..d4b6b739b 100644 --- a/pkgs/create-neon/data/templates/README.md.hbs +++ b/pkgs/create-neon/data/templates/README.md.hbs @@ -22,12 +22,23 @@ This command uses the [@neon-rs/cli](https://www.npmjs.com/package/@neon-rs/cli) After building {{package.name}}, you can explore its exports at the Node console: +{{#if packageSpec.library}} ```sh +$ npm i +$ npm run build +$ node +> require('.').greeting() +{ message: 'hello node' } +``` +{{else}} +```sh +$ npm i $ npm run build $ node > require('.').hello() -"hello node" +'hello node' ``` +{{/if}} ## Available Scripts From 8830100d8f3ab5f75ec600095fb591684f5e1c4e Mon Sep 17 00:00:00 2001 From: David Herman Date: Mon, 15 Apr 2024 17:57:18 -0700 Subject: [PATCH 40/50] add some explanatory comments to the generated code --- pkgs/create-neon/data/templates/ts/index.cts.hbs | 5 +++++ pkgs/create-neon/data/templates/ts/index.mts.hbs | 2 ++ pkgs/create-neon/data/templates/ts/load.cts.hbs | 7 +++++++ 3 files changed, 14 insertions(+) diff --git a/pkgs/create-neon/data/templates/ts/index.cts.hbs b/pkgs/create-neon/data/templates/ts/index.cts.hbs index 5eebd6c84..001e42082 100644 --- a/pkgs/create-neon/data/templates/ts/index.cts.hbs +++ b/pkgs/create-neon/data/templates/ts/index.cts.hbs @@ -1,5 +1,10 @@ +// This module is the CJS entry point for the library. + +// The Rust addon. import * as addon from './load.cjs'; +// Use this declaration to assign types to the addon's exports, +// which otherwise by default are `any`. declare module "./load.cjs" { function hello(): string; } diff --git a/pkgs/create-neon/data/templates/ts/index.mts.hbs b/pkgs/create-neon/data/templates/ts/index.mts.hbs index 147a58772..5e1ab260f 100644 --- a/pkgs/create-neon/data/templates/ts/index.mts.hbs +++ b/pkgs/create-neon/data/templates/ts/index.mts.hbs @@ -1 +1,3 @@ +// This module is the ESM entry point for the library. + export * from './index.cjs'; diff --git a/pkgs/create-neon/data/templates/ts/load.cts.hbs b/pkgs/create-neon/data/templates/ts/load.cts.hbs index 3b579437f..5e38bc764 100644 --- a/pkgs/create-neon/data/templates/ts/load.cts.hbs +++ b/pkgs/create-neon/data/templates/ts/load.cts.hbs @@ -1,3 +1,10 @@ +// This module loads the platform-specific build of the addon on +// the current system. The supported platforms are registered in +// the `platforms` object below, whose entries can be managed by +// by the Neon CLI: +// +// https://www.npmjs.com/package/@neon-rs/cli + module.exports = require('@neon-rs/load').proxy({ platforms: {}, debug: () => require('../index.node') From a7168c0809933eaa4c4ad591f5c487f937700f05 Mon Sep 17 00:00:00 2001 From: David Herman Date: Mon, 15 Apr 2024 18:10:07 -0700 Subject: [PATCH 41/50] oops, copy-pasta bug --- pkgs/create-neon/data/templates/ci/github/build.yml.hbs | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/create-neon/data/templates/ci/github/build.yml.hbs b/pkgs/create-neon/data/templates/ci/github/build.yml.hbs index 187566558..b818d112b 100644 --- a/pkgs/create-neon/data/templates/ci/github/build.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/build.yml.hbs @@ -84,7 +84,6 @@ jobs: with: use-cross: {{#$}} matrix.cfg.script == 'cross' {{/$}} platform: {{#$}} matrix.cfg.platform {{/$}} - workspace: ./pkgs/cargo-messages - name: Update Version if: {{#$}} inputs.update-version {{/$}} shell: bash From e2b37921ccce7794d9546278909281aae3ebed9c Mon Sep 17 00:00:00 2001 From: David Herman Date: Mon, 15 Apr 2024 18:46:51 -0700 Subject: [PATCH 42/50] missed one {{#$}} --- pkgs/create-neon/data/templates/ci/github/build.yml.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/create-neon/data/templates/ci/github/build.yml.hbs b/pkgs/create-neon/data/templates/ci/github/build.yml.hbs index b818d112b..a3338b5ef 100644 --- a/pkgs/create-neon/data/templates/ci/github/build.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/build.yml.hbs @@ -96,7 +96,7 @@ jobs: env: CARGO_BUILD_TARGET: {{#$}} steps.neon.outputs.target {{/$}} NEON_BUILD_PLATFORM: {{#$}} matrix.cfg.platform {{/$}} - run: npm run ${{ matrix.cfg.script }} + run: npm run {{#$}} matrix.cfg.script {{/$}} - name: Pack id: pack shell: bash From 8c599541ee75ccfd433458e7136ed103523babac Mon Sep 17 00:00:00 2001 From: David Herman Date: Mon, 15 Apr 2024 22:51:27 -0700 Subject: [PATCH 43/50] id: tag --- pkgs/create-neon/data/templates/ci/github/release.yml.hbs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/create-neon/data/templates/ci/github/release.yml.hbs b/pkgs/create-neon/data/templates/ci/github/release.yml.hbs index 5391d5e66..4429807fc 100644 --- a/pkgs/create-neon/data/templates/ci/github/release.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/release.yml.hbs @@ -77,8 +77,9 @@ jobs: uses: ./.github/actions/setup with: use-rust: false - - name: Tag Release (manual only) + - name: Tag Release if: {{#$}} !inputs.dryrun {{/$}} + id: tag shell: bash run: | git config --global user.name $ACTIONS_USER From 8d68793d1eba07f027dc3560274987100f4d6ff4 Mon Sep 17 00:00:00 2001 From: David Herman Date: Fri, 19 Apr 2024 16:28:00 -0700 Subject: [PATCH 44/50] bugfixes: - cfg matrix should have .script: string not .cross: boolean - prepack should include `tsc &&` for TS projects --- pkgs/create-neon/data/templates/ci/github/build.yml.hbs | 6 +++--- pkgs/create-neon/data/templates/manifest/scripts.json.hbs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/create-neon/data/templates/ci/github/build.yml.hbs b/pkgs/create-neon/data/templates/ci/github/build.yml.hbs index a3338b5ef..e9850e9e3 100644 --- a/pkgs/create-neon/data/templates/ci/github/build.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/build.yml.hbs @@ -54,13 +54,13 @@ jobs: script: | const platforms = {{#$}} steps.matrixData.outputs.json {{/$}}; const macOS = platforms.macOS.map(platform => { - return { os: "macos-latest", platform, cross: false }; + return { os: "macos-latest", platform, script: "build" }; }); const windows = platforms.Windows.map(platform => { - return { os: "windows-latest", platform, cross: false }; + return { os: "windows-latest", platform, script: "build" }; }); const linux = platforms.Linux.map(platform => { - return { os: "ubuntu-latest", platform, cross: true }; + return { os: "ubuntu-latest", platform, script: "cross" }; }); return [...macOS, ...windows, ...linux]; diff --git a/pkgs/create-neon/data/templates/manifest/scripts.json.hbs b/pkgs/create-neon/data/templates/manifest/scripts.json.hbs index 8a6663db5..b17d7140e 100644 --- a/pkgs/create-neon/data/templates/manifest/scripts.json.hbs +++ b/pkgs/create-neon/data/templates/manifest/scripts.json.hbs @@ -7,6 +7,6 @@ "debug": "npm run cargo-build --", "build": "npm run cargo-build -- --release", "cross": "npm run cross-build -- --release"{{#if packageSpec.library}}, - "prepack": "neon update-platforms", + "prepack": "{{#eq packageSpec.library.lang compare="ts"}}tsc && {{/eq}}neon update-platforms", "version": "neon bump --binaries platforms && git add ."{{/if}} } From a24ab89c8153b3eaaada6e8b891b743849a26cbb Mon Sep 17 00:00:00 2001 From: David Herman Date: Fri, 19 Apr 2024 16:36:35 -0700 Subject: [PATCH 45/50] more detailed instructions for setting up npm tokens --- pkgs/create-neon/data/templates/ci/github/release.yml.hbs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/create-neon/data/templates/ci/github/release.yml.hbs b/pkgs/create-neon/data/templates/ci/github/release.yml.hbs index 4429807fc..603cc60ab 100644 --- a/pkgs/create-neon/data/templates/ci/github/release.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/release.yml.hbs @@ -67,6 +67,8 @@ jobs: echo "::error:: • with Read-Write access to this project's npm packages;" echo "::error:: • stored as a repo secret named NPM_TOKEN." echo "::error::See https://docs.npmjs.com/about-access-tokens for info about creating npm tokens." + echo "::error:: 💡 The simplest method is to create a Classic npm token of type Automation." + echo "::error:: 💡 For greater security, consider using a Granual access token." echo "::error::See https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions for info about how to store GitHub repo secrets." exit 1 fi From b2c69e0eef021d11721e7980bcc32a3b27870ead Mon Sep 17 00:00:00 2001 From: David Herman Date: Sat, 20 Apr 2024 07:34:28 -0600 Subject: [PATCH 46/50] bump @neon-rs/manifest so saving manifests includes a final newline --- package-lock.json | 8 ++++---- pkgs/create-neon/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index dbbd57a69..fac55a862 100644 --- a/package-lock.json +++ b/package-lock.json @@ -833,9 +833,9 @@ } }, "node_modules/@neon-rs/manifest": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/@neon-rs/manifest/-/manifest-0.0.4.tgz", - "integrity": "sha512-gyul4RBV5qc/tgNisCs0+4GAholk2vcIB0vgegwKyIW3qNoCkrRKo46N9eSZfUf9RSVS7YBS8CVXLC0CasVJAQ==", + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@neon-rs/manifest/-/manifest-0.0.6.tgz", + "integrity": "sha512-Hg4gbbyAl7h96WNTu/IaLIBI5w82yr2Mjs/fvYohTYDE4wS+g+Fv7B2ahfGzLHaxLJpljTMgfMwQJuan0w7o5Q==", "dependencies": { "jscodeshift": "^0.15.1" } @@ -6069,7 +6069,7 @@ "version": "0.3.0", "license": "MIT", "dependencies": { - "@neon-rs/manifest": "^0.0.4", + "@neon-rs/manifest": "^0.0.6", "chalk": "^5.3.0", "command-line-args": "^5.2.1", "command-line-usage": "^7.0.1", diff --git a/pkgs/create-neon/package.json b/pkgs/create-neon/package.json index b1e0c4cf5..faa418e26 100644 --- a/pkgs/create-neon/package.json +++ b/pkgs/create-neon/package.json @@ -47,7 +47,7 @@ "typescript": "^5.3.2" }, "dependencies": { - "@neon-rs/manifest": "^0.0.4", + "@neon-rs/manifest": "^0.0.6", "chalk": "^5.3.0", "command-line-args": "^5.2.1", "command-line-usage": "^7.0.1", From 4091edf10f13f234b7f097db49163c5a3a78dba4 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 5 May 2024 22:00:03 -0700 Subject: [PATCH 47/50] use the new more ergonomic CLI syntax --- pkgs/create-neon/data/templates/ci/github/build.yml.hbs | 2 +- pkgs/create-neon/data/templates/manifest/scripts.json.hbs | 2 +- pkgs/create-neon/data/versions.json | 4 ++-- pkgs/create-neon/test/create-neon.ts | 8 ++++++++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pkgs/create-neon/data/templates/ci/github/build.yml.hbs b/pkgs/create-neon/data/templates/ci/github/build.yml.hbs index e9850e9e3..50916311b 100644 --- a/pkgs/create-neon/data/templates/ci/github/build.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/build.yml.hbs @@ -46,7 +46,7 @@ jobs: - name: Look Up Matrix Data id: matrixData shell: bash - run: echo "json=$(npx neon ci github | jq -rc)" | tee -a $GITHUB_OUTPUT + run: echo "json=$(npx neon show ci github | jq -rc)" | tee -a $GITHUB_OUTPUT - name: Compute Matrix id: matrix uses: actions/github-script@{{versions.actions.githubScript}} diff --git a/pkgs/create-neon/data/templates/manifest/scripts.json.hbs b/pkgs/create-neon/data/templates/manifest/scripts.json.hbs index b17d7140e..9dc21fb6e 100644 --- a/pkgs/create-neon/data/templates/manifest/scripts.json.hbs +++ b/pkgs/create-neon/data/templates/manifest/scripts.json.hbs @@ -7,6 +7,6 @@ "debug": "npm run cargo-build --", "build": "npm run cargo-build -- --release", "cross": "npm run cross-build -- --release"{{#if packageSpec.library}}, - "prepack": "{{#eq packageSpec.library.lang compare="ts"}}tsc && {{/eq}}neon update-platforms", + "prepack": "{{#eq packageSpec.library.lang compare="ts"}}tsc && {{/eq}}neon update", "version": "neon bump --binaries platforms && git add ."{{/if}} } diff --git a/pkgs/create-neon/data/versions.json b/pkgs/create-neon/data/versions.json index 7c1bf5946..222aa3d4a 100644 --- a/pkgs/create-neon/data/versions.json +++ b/pkgs/create-neon/data/versions.json @@ -1,7 +1,7 @@ { "neon": "1", - "neonCLI": "0.1.64", - "neonLoad": "0.1.64", + "neonCLI": "0.1.68", + "neonLoad": "0.1.68", "typescript": "5.3.3", "typesNode": "20.11.16", "tsconfigNode": { diff --git a/pkgs/create-neon/test/create-neon.ts b/pkgs/create-neon/test/create-neon.ts index fdeacf8a6..687e01611 100644 --- a/pkgs/create-neon/test/create-neon.ts +++ b/pkgs/create-neon/test/create-neon.ts @@ -39,6 +39,14 @@ describe("Project creation", () => { await fs.rm(PROJECT, { recursive: true, maxRetries: 3 }); }); + it("succeeds with --yes", async () => { + try { + await expect(spawn(NODE, [CREATE_NEON, PROJECT, "--yes"]), {}); + } catch (error: any) { + assert.fail("create-neon unexpectedly failed: " + error.message); + } + }); + it("succeeds with all default answers", async () => { try { await expect(spawn(NODE, [CREATE_NEON, PROJECT]), { From 895361e21770dc27aa8bee1601e7349d66106156 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 5 May 2024 23:02:59 -0700 Subject: [PATCH 48/50] harden the use of third-party GH actions by using explicit SHAs for any unverified providers --- .../data/templates/ci/github/build.yml.hbs | 12 +++---- .../data/templates/ci/github/release.yml.hbs | 6 ++-- .../data/templates/ci/github/setup.yml.hbs | 8 ++--- .../data/templates/ci/github/test.yml.hbs | 2 +- pkgs/create-neon/data/versions.json | 33 +++++++++++++------ 5 files changed, 37 insertions(+), 24 deletions(-) diff --git a/pkgs/create-neon/data/templates/ci/github/build.yml.hbs b/pkgs/create-neon/data/templates/ci/github/build.yml.hbs index 50916311b..b4f686a92 100644 --- a/pkgs/create-neon/data/templates/ci/github/build.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/build.yml.hbs @@ -36,7 +36,7 @@ jobs: matrix: {{#$}} steps.matrix.outputs.result {{/$}} steps: - name: Checkout Code - uses: actions/checkout@{{versions.actions.checkout}} + uses: actions/checkout@{{versions.actions.verified.checkout}} with: ref: {{#$}} inputs.ref {{/$}} - name: Setup Neon Environment @@ -49,7 +49,7 @@ jobs: run: echo "json=$(npx neon show ci github | jq -rc)" | tee -a $GITHUB_OUTPUT - name: Compute Matrix id: matrix - uses: actions/github-script@{{versions.actions.githubScript}} + uses: actions/github-script@{{versions.actions.verified.githubScript}} with: script: | const platforms = {{#$}} steps.matrixData.outputs.json {{/$}}; @@ -75,7 +75,7 @@ jobs: contents: write steps: - name: Checkout Code - uses: actions/checkout@{{versions.actions.checkout}} + uses: actions/checkout@{{versions.actions.verified.checkout}} with: ref: {{#$}} inputs.ref {{/$}} - name: Setup Neon Environment @@ -105,7 +105,7 @@ jobs: echo filename=$(basename $(npm pack ./platforms/{{#$}} matrix.cfg.platform {{/$}} --silent --pack-destination=./dist --json | jq -r '.[0].filename')) | tee -a $GITHUB_OUTPUT - name: Release if: {{#$}} inputs.github-release {{/$}} - uses: softprops/action-gh-release@{{versions.actions.ghRelease}} + uses: softprops/action-gh-release@{{versions.actions.unverified.ghRelease.sha}} # {{versions.actions.unverified.ghRelease.tag}} with: files: ./dist/{{#$}} steps.pack.outputs.filename {{/$}} tag_name: {{#$}} inputs.tag {{/$}} @@ -116,7 +116,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Code - uses: actions/checkout@{{versions.actions.checkout}} + uses: actions/checkout@{{versions.actions.verified.checkout}} with: ref: {{#$}} inputs.ref {{/$}} - name: Setup Neon Environment @@ -131,7 +131,7 @@ jobs: echo "filename=$(npm pack --silent --pack-destination=./dist)" | tee -a $GITHUB_OUTPUT - name: Release if: {{#$}} inputs.github-release {{/$}} - uses: softprops/action-gh-release@{{versions.actions.ghRelease}} + uses: softprops/action-gh-release@{{versions.actions.unverified.ghRelease.sha}} # {{versions.actions.unverified.ghRelease.tag}} with: files: ./dist/{{#$}} steps.pack.outputs.filename {{/$}} tag_name: {{#$}} inputs.tag {{/$}} diff --git a/pkgs/create-neon/data/templates/ci/github/release.yml.hbs b/pkgs/create-neon/data/templates/ci/github/release.yml.hbs index 603cc60ab..6d6c7c32f 100644 --- a/pkgs/create-neon/data/templates/ci/github/release.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/release.yml.hbs @@ -74,7 +74,7 @@ jobs: fi echo publish=true | tee -a $GITHUB_OUTPUT - name: Checkout Code - uses: actions/checkout@{{versions.actions.checkout}} + uses: actions/checkout@{{versions.actions.verified.checkout}} - name: Setup Neon Environment uses: ./.github/actions/setup with: @@ -112,7 +112,7 @@ jobs: contents: write steps: - name: Checkout Code - uses: actions/checkout@{{versions.actions.checkout}} + uses: actions/checkout@{{versions.actions.verified.checkout}} with: ref: {{#$}} needs.setup.outputs.ref {{/$}} - name: Setup Neon Environment @@ -120,7 +120,7 @@ jobs: with: use-rust: false - name: Fetch - uses: robinraju/release-downloader@{{versions.actions.releaseDownloader}} + uses: robinraju/release-downloader@{{versions.actions.unverified.releaseDownloader.sha}} # {{versions.actions.unverified.releaseDownloader.tag}} with: tag: {{#$}} needs.setup.outputs.tag {{/$}} fileName: "*.tgz" diff --git a/pkgs/create-neon/data/templates/ci/github/setup.yml.hbs b/pkgs/create-neon/data/templates/ci/github/setup.yml.hbs index 3f8ccced0..b03f6dcff 100644 --- a/pkgs/create-neon/data/templates/ci/github/setup.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/setup.yml.hbs @@ -31,13 +31,13 @@ runs: using: "composite" steps: - name: Set Environment Variables - uses: falti/dotenv-action@{{versions.actions.dotenv}} + uses: falti/dotenv-action@{{versions.actions.unverified.dotenv.sha}} # {{versions.actions.unverified.dotenv.tag}} with: path: ./.github/.env export-variables: true keys-case: bypass - name: Install Node - uses: actions/setup-node@{{versions.actions.setupNode}} + uses: actions/setup-node@{{versions.actions.verified.setupNode}} with: node-version: {{#$}} env.NODE_VERSION {{/$}} registry-url: {{#$}} env.NPM_REGISTRY {{/$}} @@ -53,14 +53,14 @@ runs: working-directory: {{#$}} inputs.workspace {{/$}} - name: Install Rust if: {{#$}} inputs['use-rust'] == 'true' {{/$}} - uses: actions-rs/toolchain@{{versions.actions.setupRust}} + uses: actions-rs/toolchain@{{versions.actions.verified.setupRust}} with: toolchain: {{#$}} env.RUST_VERSION {{/$}} target: {{#$}} steps.target.outputs.target {{/$}} override: true - name: Install cross-rs if: {{#$}} inputs['use-cross'] == 'true' {{/$}} - uses: baptiste0928/cargo-install@{{versions.actions.cargoInstall}} + uses: baptiste0928/cargo-install@{{versions.actions.verified.cargoInstall}} with: crate: cross - name: Node Version diff --git a/pkgs/create-neon/data/templates/ci/github/test.yml.hbs b/pkgs/create-neon/data/templates/ci/github/test.yml.hbs index 8abb7043b..ff2d76695 100644 --- a/pkgs/create-neon/data/templates/ci/github/test.yml.hbs +++ b/pkgs/create-neon/data/templates/ci/github/test.yml.hbs @@ -54,7 +54,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Code - uses: actions/checkout@{{versions.actions.checkout}} + uses: actions/checkout@{{versions.actions.verified.checkout}} - name: Setup Neon Environment id: neon uses: ./.github/actions/setup diff --git a/pkgs/create-neon/data/versions.json b/pkgs/create-neon/data/versions.json index 222aa3d4a..1d3b37a1b 100644 --- a/pkgs/create-neon/data/versions.json +++ b/pkgs/create-neon/data/versions.json @@ -11,15 +11,28 @@ }, "node": "20", "actions": { - "checkout": "v3", - "githubScript": "v7", - "setupNode": "v3", - "setupRust": "v1", - "cargoInstall": "v2", - "neonBuild": "v0.9", - "neonPublish": "v0.4.1", - "dotenv": "v1", - "ghRelease": "v1", - "releaseDownloader": "v1.7" + "verified": { + "checkout": "v3", + "githubScript": "v7", + "setupNode": "v3", + "setupRust": "v1", + "cargoInstall": "v2", + "neonBuild": "v0.9", + "neonPublish": "v0.4.1" + }, + "unverified": { + "dotenv": { + "tag": "v1.1.2", + "sha": "d1cd55661714e830a6e26f608f81d36e23424fed" + }, + "ghRelease": { + "tag": "v2.0.4", + "sha": "9d7c94cfd0a1f3ed45544c887983e9fa900f0564" + }, + "releaseDownloader": { + "tag": "v1.10", + "sha": "c39a3b234af58f0cf85888573d361fb6fa281534" + } + } } } From 4ecd9b1660e5c5ac81a9dfd7afb3639355fe4854 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 5 May 2024 23:15:45 -0700 Subject: [PATCH 49/50] explain what "portable library" means in the README --- pkgs/create-neon/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/create-neon/README.md b/pkgs/create-neon/README.md index 79211316a..1630efe7b 100644 --- a/pkgs/create-neon/README.md +++ b/pkgs/create-neon/README.md @@ -22,6 +22,8 @@ $ npm init neon [ ...] my-project ### Creating a Portable Library +Neon also makes it easy to create **portable, cross-platform libraries** by publishing pre-built binaries. This means you can implement your Node.js library in Rust and publish the binaries so that users of your library (and any downstream users of theirs!) on all major hardware and operating systems can take a dependency on your library---_without having to install Rust or run any builds_. + To create a portable npm library with pre-built binaries: ```sh From fd212c13895fdd53a74fe038e74e14500410899a Mon Sep 17 00:00:00 2001 From: David Herman Date: Mon, 6 May 2024 11:39:15 -0700 Subject: [PATCH 50/50] fix failing test for --yes --- pkgs/create-neon/test/create-neon.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/create-neon/test/create-neon.ts b/pkgs/create-neon/test/create-neon.ts index 687e01611..71d8d8f5c 100644 --- a/pkgs/create-neon/test/create-neon.ts +++ b/pkgs/create-neon/test/create-neon.ts @@ -41,7 +41,7 @@ describe("Project creation", () => { it("succeeds with --yes", async () => { try { - await expect(spawn(NODE, [CREATE_NEON, PROJECT, "--yes"]), {}); + await execa(NODE, [CREATE_NEON, "--yes", PROJECT]); } catch (error: any) { assert.fail("create-neon unexpectedly failed: " + error.message); }