dev-util/fnm: add 1.35.1

Signed-off-by: Takuya Wakazono <pastalian46@gmail.com>
This commit is contained in:
Takuya Wakazono
2024-02-11 19:04:02 +09:00
parent b8a3f0a56b
commit 5841edf525
4 changed files with 763 additions and 0 deletions

View File

@@ -0,0 +1,81 @@
Remove vulnerable time-0.1.x chrono dependency
https://github.com/Schniz/fnm/pull/884
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -275,7 +275,6 @@ dependencies = [
"js-sys",
"num-traits",
"serde",
- "time 0.1.45",
"wasm-bindgen",
"winapi",
]
@@ -737,7 +736,7 @@ checksum = "be4136b2a15dd319360be1c07d99
dependencies = [
"cfg-if",
"libc",
- "wasi 0.11.0+wasi-snapshot-preview1",
+ "wasi",
]
[[package]]
@@ -1109,7 +1108,7 @@ source = "registry+https://github.com/ru
checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2"
dependencies = [
"libc",
- "wasi 0.11.0+wasi-snapshot-preview1",
+ "wasi",
"windows-sys 0.48.0",
]
@@ -1755,17 +1754,6 @@ dependencies = [
[[package]]
name = "time"
-version = "0.1.45"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a"
-dependencies = [
- "libc",
- "wasi 0.10.0+wasi-snapshot-preview1",
- "winapi",
-]
-
-[[package]]
-name = "time"
version = "0.3.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd"
@@ -1970,12 +1958,6 @@ dependencies = [
[[package]]
name = "wasi"
-version = "0.10.0+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
-
-[[package]]
-name = "wasi"
version = "0.11.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
@@ -2287,7 +2269,7 @@ dependencies = [
"hmac",
"pbkdf2",
"sha1",
- "time 0.3.22",
+ "time",
"zstd",
]
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,7 +12,7 @@ description = "Fast and simple Node.js v
serde = { version = "1.0.166", features = ["derive"] }
clap = { version = "4.3.10", features = ["derive", "env"] }
serde_json = "1.0.100"
-chrono = { version = "0.4.26", features = ["serde"] }
+chrono = { version = "0.4.24", default-features = false, features = ["clock", "serde", "std", "wasmbind"] }
tar = "0.4.38"
xz2 = "0.1.7"
node-semver = "2.1.0"

View File

@@ -0,0 +1,201 @@
Skip Windows-related tests
--- a/e2e/aliases.test.ts
+++ b/e2e/aliases.test.ts
@@ -1,5 +1,5 @@
import { script } from "./shellcode/script.js"
-import { Bash, Fish, PowerShell, Zsh } from "./shellcode/shells.js"
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
import describe from "./describe.js"
import { writeFile } from "node:fs/promises"
import path from "node:path"
@@ -7,7 +7,7 @@ import testCwd from "./shellcode/test-cw
import getStderr from "./shellcode/get-stderr.js"
import testNodeVersion from "./shellcode/test-node-version.js"
-for (const shell of [Bash, Zsh, Fish, PowerShell]) {
+for (const shell of [Bash, Zsh, Fish]) {
describe(shell, () => {
test(`allows to install an lts if version missing`, async () => {
await writeFile(path.join(testCwd(), ".node-version"), "lts/*")
--- a/e2e/basic.test.ts
+++ b/e2e/basic.test.ts
@@ -1,12 +1,12 @@
import { writeFile, mkdir } from "node:fs/promises"
import { join } from "node:path"
import { script } from "./shellcode/script.js"
-import { Bash, Fish, PowerShell, WinCmd, Zsh } from "./shellcode/shells.js"
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
import testCwd from "./shellcode/test-cwd.js"
import testNodeVersion from "./shellcode/test-node-version.js"
import describe from "./describe.js"
-for (const shell of [Bash, Zsh, Fish, PowerShell, WinCmd]) {
+for (const shell of [Bash, Zsh, Fish]) {
describe(shell, () => {
test(`basic usage`, async () => {
await script(shell)
--- a/e2e/corepack.test.ts
+++ b/e2e/corepack.test.ts
@@ -1,6 +1,6 @@
import fs from "fs"
import { script } from "./shellcode/script.js"
-import { Bash, Fish, PowerShell, Zsh } from "./shellcode/shells.js"
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
import describe from "./describe.js"
import path from "path"
import testCwd from "./shellcode/test-cwd.js"
@@ -28,7 +28,7 @@ const nodescript = `
}
`
-for (const shell of [Bash, Fish, PowerShell, Zsh]) {
+for (const shell of [Bash, Fish, Zsh]) {
describe(shell, () => {
test(`installs corepack`, async () => {
const cwd = testCwd()
--- a/e2e/current.test.ts
+++ b/e2e/current.test.ts
@@ -1,8 +1,8 @@
import { script } from "./shellcode/script.js"
-import { Bash, Fish, PowerShell, WinCmd, Zsh } from "./shellcode/shells.js"
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
import describe from "./describe.js"
-for (const shell of [Bash, Zsh, Fish, PowerShell, WinCmd]) {
+for (const shell of [Bash, Zsh, Fish]) {
describe(shell, () => {
test(`current returns the current Node.js version set in fnm`, async () => {
await script(shell)
--- a/e2e/env.test.ts
+++ b/e2e/env.test.ts
@@ -1,11 +1,11 @@
import { readFile } from "node:fs/promises"
import { join } from "node:path"
import { script } from "./shellcode/script.js"
-import { Bash, Fish, PowerShell, WinCmd, Zsh } from "./shellcode/shells.js"
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
import testCwd from "./shellcode/test-cwd.js"
import describe from "./describe.js"
-for (const shell of [Bash, Zsh, Fish, PowerShell, WinCmd]) {
+for (const shell of [Bash, Zsh, Fish]) {
describe(shell, () => {
test(`outputs json`, async () => {
const filename = `file.json`
--- a/e2e/exec.test.ts
+++ b/e2e/exec.test.ts
@@ -1,11 +1,11 @@
import { script } from "./shellcode/script.js"
-import { Bash, Fish, PowerShell, WinCmd, Zsh } from "./shellcode/shells.js"
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
import testCwd from "./shellcode/test-cwd.js"
import fs from "node:fs/promises"
import path from "node:path"
import describe from "./describe.js"
-for (const shell of [Bash, Zsh, Fish, PowerShell, WinCmd]) {
+for (const shell of [Bash, Zsh, Fish]) {
describe(shell, () => {
test("`exec` usage", async () => {
await fs.writeFile(path.join(testCwd(), ".nvmrc"), "v8.10.0")
--- a/e2e/existing-installation.test.ts
+++ b/e2e/existing-installation.test.ts
@@ -1,9 +1,9 @@
import getStderr from "./shellcode/get-stderr.js"
import { script } from "./shellcode/script.js"
-import { Bash, Fish, PowerShell, Zsh } from "./shellcode/shells.js"
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
import describe from "./describe.js"
-for (const shell of [Bash, Zsh, Fish, PowerShell]) {
+for (const shell of [Bash, Zsh, Fish]) {
describe(shell, () => {
test(`warns about an existing installation`, async () => {
await script(shell)
--- a/e2e/latest-lts.test.ts
+++ b/e2e/latest-lts.test.ts
@@ -1,8 +1,8 @@
import { script } from "./shellcode/script.js"
-import { Bash, Fish, PowerShell, Zsh } from "./shellcode/shells.js"
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
import describe from "./describe.js"
-for (const shell of [Bash, Zsh, Fish, PowerShell]) {
+for (const shell of [Bash, Zsh, Fish]) {
describe(shell, () => {
test(`installs latest lts`, async () => {
await script(shell)
--- a/e2e/log-level.test.ts
+++ b/e2e/log-level.test.ts
@@ -1,9 +1,9 @@
import { script } from "./shellcode/script.js"
-import { Bash, Fish, PowerShell, Zsh } from "./shellcode/shells.js"
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
import describe from "./describe.js"
import getStderr from "./shellcode/get-stderr.js"
-for (const shell of [Bash, Zsh, Fish, PowerShell]) {
+for (const shell of [Bash, Zsh, Fish]) {
describe(shell, () => {
test(`"quiet" log level`, async () => {
await script(shell)
--- a/e2e/multishell.test.ts
+++ b/e2e/multishell.test.ts
@@ -1,9 +1,9 @@
import { script } from "./shellcode/script.js"
-import { Bash, Fish, PowerShell, Zsh } from "./shellcode/shells.js"
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
import testNodeVersion from "./shellcode/test-node-version.js"
import describe from "./describe.js"
-for (const shell of [Bash, Zsh, Fish, PowerShell]) {
+for (const shell of [Bash, Zsh, Fish]) {
describe(shell, () => {
test(`multishell changes don't affect parent`, async () => {
await script(shell)
--- a/e2e/nvmrc-lts.test.ts
+++ b/e2e/nvmrc-lts.test.ts
@@ -1,11 +1,11 @@
import { script } from "./shellcode/script.js"
-import { Bash, Fish, PowerShell, Zsh } from "./shellcode/shells.js"
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
import fs from "node:fs/promises"
import path from "node:path"
import describe from "./describe.js"
import testCwd from "./shellcode/test-cwd.js"
-for (const shell of [Bash, Fish, PowerShell, Zsh]) {
+for (const shell of [Bash, Fish, Zsh]) {
describe(shell, () => {
test(`uses .nvmrc with lts definition`, async () => {
await fs.writeFile(path.join(testCwd(), ".nvmrc"), `lts/dubnium`)
--- a/e2e/system-node.test.ts
+++ b/e2e/system-node.test.ts
@@ -1,12 +1,12 @@
import { script } from "./shellcode/script.js"
-import { Bash, Fish, PowerShell, WinCmd, Zsh } from "./shellcode/shells.js"
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
import fs from "node:fs/promises"
import path from "node:path"
import describe from "./describe.js"
import testNodeVersion from "./shellcode/test-node-version.js"
import testBinDir from "./shellcode/test-bin-dir.js"
-for (const shell of [Bash, Fish, PowerShell, WinCmd, Zsh]) {
+for (const shell of [Bash, Fish, Zsh]) {
describe(shell, () => {
// latest bash breaks this as it seems. gotta find a solution.
const t = process.platform === "darwin" && shell === Bash ? test.skip : test
--- a/e2e/uninstall.test.ts
+++ b/e2e/uninstall.test.ts
@@ -1,8 +1,8 @@
import { script } from "./shellcode/script.js"
-import { Bash, Fish, PowerShell, Zsh } from "./shellcode/shells.js"
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
import describe from "./describe.js"
-for (const shell of [Bash, Zsh, Fish, PowerShell]) {
+for (const shell of [Bash, Zsh, Fish]) {
describe(shell, () => {
test(`uninstalls a version`, async () => {
await script(shell)