diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2d71d68a..193a1505 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -101,11 +101,6 @@ jobs: if: ${{ inputs.ezno-version != 'none' }} run: rustup target add wasm32-unknown-unknown - - uses: brndnmtthws/rust-action-cargo-binstall@v1 - if: ${{ inputs.ezno-version != 'none' }} - with: - packages: wasm-pack@0.13.0 - - name: Set NPM package version & build id: set-npm-version if: ${{ inputs.ezno-version != 'none' }} diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 4d6882bb..9a2efc66 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -138,10 +138,6 @@ jobs: checker: - 'checker/**' - - uses: brndnmtthws/rust-action-cargo-binstall@v1 - if: steps.changes.outputs.src == 'true' || github.ref_name == 'main' - with: - packages: wasm-pack@0.13.0 - uses: denoland/setup-deno@v1 if: steps.changes.outputs.src == 'true' || github.ref_name == 'main' with: diff --git a/checker/definitions/internal.ts.d.bin b/checker/definitions/internal.ts.d.bin index 720f6309..c4f51fa0 100644 Binary files a/checker/definitions/internal.ts.d.bin and b/checker/definitions/internal.ts.d.bin differ diff --git a/checker/definitions/overrides.d.ts b/checker/definitions/overrides.d.ts index 03781523..ad67900c 100644 --- a/checker/definitions/overrides.d.ts +++ b/checker/definitions/overrides.d.ts @@ -368,9 +368,21 @@ declare class Object { @Constant static freeze(on: object): object; + @Constant + static seal(on: object): object; + + @Constant + static preventExtensions(on: object): object; + @Constant static isFrozen(on: object): boolean; + @Constant + static isSealed(on: object): boolean; + + @Constant + static isExtensible(on: object): boolean; + // TODO defineProperties via body (not constant) @Constant static defineProperty(on: object, property: string, discriminator: PropertyDescriptor): boolean; diff --git a/checker/definitions/simple.d.ts b/checker/definitions/simple.d.ts index c1b03c9d..aba85ea2 100644 --- a/checker/definitions/simple.d.ts +++ b/checker/definitions/simple.d.ts @@ -371,9 +371,21 @@ declare class Object { @Constant static freeze(on: object): object; + @Constant + static seal(on: object): object; + + @Constant + static preventExtensions(on: object): object; + @Constant static isFrozen(on: object): boolean; + @Constant + static isSealed(on: object): boolean; + + @Constant + static isExtensible(on: object): boolean; + // TODO defineProperties via body (not constant) @Constant static defineProperty(on: object, property: string, discriminator: PropertyDescriptor): boolean; diff --git a/checker/specification/specification.md b/checker/specification/specification.md index f218a2b4..c571ba41 100644 --- a/checker/specification/specification.md +++ b/checker/specification/specification.md @@ -529,22 +529,6 @@ keys satisfies boolean - Expected boolean, found "nbd" -#### `Object.freeze` - -> TODO seal & preventExtensions - -```ts -const obj = {} -let result = Object.freeze(obj); -(obj === result) satisfies true; -obj.property = 2; -Object.isFrozen(obj) satisfies true; -``` - -> TODO maybe error should say that whole object is frozen - -- Cannot write to property 'property' - #### `Object.defineProperty` writable > TODO defineProperties @@ -634,7 +618,86 @@ obj satisfies string; ``` - Expected string, found { a: 1, b: 2, c: 3 } -s + +#### `Object.freeze` + +> When `Object.freeze` is called, the object's `isSealed` is inferred as `true` + +```ts +const obj = {} +let result = Object.freeze(obj); +(obj === result) satisfies true; +obj.property = 2; +Object.isSealed(obj) satisfies true; +``` + +- Cannot write to property 'property' + +#### `Object.seal` + +> When `Object.seal` is called, the object's `isFrozen` and `isSealed` are inferred as `true` + +```ts +const obj = { a: 2 } +let result = Object.seal(obj); +(obj === result) satisfies true; + +// Allowed +obj.a = 4; +// Not allowed +obj.property = 2; + +Object.isSealed(obj) satisfies true; +Object.isFrozen(obj) satisfies false; +``` + +- Cannot write to property 'property' + +#### `Object.preventExtensions` + +> When `Object.preventExtensions` is called, the object's `isFrozen` and `isSealed` are inferred as `true` + +```ts +const obj = { a: 2 } +let result = Object.preventExtensions(obj); +(obj === result) satisfies true; + +// Allowed +obj.a = 4; +// Not allowed +obj.property = 2; + +Object.isFrozen(obj) satisfies false; +Object.isSealed(obj) satisfies false; +``` + +- Cannot write to property 'property' + +#### `Object.isExtensible` + +> The object that has been applied `Object.seal`, `Object.freeze` and `Object.preventExtensions` returns `false` by `Object.isExtensible`, otherwise returns `true` + +```ts +{ + const obj = {} + Object.isExtensible(obj) satisfies true; + Object.preventExtensions(obj); + Object.isExtensible(obj) satisfies false; +} +{ + const obj = {} + Object.seal(obj); + Object.isExtensible(obj) satisfies false; +} +{ + const obj = {} + Object.freeze(obj); + Object.isExtensible(obj) satisfies 5; +} +``` + +- Expected 5, found false + ### Excess properties > The following work through the same mechanism as forward inference diff --git a/checker/src/context/information.rs b/checker/src/context/information.rs index e84835be..486587a4 100644 --- a/checker/src/context/information.rs +++ b/checker/src/context/information.rs @@ -1,5 +1,5 @@ use source_map::SpanWithSource; -use std::collections::{HashMap, HashSet}; +use std::collections::HashMap; use crate::{ events::{Event, RootReference}, @@ -32,8 +32,8 @@ pub struct LocalInformation { /// `ContextId` is a mini context pub(crate) closure_current_values: HashMap<(ClosureId, RootReference), TypeId>, - /// Not writeable, `TypeError: Cannot add property t, object is not extensible`. TODO conditional ? - pub(crate) frozen: HashSet, + /// Not writeable, `TypeError: Cannot add property, object is not extensible`. TODO conditional ? + pub(crate) frozen: HashMap, /// Object type (LHS), must always be RHS /// @@ -52,6 +52,13 @@ pub struct LocalInformation { pub(crate) value_of_this: ThisValue, } +#[derive(Debug, Clone, Copy, binary_serialize_derive::BinarySerializable)] +pub enum ObjectProtectionState { + Frozen, + Sealed, + NoExtensions, +} + #[derive(Debug, Default, binary_serialize_derive::BinarySerializable, Clone)] pub(crate) enum ReturnState { #[default] @@ -228,7 +235,7 @@ impl LocalInformation { .extend(other.current_properties.iter().map(|(l, r)| (*l, r.clone()))); self.closure_current_values .extend(other.closure_current_values.iter().map(|(l, r)| (l.clone(), *r))); - self.frozen.extend(other.frozen.iter().clone()); + self.frozen.extend(other.frozen.clone()); self.narrowed_values.extend(other.narrowed_values.iter().copied()); self.state = other.state.clone(); } diff --git a/checker/src/context/mod.rs b/checker/src/context/mod.rs index e8b11f28..25126536 100644 --- a/checker/src/context/mod.rs +++ b/checker/src/context/mod.rs @@ -7,6 +7,7 @@ pub mod information; pub mod invocation; mod root; +use information::ObjectProtectionState; pub(crate) use invocation::CallCheckingBehavior; pub use root::RootContext; @@ -518,7 +519,7 @@ impl Context { } /// TODO doesn't look at aliases using `get_type_fact`! - pub fn is_frozen(&self, value: TypeId) -> Option { + pub fn get_object_protection(&self, value: TypeId) -> Option { self.parents_iter().find_map(|ctx| get_on_ctx!(ctx.info.frozen.get(&value))).copied() } @@ -526,9 +527,9 @@ impl Context { // TODO should check the TypeId::is_primitive... via aliases + open_poly pub(crate) fn _is_immutable(&self, _value: TypeId) -> bool { todo!() - // let is_frozen = self.is_frozen(value); + // let get_object_protection = self.get_object_protection(value); - // if is_frozen == Some(TypeId::TRUE) { + // if get_object_protection == Some(TypeId::TRUE) { // true // } else if let Some( // Constant::Boolean(..) diff --git a/checker/src/features/constant_functions.rs b/checker/src/features/constant_functions.rs index 630f5a51..a7b18ccf 100644 --- a/checker/src/features/constant_functions.rs +++ b/checker/src/features/constant_functions.rs @@ -2,7 +2,11 @@ use iterator_endiate::EndiateIteratorExt; use source_map::SpanWithSource; use crate::{ - context::{get_on_ctx, information::InformationChain, invocation::CheckThings}, + context::{ + get_on_ctx, + information::{InformationChain, ObjectProtectionState}, + invocation::CheckThings, + }, events::printing::debug_effects, features::objects::{ObjectBuilder, Proxy}, types::{ @@ -310,7 +314,27 @@ pub(crate) fn call_constant_function( if let Some(on) = (arguments.len() == 1).then(|| arguments[0].non_spread_type().ok()).flatten() { - environment.info.frozen.insert(on); + environment.info.frozen.insert(on, ObjectProtectionState::Frozen); + Ok(ConstantOutput::Value(on)) + } else { + Err(ConstantFunctionError::CannotComputeConstant) + } + } + "seal" => { + if let Some(on) = + (arguments.len() == 1).then(|| arguments[0].non_spread_type().ok()).flatten() + { + environment.info.frozen.insert(on, ObjectProtectionState::Sealed); + Ok(ConstantOutput::Value(on)) + } else { + Err(ConstantFunctionError::CannotComputeConstant) + } + } + "preventExtensions" => { + if let Some(on) = + (arguments.len() == 1).then(|| arguments[0].non_spread_type().ok()).flatten() + { + environment.info.frozen.insert(on, ObjectProtectionState::NoExtensions); Ok(ConstantOutput::Value(on)) } else { Err(ConstantFunctionError::CannotComputeConstant) @@ -320,9 +344,50 @@ pub(crate) fn call_constant_function( if let Some(on) = (arguments.len() == 1).then(|| arguments[0].non_spread_type().ok()).flatten() { - let is_frozen = - environment.get_chain_of_info().any(|info| info.frozen.contains(&on)); - Ok(ConstantOutput::Value(if is_frozen { TypeId::TRUE } else { TypeId::FALSE })) + let object_protection = environment.get_object_protection(on); + let result = if matches!(object_protection, Some(ObjectProtectionState::Frozen)) { + TypeId::TRUE + } else { + // TODO test properties here + TypeId::FALSE + }; + Ok(ConstantOutput::Value(result)) + } else { + Err(ConstantFunctionError::CannotComputeConstant) + } + } + "isSealed" => { + if let Some(on) = + (arguments.len() == 1).then(|| arguments[0].non_spread_type().ok()).flatten() + { + let object_protection = environment.get_object_protection(on); + let result = if matches!( + object_protection, + Some(ObjectProtectionState::Frozen | ObjectProtectionState::Sealed) + ) { + TypeId::TRUE + } else { + // TODO test properties here + TypeId::FALSE + }; + Ok(ConstantOutput::Value(result)) + } else { + Err(ConstantFunctionError::CannotComputeConstant) + } + } + "isExtensible" => { + if let Some(on) = + (arguments.len() == 1).then(|| arguments[0].non_spread_type().ok()).flatten() + { + // Not this method returns an inverse result + let object_protection = environment.get_object_protection(on); + let result = if object_protection.is_some() { + TypeId::FALSE + } else { + TypeId::TRUE + // TODO test properties here + }; + Ok(ConstantOutput::Value(result)) } else { Err(ConstantFunctionError::CannotComputeConstant) } diff --git a/checker/src/types/properties/assignment.rs b/checker/src/types/properties/assignment.rs index c28315a1..31538e68 100644 --- a/checker/src/types/properties/assignment.rs +++ b/checker/src/types/properties/assignment.rs @@ -1,7 +1,7 @@ use super::{get_property_unbound, Descriptor, PropertyKey, PropertyValue, Publicity}; use crate::{ - context::CallCheckingBehavior, + context::{information::ObjectProtectionState, CallCheckingBehavior}, diagnostics::{PropertyKeyRepresentation, TypeStringRepresentation}, events::Event, features::objects::Proxy, @@ -59,8 +59,11 @@ pub fn set_property( types: &mut TypeStore, ) -> SetPropertyResult { // Frozen checks + let object_protection = environment.get_object_protection(on); + { - if environment.info.frozen.contains(&on) { + if let Some(ObjectProtectionState::Frozen) = object_protection { + // FUTURE this could have a separate error? return Err(SetPropertyError::NotWriteable { property: PropertyKeyRepresentation::new(under, environment, types), position, @@ -266,6 +269,17 @@ pub fn set_property( position, }) } else { + // Sealed & no extensions check for NEW property (frozen case covered above) + { + if object_protection.is_some() { + // FUTURE this could have a separate error? + return Err(SetPropertyError::NotWriteable { + property: PropertyKeyRepresentation::new(under, environment, types), + position, + }); + } + } + crate::utilities::notify!("No property on object, assigning anyway"); let info = behavior.get_latest_info(environment); info.register_property( diff --git a/checker/src/types/subtyping.rs b/checker/src/types/subtyping.rs index eb274d06..b1ae45e0 100644 --- a/checker/src/types/subtyping.rs +++ b/checker/src/types/subtyping.rs @@ -764,7 +764,9 @@ pub(crate) fn type_is_subtype_with_generics( information, types, ) - } else if information.get_chain_of_info().any(|info| info.frozen.contains(&ty)) + } else if information + .get_chain_of_info() + .any(|info| info.frozen.contains_key(&ty)) || matches!(subtype, Type::Constant(_)) || matches!( ty, diff --git a/src/js-cli-and-library/package-lock.json b/src/js-cli-and-library/package-lock.json index 30053943..5c68a52a 100644 --- a/src/js-cli-and-library/package-lock.json +++ b/src/js-cli-and-library/package-lock.json @@ -12,7 +12,8 @@ "ezno": "dist/cli.mjs" }, "devDependencies": { - "unbuild": "^2.0.0" + "unbuild": "^2.0.0", + "wasm-pack": "^0.13.0" }, "funding": { "type": "individual", @@ -1023,12 +1024,35 @@ "postcss": "^8.1.0" } }, + "node_modules/axios": { + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", + "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.14.8" + } + }, "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 }, + "node_modules/binary-install": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/binary-install/-/binary-install-1.1.0.tgz", + "integrity": "sha512-rkwNGW+3aQVSZoD0/o3mfPN6Yxh3Id0R/xzTVBVVpGNlVz8EGwusksxRlbk/A5iKTZt9zkMn3qIqmAt3vpfbzg==", + "dev": true, + "dependencies": { + "axios": "^0.26.1", + "rimraf": "^3.0.2", + "tar": "^6.1.11" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", @@ -1144,6 +1168,15 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/citty": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/citty/-/citty-0.1.5.tgz", @@ -1189,6 +1222,12 @@ "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", "dev": true }, + "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 + }, "node_modules/consola": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/consola/-/consola-3.2.3.tgz", @@ -1593,6 +1632,26 @@ "node": ">=8" } }, + "node_modules/follow-redirects": { + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/fraction.js": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", @@ -1620,6 +1679,36 @@ "node": ">=14.14" } }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fs-minipass/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -1986,6 +2075,58 @@ "node": ">=10" } }, + "node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/mkdist": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/mkdist/-/mkdist-1.4.0.tgz", @@ -2103,6 +2244,15 @@ "wrappy": "1" } }, + "node_modules/path-is-absolute": { + "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" + } + }, "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", @@ -2685,6 +2835,65 @@ "node": ">=0.10.0" } }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/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==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/minimatch": { + "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" + }, + "engines": { + "node": "*" + } + }, "node_modules/rollup": { "version": "3.29.4", "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz", @@ -2847,6 +3056,29 @@ "url": "https://opencollective.com/svgo" } }, + "node_modules/tar": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "dev": true, + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -2994,6 +3226,19 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, + "node_modules/wasm-pack": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/wasm-pack/-/wasm-pack-0.13.0.tgz", + "integrity": "sha512-AmboGZEnZoIcVCzSlkLEmNFEqJN+IwgshJ5S7pi30uNUTce4LvWkifQzsQRxnWj47G8gkqZxlyGlyQplsnIS7w==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "binary-install": "^1.0.1" + }, + "bin": { + "wasm-pack": "run.js" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/src/js-cli-and-library/package.json b/src/js-cli-and-library/package.json index 7bf1426a..7a6f1067 100644 --- a/src/js-cli-and-library/package.json +++ b/src/js-cli-and-library/package.json @@ -74,6 +74,7 @@ } }, "devDependencies": { - "unbuild": "^2.0.0" + "unbuild": "^2.0.0", + "wasm-pack": "^0.13.0" } }