diff --git a/Cargo.lock b/Cargo.lock index 1d80dc00..fe02380d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7,10 +7,6 @@ name = "Inflector" version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] [[package]] name = "addr2line" @@ -329,6 +325,9 @@ name = "bumpalo" version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +dependencies = [ + "allocator-api2", +] [[package]] name = "byteorder" @@ -2037,6 +2036,26 @@ dependencies = [ "cc", ] +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "quickcheck" version = "1.0.3" @@ -2508,9 +2527,9 @@ dependencies = [ [[package]] name = "sourcemap" -version = "8.0.1" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "208d40b9e8cad9f93613778ea295ed8f3c2b1824217c6cfc7219d3f6f45b96d4" +checksum = "dab08a862c70980b8e23698b507e272317ae52a608a164a844111f5372374f1f" dependencies = [ "base64-simd", "bitvec", @@ -2593,6 +2612,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "swc_allocator" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adc8bd3075d1c6964010333fae9ddcd91ad422a4f8eb8b3206a9b2b6afb4209e" +dependencies = [ + "bumpalo", + "hashbrown 0.14.5", + "ptr_meta", + "rustc-hash", + "triomphe", +] + [[package]] name = "swc_atoms" version = "0.6.7" @@ -2607,9 +2639,9 @@ dependencies = [ [[package]] name = "swc_common" -version = "0.34.4" +version = "0.37.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9087befec6b63911f9d2f239e4f91c9b21589c169b86ed2d616944d23cf4a243" +checksum = "46741b5a4ff3e821f6bb8d6c1289549272e71a5e0d163dbbae9e16e771d8da76" dependencies = [ "ast_node", "better_scoped_tls", @@ -2623,6 +2655,7 @@ dependencies = [ "serde", "siphasher", "sourcemap", + "swc_allocator", "swc_atoms", "swc_eq_ignore_macros", "swc_visit", @@ -2633,10 +2666,11 @@ dependencies = [ [[package]] name = "swc_core" -version = "0.96.9" +version = "0.100.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de60918c09a10e55b659b4e70029d283da815e3107b22f79ec9fac280d4d8843" +checksum = "ea7cddc4ca9b04e7433d5710751f0266325db2382642f2c7c3e8c97676f23948" dependencies = [ + "swc_allocator", "swc_atoms", "swc_common", "swc_ecma_ast", @@ -2647,9 +2681,9 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "0.115.1" +version = "0.118.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7be1306930c235435a892104c00c2b5e16231043c085d5a10bd3e7537b15659b" +checksum = "ed6c1b94abbaf080a4e4ae47101a83d4eedef90d733dd98e32b361356d3f5e4b" dependencies = [ "bitflags", "is-macro", @@ -2664,9 +2698,9 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "0.146.12" +version = "0.149.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a4e0c2e85f12c63b85c805e923079b04d1fb3e25edd069d638eed5f2098de74" +checksum = "7c7a81df222f44212c72fec4879c0d182c6eac66fb0e180afd05e8be6d920663" dependencies = [ "either", "new_debug_unreachable", @@ -2686,9 +2720,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "0.140.3" +version = "0.144.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d37dc505c92af56d0f77cf6f31a6ccd37ac40cad1e01ff77277e0b1c70e8f8ff" +checksum = "7c0a71579d030e12fd3cfbfc8712c4ce21afc526f2a759903c77d8df61950f5e" dependencies = [ "better_scoped_tls", "bitflags", @@ -2709,9 +2743,9 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "0.130.3" +version = "0.134.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e62b199454a576c5fdbd7e1bef8ab88a395427456d8a713d994b7d469833aa" +checksum = "cde8f1ef3f7bd53340c7bd679f1ec563a45225ac8fb63f22d6de1ff4b345475d" dependencies = [ "indexmap 2.2.6", "num_cpus", @@ -2728,10 +2762,11 @@ dependencies = [ [[package]] name = "swc_ecma_visit" -version = "0.101.0" +version = "0.104.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce0d997f0c9b4e181225f603d161f6757c2a97022258170982cfe005ec69ec92" +checksum = "c71f5f97db49b96208805104b381c5e117f55fad5f3d178e626c92934a4d0e36" dependencies = [ + "new_debug_unreachable", "num-bigint", "swc_atoms", "swc_common", @@ -2764,25 +2799,12 @@ dependencies = [ [[package]] name = "swc_visit" -version = "0.5.14" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043d11fe683dcb934583ead49405c0896a5af5face522e4682c16971ef7871b9" +checksum = "1ceb044142ba2719ef9eb3b6b454fce61ab849eb696c34d190f04651955c613d" dependencies = [ "either", - "swc_visit_macros", -] - -[[package]] -name = "swc_visit_macros" -version = "0.5.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae9ef18ff8daffa999f729db056d2821cd2f790f3a11e46422d19f46bb193e7" -dependencies = [ - "Inflector", - "proc-macro2", - "quote", - "swc_macros_common", - "syn 2.0.70", + "new_debug_unreachable", ] [[package]] @@ -3030,9 +3052,9 @@ checksum = "b1b6def86329695390197b82c1e244a54a131ceb66c996f2088a3876e2ae083f" [[package]] name = "unicode-id-start" -version = "1.0.4" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02aebfa694eccbbbffdd92922c7de136b9fe764396d2f10e21bce1681477cfc1" +checksum = "bc3882f69607a2ac8cc4de3ee7993d8f68bb06f2974271195065b3bd07f2edea" [[package]] name = "unicode-ident" diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index d92c8b87..bb470d96 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -23,7 +23,7 @@ wasmtime = { workspace = true } wasmtime-wasi = { workspace = true } wasi-common = { workspace = true } walrus = "0.21.1" -swc_core = { version = "0.96.0", features = [ +swc_core = { version = "0.100.6", features = [ "common_sourcemap", "ecma_ast", "ecma_parser", diff --git a/crates/cli/src/js.rs b/crates/cli/src/js.rs index 1e6465fe..9d08732c 100644 --- a/crates/cli/src/js.rs +++ b/crates/cli/src/js.rs @@ -148,7 +148,7 @@ impl JS { fn parse_module(&self) -> Result { let source_map: SourceMap = Default::default(); - let file = source_map.new_source_file_from(FileName::Anon, self.source_code.clone()); + let file = source_map.new_source_file_from(FileName::Anon.into(), self.source_code.clone()); let mut errors = vec![]; parser::parse_file_as_module( &file, diff --git a/npm/javy-cli/CHANGELOG.md b/npm/javy-cli/CHANGELOG.md index ae212f51..5f3700d0 100644 --- a/npm/javy-cli/CHANGELOG.md +++ b/npm/javy-cli/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Changed + +- Download version 3.0.1 of Javy instead of the latest released version of Javy. + ## [0.2.0] - 2023-08-17 ### Removed diff --git a/npm/javy-cli/README.md b/npm/javy-cli/README.md index 0978bedc..0977a5d8 100644 --- a/npm/javy-cli/README.md +++ b/npm/javy-cli/README.md @@ -1,8 +1,10 @@ -# Javy npm package +# javy-cli npm package + +**This package is deprecated. Please download the appropriate release from [Javy's release page](https://github.com/bytecodealliance/javy/releases).** This is the npm package for Javy. The package contains a small Node script that downloads the appropriate Javy binary on demand and invokes it with the -parameters given. +parameters given. ## Usage @@ -13,17 +15,3 @@ $ npm install -g javy-cli # Directly invoke it via npm $ npx javy-cli@latest ``` - -## Updating javy - -The npm package will automatically download the newest version of Javy if a -newer version is available. - -## Using a specific version of javy - -To use a specific version of Javy, set the environment variable -`FORCE_RELEASE` to the version you would like to use. - -``` -FORCE_RELEASE=v1.1.0 npx javy-cli@latest -``` diff --git a/npm/javy-cli/index.js b/npm/javy-cli/index.js index befa0c6e..a1184730 100755 --- a/npm/javy-cli/index.js +++ b/npm/javy-cli/index.js @@ -10,14 +10,14 @@ import cachedir from "cachedir"; const REPO = "bytecodealliance/javy"; const NAME = "javy"; +const VERSION = "v3.0.1"; async function main() { try { - const version = await getDesiredVersionNumber(); - if (!(await isBinaryDownloaded(version))) { - await downloadBinary(version); + if (!(await isBinaryDownloaded(VERSION))) { + await downloadBinary(VERSION); } - const result = childProcess.spawnSync(binaryPath(version), getArgs(), { + const result = childProcess.spawnSync(binaryPath(VERSION), getArgs(), { stdio: "inherit", }); process.exitCode = result.status === null ? 1 : result.status; @@ -30,7 +30,7 @@ async function main() { // We delete the cached binary because that cached binary will never run successfully and // stops `javy-cli` from redownloading the binary. console.error(`${NAME} was not downloaded correctly. Please retry.`); - fs.unlinkSync(binaryPath(version)); + fs.unlinkSync(binaryPath(VERSION)); } } catch (e) { console.error(e); @@ -80,33 +80,6 @@ async function downloadBinary(version) { await fs.promises.chmod(binaryPath(version), 0o775); } -/** - * getDesiredVersionNumber returns the version number of the release that - * should be downloaded and launched. If the FORCE_RELEASE env variable is set, - * that will be used as the desired version number, if not, we determine the - * latest release available on GitHub. - * - * GitHub has a public Release API, but rate limits it per IP, so that the - * CLI can end up breaking. Instead, we use a little trick. You can download - * artifacts from the latest release by using `latest` as your version number. - * The server will respond with a 302 redirect to the artifact's URL. That URL - * contains the actual release version number, which we can extract. - */ -async function getDesiredVersionNumber() { - if (process.env.FORCE_RELEASE) return process.env.FORCE_RELEASE; - const resp = await fetch( - `https://github.com/${REPO}/releases/latest/download/lol`, - { redirect: "manual" } - ); - if (resp.status != 302) { - throw Error( - `Could not determine latest release using the GitHub (Status code ${resp.status - }): ${await resp.text().catch(() => "")}` - ); - } - return resp.headers.get("location").split("/").at(-2); -} - function binaryUrl(version) { return `https://github.com/${REPO}/releases/download/${version}/${NAME}-${platarch()}-${version}.gz`; } diff --git a/supply-chain/config.toml b/supply-chain/config.toml index 2477a20b..3975db78 100644 --- a/supply-chain/config.toml +++ b/supply-chain/config.toml @@ -464,6 +464,14 @@ criteria = "safe-to-deploy" version = "0.1.21" criteria = "safe-to-deploy" +[[exemptions.ptr_meta]] +version = "0.1.4" +criteria = "safe-to-deploy" + +[[exemptions.ptr_meta_derive]] +version = "0.1.4" +criteria = "safe-to-deploy" + [[exemptions.radium]] version = "0.7.0" criteria = "safe-to-deploy" @@ -581,7 +589,7 @@ version = "0.4.4" criteria = "safe-to-deploy" [[exemptions.sourcemap]] -version = "8.0.1" +version = "9.0.0" criteria = "safe-to-deploy" [[exemptions.stable_deref_trait]] @@ -600,36 +608,40 @@ criteria = "safe-to-deploy" version = "0.11.1" criteria = "safe-to-deploy" +[[exemptions.swc_allocator]] +version = "0.1.8" +criteria = "safe-to-deploy" + [[exemptions.swc_atoms]] version = "0.6.7" criteria = "safe-to-deploy" [[exemptions.swc_common]] -version = "0.34.4" +version = "0.37.2" criteria = "safe-to-deploy" [[exemptions.swc_core]] -version = "0.96.9" +version = "0.100.6" criteria = "safe-to-deploy" [[exemptions.swc_ecma_ast]] -version = "0.115.1" +version = "0.118.1" criteria = "safe-to-deploy" [[exemptions.swc_ecma_parser]] -version = "0.146.12" +version = "0.149.0" criteria = "safe-to-deploy" [[exemptions.swc_ecma_transforms_base]] -version = "0.140.3" +version = "0.144.0" criteria = "safe-to-deploy" [[exemptions.swc_ecma_utils]] -version = "0.130.3" +version = "0.134.1" criteria = "safe-to-deploy" [[exemptions.swc_ecma_visit]] -version = "0.101.0" +version = "0.104.5" criteria = "safe-to-deploy" [[exemptions.swc_eq_ignore_macros]] @@ -641,11 +653,7 @@ version = "0.3.11" criteria = "safe-to-deploy" [[exemptions.swc_visit]] -version = "0.5.14" -criteria = "safe-to-deploy" - -[[exemptions.swc_visit_macros]] -version = "0.5.12" +version = "0.6.2" criteria = "safe-to-deploy" [[exemptions.tempfile]] @@ -685,7 +693,7 @@ version = "0.3.4" criteria = "safe-to-deploy" [[exemptions.unicode-id-start]] -version = "1.0.4" +version = "1.2.0" criteria = "safe-to-deploy" [[exemptions.unicode-width]]