From ebec16eb53f11f42bcfa3bdf79f75266b9966e06 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Tue, 16 Jul 2024 15:49:02 +0800 Subject: [PATCH] test: add ipaddr.js case --- Cargo.lock | 36 +++++++++++++------------- Cargo.toml | 2 +- package.json | 2 +- packages/integrate-module/package.json | 1 + packages/integrate-module/src/index.ts | 5 ++++ pnpm-lock.yaml | 19 ++++++++++---- 6 files changed, 40 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aeef80e..1c4a7d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -95,9 +95,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.105" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5208975e568d83b6b05cc0a063c8e7e9acc2b43bee6da15616a5b73e109d7437" +checksum = "324c74f2155653c90b04f25b2a47a8a631360cb908f92a772695f430c7e31052" [[package]] name = "cfg-if" @@ -376,9 +376,9 @@ checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" [[package]] name = "napi-derive" -version = "3.0.0-alpha.5" +version = "3.0.0-alpha.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e82f3209766c72466e28f05d8e55931cfda1652877b2cadf4011034890a2770" +checksum = "1c6240c4ddca592cde608bbfa26e2af397c3596e413a0c65c9bbcb65c2f1e485" dependencies = [ "cfg-if", "convert_case", @@ -390,9 +390,9 @@ dependencies = [ [[package]] name = "napi-derive-backend" -version = "2.0.0-alpha.5" +version = "2.0.0-alpha.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b17d6c84ea7366a126d850e2010f2d8354be1d3f2c62bc20751b08ba5b0a774" +checksum = "b32dcc50065508fe2f387076c17adbdf10e038d1c080d48b10196813d94ac6a8" dependencies = [ "convert_case", "once_cell", @@ -640,9 +640,9 @@ dependencies = [ [[package]] name = "oxc_resolver" -version = "1.9.4" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd8cd23b6c382e84e5de0de3c9f0f275f55afb7e1a9ef7ea743d5316fbd8da7b" +checksum = "b5f862ee8e1ba728378ac7e007de195ae00fbb21337ef152380c052cc07e2ee2" dependencies = [ "dashmap", "dunce", @@ -864,9 +864,9 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "redox_syscall" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ "bitflags", ] @@ -1031,9 +1031,9 @@ checksum = "e9557cb6521e8d009c51a8666f09356f4b817ba9ba0981a305bd86aee47bd35c" [[package]] name = "syn" -version = "2.0.69" +version = "2.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201fcda3845c23e8212cd466bfebf0bd20694490fc0356ae8e428e0824a915a6" +checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" dependencies = [ "proc-macro2", "quote", @@ -1053,18 +1053,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "f2675633b1499176c2dff06b0856a27976a8f9d436737b4cf4f312d4d91d8bbb" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "d20468752b09f49e909e55a5d338caa8bedf615594e9d80bc4c565d30faf798c" dependencies = [ "proc-macro2", "quote", @@ -1155,9 +1155,9 @@ dependencies = [ [[package]] name = "unicode-id-start" -version = "1.1.2" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8f73150333cb58412db36f2aca8f2875b013049705cc77b94ded70a1ab1f5da" +checksum = "bc3882f69607a2ac8cc4de3ee7993d8f68bb06f2974271195065b3bd07f2edea" [[package]] name = "unicode-ident" diff --git a/Cargo.toml b/Cargo.toml index dae0d4f..b9c8bb1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ crate-type = ["cdylib"] [dependencies] napi = { version = "3.0.0-alpha.7", default-features = false, features = ["async", "serde-json"] } -napi-derive = { version = "3.0.0-alpha.5", default-features = false, features = ["type-def"] } +napi-derive = { version = "3.0.0-alpha.6", default-features = false, features = ["type-def"] } oxc = { version = "0.20", features = ["codegen", "transformer"] } oxc_resolver = "1" phf = "0.11" diff --git a/package.json b/package.json index c034c0f..5f3c9f1 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "packageManager": "pnpm@9.5.0", "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.58", + "@napi-rs/cli": "^3.0.0-alpha.60", "@napi-rs/wasm-runtime": "^0.2.4", "@oxc-node/core": "workspace:*", "@taplo/cli": "^0.7.0", diff --git a/packages/integrate-module/package.json b/packages/integrate-module/package.json index 26e4cc0..8b58f59 100644 --- a/packages/integrate-module/package.json +++ b/packages/integrate-module/package.json @@ -17,6 +17,7 @@ "@types/node": "^20.14.9", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", + "ipaddr.js": "^2.2.0", "react": "^18.3.1", "react-dom": "^18.3.1", "simple-git": "^3.25.0", diff --git a/packages/integrate-module/src/index.ts b/packages/integrate-module/src/index.ts index b123472..64df26b 100644 --- a/packages/integrate-module/src/index.ts +++ b/packages/integrate-module/src/index.ts @@ -6,6 +6,7 @@ import { bar as subBar } from '@subdirectory/bar.mjs' import { supportedExtensions } from 'file-type' import { renderToString } from 'react-dom/server' import { simpleGit } from 'simple-git' +import ipaddr from 'ipaddr.js' import { CompiledClass } from './compiled.js' import { foo } from './foo.mjs' @@ -61,3 +62,7 @@ await test('resolve simple-git', () => { await test('resolve package.json', () => { assert.equal(pkgJson.name, 'integrate-module') }) + +await test('resolve ipaddr.js', () => { + assert.ok(ipaddr.isValid('::1')) +}) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1a71531..4646b5c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: devDependencies: '@napi-rs/cli': - specifier: ^3.0.0-alpha.58 - version: 3.0.0-alpha.58(@emnapi/runtime@1.2.0)(emnapi@1.2.0) + specifier: ^3.0.0-alpha.60 + version: 3.0.0-alpha.60(@emnapi/runtime@1.2.0)(emnapi@1.2.0) '@napi-rs/wasm-runtime': specifier: ^0.2.4 version: 0.2.4 @@ -110,6 +110,9 @@ importers: '@types/react-dom': specifier: ^18.3.0 version: 18.3.0 + ipaddr.js: + specifier: ^2.2.0 + version: 2.2.0 react: specifier: ^18.3.1 version: 18.3.1 @@ -419,8 +422,8 @@ packages: resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} hasBin: true - '@napi-rs/cli@3.0.0-alpha.58': - resolution: {integrity: sha512-BVLF6rS5cjLJNPDktqcYsYax/nYhwHyFXFMJSDEqC0MmqCdiucVmW9pQZkrBKM1N/qddHcNr+GFEjTN0h7ns6Q==} + '@napi-rs/cli@3.0.0-alpha.60': + resolution: {integrity: sha512-FVHjxlz83X3MYRc7L+hnhJgokbEoicujDHPk2XFcv3sxlJwVMHGxt5RjnPQpNo5iA4sEzWw+SKt2rtOAJjUHew==} engines: {node: '>= 16'} hasBin: true peerDependencies: @@ -2246,6 +2249,10 @@ packages: resolution: {integrity: sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==} engines: {node: '>= 12'} + ipaddr.js@2.2.0: + resolution: {integrity: sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==} + engines: {node: '>= 10'} + irregular-plurals@3.5.0: resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} engines: {node: '>=8'} @@ -4070,7 +4077,7 @@ snapshots: - encoding - supports-color - '@napi-rs/cli@3.0.0-alpha.58(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': + '@napi-rs/cli@3.0.0-alpha.60(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': dependencies: '@napi-rs/cross-toolchain': 0.0.16 '@napi-rs/wasm-tools': 0.0.2 @@ -5875,6 +5882,8 @@ snapshots: jsbn: 1.1.0 sprintf-js: 1.1.3 + ipaddr.js@2.2.0: {} + irregular-plurals@3.5.0: {} is-arrayish@0.2.1: {}