diff --git a/CHANGELOG b/CHANGELOG
index 47cbdd7..15424b8 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -5,6 +5,7 @@
## 2025-01-20 - 1.0.0-alpha.2
- fix: disable SIMD in generated transform code by default
+- fix: re-add as-bs dependency so that it will not break in non-local environments
## 2025-01-20 - 1.0.0-alpha.1
diff --git a/assembly/__benches__/misc.bench.ts b/assembly/__benches__/misc.bench.ts
index 3421d15..c2668d9 100644
--- a/assembly/__benches__/misc.bench.ts
+++ b/assembly/__benches__/misc.bench.ts
@@ -1,5 +1,5 @@
import { bench } from "as-bench/assembly/bench";
-import { bs } from "../../modules/bs";
+import { bs } from "as-bs";
import { deserializeString_SIMD } from "../deserialize/simd/string";
import { deserializeString } from "../deserialize/simple/string";
import { bytes } from "../util/bytes";
diff --git a/assembly/index.ts b/assembly/index.ts
index ae0887e..a66725b 100644
--- a/assembly/index.ts
+++ b/assembly/index.ts
@@ -1,5 +1,5 @@
///
-import { bs } from "../modules/bs";
+import { bs } from "as-bs";
import { serializeString } from "./serialize/simple/string";
import { serializeArray } from "./serialize/simple/array";
@@ -23,7 +23,6 @@ import { serializeFloat } from "./serialize/simple/float";
import { serializeObject } from "./serialize/simple/object";
import { ptrToStr } from "./util/ptrToStr";
import { bytes } from "./util";
-import { serializeString_SIMD } from "./serialize/simd/string";
export type Raw = string;
@@ -340,7 +339,7 @@ export namespace JSON {
* Box for primitive types
*/
export class Box {
- constructor(public value: T) {}
+ constructor(public value: T) { }
/**
* Creates a reference to a primitive type
* This means that it can create a nullable primitive
@@ -375,11 +374,7 @@ export namespace JSON {
store(bs.offset, 30399761348886638);
bs.offset += 8;
} else if (isString>()) {
- if (ASC_FEATURE_SIMD) {
- serializeString_SIMD(src as string);
- } else {
- serializeString(src as string);
- }
+ serializeString(src as string);
// @ts-ignore: Supplied by transform
} else if (isDefined(src.__SERIALIZE)) {
// @ts-ignore
diff --git a/assembly/serialize/simd/string.ts b/assembly/serialize/simd/string.ts
index 905e47a..3c5e021 100644
--- a/assembly/serialize/simd/string.ts
+++ b/assembly/serialize/simd/string.ts
@@ -1,4 +1,4 @@
-import { bs } from "../../../modules/bs";
+import { bs } from "as-bs";
import { BACK_SLASH } from "../../custom/chars";
import { SERIALIZE_ESCAPE_TABLE } from "../../globals/tables";
import { OBJECT, TOTAL_OVERHEAD } from "rt/common";
diff --git a/assembly/serialize/simple/array.ts b/assembly/serialize/simple/array.ts
index f4c30f5..2e25edd 100644
--- a/assembly/serialize/simple/array.ts
+++ b/assembly/serialize/simple/array.ts
@@ -1,4 +1,4 @@
-import { bs } from "../../../modules/bs";
+import { bs } from "as-bs";
import { COMMA, BRACKET_RIGHT, BRACKET_LEFT } from "../../custom/chars";
import { JSON } from "../..";
diff --git a/assembly/serialize/simple/bool.ts b/assembly/serialize/simple/bool.ts
index 61c969d..633eba5 100644
--- a/assembly/serialize/simple/bool.ts
+++ b/assembly/serialize/simple/bool.ts
@@ -1,4 +1,4 @@
-import { bs } from "../../../modules/bs";
+import { bs } from "as-bs";
/**
* Serialize a bool to type string
diff --git a/assembly/serialize/simple/date.ts b/assembly/serialize/simple/date.ts
index a8a9914..91be907 100644
--- a/assembly/serialize/simple/date.ts
+++ b/assembly/serialize/simple/date.ts
@@ -1,4 +1,4 @@
-import { bs } from "../../../modules/bs";
+import { bs } from "as-bs";
import { QUOTE } from "../../custom/chars";
import { bytes } from "../../util/bytes";
diff --git a/assembly/serialize/simple/float.ts b/assembly/serialize/simple/float.ts
index 9db35e8..054b7bc 100644
--- a/assembly/serialize/simple/float.ts
+++ b/assembly/serialize/simple/float.ts
@@ -1,5 +1,5 @@
import { dtoa_buffered } from "util/number";
-import { bs } from "../../../modules/bs";
+import { bs } from "as-bs";
export function serializeFloat(data: T): void {
bs.ensureSize(64);
diff --git a/assembly/serialize/simple/integer.ts b/assembly/serialize/simple/integer.ts
index ee36178..47b4b3c 100644
--- a/assembly/serialize/simple/integer.ts
+++ b/assembly/serialize/simple/integer.ts
@@ -1,5 +1,5 @@
import { itoa_buffered } from "util/number";
-import { bs } from "../../../modules/bs";
+import { bs } from "as-bs";
export function serializeInteger(data: T): void {
bs.ensureSize(sizeof() << 3);
diff --git a/assembly/serialize/simple/map.ts b/assembly/serialize/simple/map.ts
index 7e6ab21..c76619c 100644
--- a/assembly/serialize/simple/map.ts
+++ b/assembly/serialize/simple/map.ts
@@ -1,6 +1,6 @@
import { JSON } from "../..";
import { BRACE_LEFT, BRACE_RIGHT, COLON, COMMA } from "../../custom/chars";
-import { bs } from "../../../modules/bs";
+import { bs } from "as-bs";
export function serializeMap>(src: T): void {
const srcSize = src.size;
diff --git a/assembly/serialize/simple/string.ts b/assembly/serialize/simple/string.ts
index 8c03fed..3b5e99e 100644
--- a/assembly/serialize/simple/string.ts
+++ b/assembly/serialize/simple/string.ts
@@ -1,6 +1,6 @@
import { _intTo16 } from "../../custom/util";
import { bytes } from "../../util/bytes";
-import { bs } from "../../../modules/bs";
+import { bs } from "as-bs";
import { BACK_SLASH, QUOTE } from "../../custom/chars";
import { SERIALIZE_ESCAPE_TABLE } from "../../globals/tables";
diff --git a/assembly/test.ts b/assembly/test.ts
index b85b0a1..d79b7cc 100644
--- a/assembly/test.ts
+++ b/assembly/test.ts
@@ -10,14 +10,14 @@ class Vec3 {
@json
class Player {
- // @alias("first name")
+ @alias("first name")
firstName!: string;
lastName!: string;
lastActive!: i32[];
// Drop in a code block, function, or expression that evaluates to a boolean
@omitif((self: Player): boolean => self.age < 18)
age!: i32;
- // @omitnull()
+ @omitnull()
pos!: Vec3 | null;
isVerified!: boolean;
@inline __INITIALIZE(): this {
diff --git a/modules/bs/index.ts b/modules/bs/index.ts
deleted file mode 100644
index 8bb88a3..0000000
--- a/modules/bs/index.ts
+++ /dev/null
@@ -1,167 +0,0 @@
-import { OBJECT, TOTAL_OVERHEAD } from "rt/common";
-
-let maxOffset: usize = __new(0, idof());
-
-/**
- * Central buffer namespace for managing memory operations.
- */
-export namespace bs {
- /** Current buffer pointer. */
- export let buffer: usize = maxOffset;
-
- /** Current offset within the buffer. */
- export let offset: usize = maxOffset;
-
- /** Byte length of the buffer. */
- export let byteLength: usize = 0;
-
- /**
- * Sets the buffer to a given data object and initializes related properties.
- * @param data - The data object to set as the buffer.
- */
- // @ts-ignore: Decorator valid here
- @inline export function setBuffer(data: T, byteLength: usize = bytes(data)): void {
- buffer = changetype(data);
- offset = changetype(data);
- byteLength = byteLength;
- maxOffset = byteLength + buffer;
- }
-
- /**
- * Ensures the buffer has sufficient capacity for a given size.
- * If necessary, reallocates the buffer to accommodate the new size.
- * @param size - The size to ensure capacity for.
- */
- // @ts-ignore: Decorator valid here
- @inline export function ensureCapacity(size: u32): void {
- const newSize = offset + size;
- if (newSize > maxOffset) {
- const newPtr = __renew(buffer, (byteLength = nextPowerOf2(newSize - buffer)));
- offset = offset - buffer + newPtr;
- maxOffset = newPtr + byteLength;
- buffer = newPtr;
- }
- }
-
- /**
- * Ensures the buffer size is sufficient for a given size.
- * If necessary, reallocates the buffer to the exact new size.
- * @param size - The size to ensure.
- */
- // @ts-ignore: Decorator valid here
- @inline export function ensureSize(size: u32): void {
- const newSize = offset + size;
- if (newSize > maxOffset) {
- const newPtr = __renew(buffer, (byteLength = newSize - buffer));
- offset = offset - buffer + newPtr;
- maxOffset = newPtr + byteLength;
- buffer = newPtr;
- }
- }
-
- /**
- * Resizes the buffer to the specified size.
- * @param newSize - The new buffer size.
- */
- // @ts-ignore: Decorator valid here
- @inline export function resize(newSize: u32): void {
- const newPtr = __renew(buffer, newSize);
- byteLength = newSize;
- buffer = newPtr;
- offset = buffer + newSize;
- maxOffset = buffer + byteLength;
- }
-
- /**
- * Gets the remaining space available in the buffer.
- * @returns The number of bytes remaining.
- */
- // @ts-ignore: Decorator valid here
- @inline export function getRemainingSize(): usize {
- return maxOffset - offset;
- }
-
- /**
- * Clears data from a specified offset onward.
- * @param fromOffset - The starting offset to clear from.
- */
- // @ts-ignore: Decorator valid here
- @inline export function clearFromOffset(fromOffset: usize): void {
- if (fromOffset < offset) {
- memory.fill(fromOffset, 0, offset - fromOffset);
- offset = fromOffset;
- }
- }
-
- /**
- * Shrinks the buffer to fit the current offset.
- */
- // @ts-ignore: Decorator valid here
- @inline export function shrink(): void {
- if (offset > maxOffset) {
- byteLength = offset - buffer;
- buffer = __renew(buffer, byteLength);
- maxOffset = byteLength + buffer;
- }
- }
-
- /**
- * Shrinks the buffer and resets the offset, returning the buffer as a specified type.
- * @returns The buffer cast to the specified type.
- */
- // @ts-ignore: Decorator valid here
- @inline export function shrinkTo(): T {
- shrink();
- offset = buffer;
- return changetype(buffer);
- }
-
- /**
- * Copies the buffer's content to a new object of a specified type.
- * Optionally shrinks the buffer after copying.
- * @param s - Whether to shrink the buffer after copying.
- * @returns The new object containing the buffer's content.
- */
- // @ts-ignore: Decorator valid here
- @inline export function out(s: bool = false): T {
- const len = offset - buffer;
- const _out = __new(len, idof());
- memory.copy(_out, buffer, len);
- if (s) shrink();
- offset = buffer;
- return changetype(_out);
- }
-
- /**
- * Copies the buffer's content to a given destination pointer.
- * Optionally shrinks the buffer after copying.
- * @param dst - The destination pointer.
- * @param s - Whether to shrink the buffer after copying.
- * @returns The destination pointer cast to the specified type.
- */
- // @ts-ignore: Decorator valid here
- @inline export function outTo(dst: usize, s: bool = false): T {
- const len = offset - buffer;
- if (len != changetype