diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 62492c0..0000000 --- a/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -node_modules -dist -.eslintrc.js -rollup.config.js -examples \ No newline at end of file diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index ae08bf0..dce2896 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -20,8 +20,8 @@ jobs: - name: Checkout Code Repository uses: actions/checkout@v2 - - uses: pnpm/action-setup@v4 - name: Install pnpm + - name: Install pnpm + uses: pnpm/action-setup@v4 with: run_install: false @@ -31,5 +31,7 @@ jobs: node-version: ${{ matrix.node-version }} cache: 'pnpm' - - run: pnpm i --frozen-lockfile - - run: pnpm biome check . && pnpm test && pnpm build + - name: Install dependencies + run: pnpm install --recursive --frozen-lockfile + + - run: pnpm check && pnpm test && pnpm build diff --git a/examples/__util/index.ts b/apps/examples/__util/index.ts similarity index 100% rename from examples/__util/index.ts rename to apps/examples/__util/index.ts diff --git a/examples/binaryMesh/.gitignore b/apps/examples/binaryMesh/.gitignore similarity index 100% rename from examples/binaryMesh/.gitignore rename to apps/examples/binaryMesh/.gitignore diff --git a/examples/binaryMesh/index.ts b/apps/examples/binaryMesh/index.ts similarity index 100% rename from examples/binaryMesh/index.ts rename to apps/examples/binaryMesh/index.ts diff --git a/examples/binaryMesh/schemas.ts b/apps/examples/binaryMesh/schemas.ts similarity index 100% rename from examples/binaryMesh/schemas.ts rename to apps/examples/binaryMesh/schemas.ts diff --git a/examples/customSchema/index.ts b/apps/examples/customSchema/index.ts similarity index 100% rename from examples/customSchema/index.ts rename to apps/examples/customSchema/index.ts diff --git a/examples/customSchema/radians.ts b/apps/examples/customSchema/radians.ts similarity index 100% rename from examples/customSchema/radians.ts rename to apps/examples/customSchema/radians.ts diff --git a/examples/dog/index.ts b/apps/examples/dog/index.ts similarity index 100% rename from examples/dog/index.ts rename to apps/examples/dog/index.ts diff --git a/examples/genericEnumTypes/index.ts b/apps/examples/genericEnumTypes/index.ts similarity index 100% rename from examples/genericEnumTypes/index.ts rename to apps/examples/genericEnumTypes/index.ts diff --git a/examples/genericTypes/index.ts b/apps/examples/genericTypes/index.ts similarity index 100% rename from examples/genericTypes/index.ts rename to apps/examples/genericTypes/index.ts diff --git a/examples/inferredShowcase/index.ts b/apps/examples/inferredShowcase/index.ts similarity index 100% rename from examples/inferredShowcase/index.ts rename to apps/examples/inferredShowcase/index.ts diff --git a/examples/package.json b/apps/examples/package.json similarity index 76% rename from examples/package.json rename to apps/examples/package.json index a94d407..ddec30c 100644 --- a/examples/package.json +++ b/apps/examples/package.json @@ -1,7 +1,6 @@ { - "name": "typed-binary-examples", + "name": "@typed-binary/examples", "scripts": { - "prepare": "cd .. && pnpm run build && cd examples/ && pnpm link ../", "example:binaryMesh": "tsx binaryMesh/index.ts", "example:customSchema": "tsx customSchema/index.ts", "example:dog": "tsx dog/index.ts", @@ -11,8 +10,11 @@ "example:recursiveTypes": "tsx recursiveTypes/index.ts", "example:stateMachine": "tsx stateMachine/index.ts" }, + "dependencies": { + "typed-binary": "workspace:*" + }, "devDependencies": { - "tsx": "^4.7.1", - "typescript": "^5.3.3" + "tsx": "^4.16.2", + "typescript": "^5.5.2" } } diff --git a/examples/pnpm-lock.yaml b/apps/examples/pnpm-lock.yaml similarity index 100% rename from examples/pnpm-lock.yaml rename to apps/examples/pnpm-lock.yaml diff --git a/examples/recursiveTypes/index.ts b/apps/examples/recursiveTypes/index.ts similarity index 100% rename from examples/recursiveTypes/index.ts rename to apps/examples/recursiveTypes/index.ts diff --git a/examples/stateMachine/connection.ts b/apps/examples/stateMachine/connection.ts similarity index 100% rename from examples/stateMachine/connection.ts rename to apps/examples/stateMachine/connection.ts diff --git a/examples/stateMachine/graph.ts b/apps/examples/stateMachine/graph.ts similarity index 100% rename from examples/stateMachine/graph.ts rename to apps/examples/stateMachine/graph.ts diff --git a/examples/stateMachine/index.ts b/apps/examples/stateMachine/index.ts similarity index 100% rename from examples/stateMachine/index.ts rename to apps/examples/stateMachine/index.ts diff --git a/examples/stateMachine/node.ts b/apps/examples/stateMachine/node.ts similarity index 100% rename from examples/stateMachine/node.ts rename to apps/examples/stateMachine/node.ts diff --git a/examples/stateMachine/triggerCondition.ts b/apps/examples/stateMachine/triggerCondition.ts similarity index 100% rename from examples/stateMachine/triggerCondition.ts rename to apps/examples/stateMachine/triggerCondition.ts diff --git a/apps/examples/tsconfig.json b/apps/examples/tsconfig.json new file mode 100644 index 0000000..9536a0f --- /dev/null +++ b/apps/examples/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.base.json" +} diff --git a/biome.json b/biome.json index 71125fd..7d4d3c8 100644 --- a/biome.json +++ b/biome.json @@ -4,7 +4,12 @@ "enabled": true }, "files": { - "ignore": ["node_modules", "dist", "rollup.config.js", "tsconfig.test.json"] + "ignore": [ + "node_modules", + "dist", + "tsconfig.test.json", + "tsconfig.base.json" + ] }, "linter": { "enabled": true, diff --git a/examples/tsconfig.json b/examples/tsconfig.json deleted file mode 100644 index d79d11f..0000000 --- a/examples/tsconfig.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ - - /* Projects */ - // "incremental": true, /* Enable incremental compilation */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - - /* Language and Environment */ - "target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, - // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ - // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */ - // "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - - /* Modules */ - "module": "commonjs" /* Specify what module code is generated. */, - // "rootDir": "./", /* Specify the root folder within your source files. */ - // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "resolveJsonModule": true, /* Enable importing .json files */ - // "noResolve": true, /* Disallow `import`s, `require`s or ``s from expanding the number of files TypeScript should add to a project. */ - - /* JavaScript Support */ - // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */ - // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */ - - /* Emit */ - // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ - // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */ - // "outDir": "./", /* Specify an output folder for all emitted files. */ - // "removeComments": true, /* Disable emitting comments. */ - // "noEmit": true, /* Disable emitting files from a compilation. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */ - // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ - // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */ - // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ - // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ - - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */, - // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, - - /* Type Checking */ - "strict": true /* Enable all strict type-checking options. */, - // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */ - // "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */ - // "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ - } -} diff --git a/package.json b/package.json index 669db5b..78e2f5d 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,15 @@ { - "name": "typed-binary", - "version": "4.0.1", + "name": "typed-binary-monorepo", + "version": "0.0.0", "description": "Describe binary structures with full TypeScript support. Encode and decode into pure JavaScript objects.", + "private": true, "packageManager": "pnpm@8.15.8+sha256.691fe176eea9a8a80df20e4976f3dfb44a04841ceb885638fe2a26174f81e65e", - "type": "module", - "main": "./dist/index.js", - "types": "./index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "types": "./dist/index.d.ts", - "module": "./dist/index.js", - "import": "./dist/index.js", - "default": "./dist/index.cjs" - }, - "./*": { - "types": "./*.d.ts", - "module": "./dist/*.js", - "import": "./dist/*.js", - "default": "./dist/*.cjs" - } - }, "scripts": { - "check": "biome check --write .", - "dev": "tsup --watch", - "build": "tsup", - "prepublishOnly": "pnpm check && pnpm build", - "dryPublish": "pnpm publish --dry-run", + "check": "biome check .", + "fix": "biome check --write .", "test": "vitest run", + "build": "pnpm -r build", + "dev": "pnpm -r dev", "dev:test": "vitest", "ts-version": "tsc -v" }, @@ -54,7 +36,6 @@ "deserialization", "deserialize" ], - "files": ["README.md", "LICENSE", "dist"], "author": "Iwo Plaza ", "license": "MIT", "devDependencies": { @@ -63,16 +44,10 @@ "cypress": "^13.13.1", "socket.io": "^4.7.5", "socket.io-client": "^4.7.5", - "tsup": "^8.2.0", "typescript": "^5.5.2", + "tsx": "^4.16.2", + "tsup": "8.1.0", "vitest": "^1.6.0", "typed-binary": "workspace:*" - }, - "repository": { - "type": "git", - "url": "https://github.com/iwoplaza/typed-binary.git" - }, - "bugs": { - "url": "https://github.com/iwoplaza/typed-binary/issues" } } diff --git a/packages/typed-binary/package.json b/packages/typed-binary/package.json new file mode 100644 index 0000000..92ed6bb --- /dev/null +++ b/packages/typed-binary/package.json @@ -0,0 +1,70 @@ +{ + "name": "typed-binary", + "version": "4.0.1", + "description": "Describe binary structures with full TypeScript support. Encode and decode into pure JavaScript objects.", + "packageManager": "pnpm@8.15.8+sha256.691fe176eea9a8a80df20e4976f3dfb44a04841ceb885638fe2a26174f81e65e", + "type": "module", + "main": "./dist/index.js", + "types": "./index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "types": "./dist/index.d.ts", + "module": "./dist/index.js", + "import": "./dist/index.js", + "default": "./dist/index.cjs" + }, + "./*": { + "types": "./*.d.ts", + "module": "./dist/*.js", + "import": "./dist/*.js", + "default": "./dist/*.cjs" + } + }, + "scripts": { + "dev": "tsup --watch", + "build": "tsup", + "prepublishOnly": "pnpm -w run check && pnpm -w run build", + "dryPublish": "pnpm publish --dry-run" + }, + "keywords": [ + "typescript", + "type", + "types", + "typed", + "binary", + "bin", + "data", + "structure", + "schema", + "backend", + "front-end", + "json", + "arraybuffer", + "buffer", + "encoding", + "decoding", + "serial", + "serialize", + "serialization", + "deserialization", + "deserialize" + ], + "files": ["README.md", "LICENSE", "dist"], + "author": "Iwo Plaza ", + "license": "MIT", + "devDependencies": { + "@types/node": "^20.14.11", + "socket.io": "^4.7.5", + "socket.io-client": "^4.7.5", + "tsup": "8.1.0", + "typescript": "^5.5.2" + }, + "repository": { + "type": "git", + "url": "https://github.com/iwoplaza/typed-binary.git" + }, + "bugs": { + "url": "https://github.com/iwoplaza/typed-binary/issues" + } +} diff --git a/src/describe/index.ts b/packages/typed-binary/src/describe/index.ts similarity index 100% rename from src/describe/index.ts rename to packages/typed-binary/src/describe/index.ts diff --git a/src/error.ts b/packages/typed-binary/src/error.ts similarity index 100% rename from src/error.ts rename to packages/typed-binary/src/error.ts diff --git a/src/index.ts b/packages/typed-binary/src/index.ts similarity index 100% rename from src/index.ts rename to packages/typed-binary/src/index.ts diff --git a/src/io/bufferIOBase.ts b/packages/typed-binary/src/io/bufferIOBase.ts similarity index 100% rename from src/io/bufferIOBase.ts rename to packages/typed-binary/src/io/bufferIOBase.ts diff --git a/src/io/bufferReader.ts b/packages/typed-binary/src/io/bufferReader.ts similarity index 100% rename from src/io/bufferReader.ts rename to packages/typed-binary/src/io/bufferReader.ts diff --git a/src/io/bufferReaderWriter.test.ts b/packages/typed-binary/src/io/bufferReaderWriter.test.ts similarity index 100% rename from src/io/bufferReaderWriter.test.ts rename to packages/typed-binary/src/io/bufferReaderWriter.test.ts diff --git a/src/io/bufferWriter.ts b/packages/typed-binary/src/io/bufferWriter.ts similarity index 100% rename from src/io/bufferWriter.ts rename to packages/typed-binary/src/io/bufferWriter.ts diff --git a/src/io/index.ts b/packages/typed-binary/src/io/index.ts similarity index 100% rename from src/io/index.ts rename to packages/typed-binary/src/io/index.ts diff --git a/src/io/measurer.ts b/packages/typed-binary/src/io/measurer.ts similarity index 100% rename from src/io/measurer.ts rename to packages/typed-binary/src/io/measurer.ts diff --git a/src/io/types.ts b/packages/typed-binary/src/io/types.ts similarity index 100% rename from src/io/types.ts rename to packages/typed-binary/src/io/types.ts diff --git a/src/structure/_internal.ts b/packages/typed-binary/src/structure/_internal.ts similarity index 100% rename from src/structure/_internal.ts rename to packages/typed-binary/src/structure/_internal.ts diff --git a/src/structure/array.ts b/packages/typed-binary/src/structure/array.ts similarity index 100% rename from src/structure/array.ts rename to packages/typed-binary/src/structure/array.ts diff --git a/src/structure/baseTypes.ts b/packages/typed-binary/src/structure/baseTypes.ts similarity index 100% rename from src/structure/baseTypes.ts rename to packages/typed-binary/src/structure/baseTypes.ts diff --git a/src/structure/chars.ts b/packages/typed-binary/src/structure/chars.ts similarity index 100% rename from src/structure/chars.ts rename to packages/typed-binary/src/structure/chars.ts diff --git a/src/structure/dynamicArray.ts b/packages/typed-binary/src/structure/dynamicArray.ts similarity index 100% rename from src/structure/dynamicArray.ts rename to packages/typed-binary/src/structure/dynamicArray.ts diff --git a/src/structure/index.ts b/packages/typed-binary/src/structure/index.ts similarity index 100% rename from src/structure/index.ts rename to packages/typed-binary/src/structure/index.ts diff --git a/src/structure/keyed.ts b/packages/typed-binary/src/structure/keyed.ts similarity index 100% rename from src/structure/keyed.ts rename to packages/typed-binary/src/structure/keyed.ts diff --git a/src/structure/object.ts b/packages/typed-binary/src/structure/object.ts similarity index 100% rename from src/structure/object.ts rename to packages/typed-binary/src/structure/object.ts diff --git a/src/structure/optional.ts b/packages/typed-binary/src/structure/optional.ts similarity index 100% rename from src/structure/optional.ts rename to packages/typed-binary/src/structure/optional.ts diff --git a/src/structure/tuple.ts b/packages/typed-binary/src/structure/tuple.ts similarity index 100% rename from src/structure/tuple.ts rename to packages/typed-binary/src/structure/tuple.ts diff --git a/src/structure/types.ts b/packages/typed-binary/src/structure/types.ts similarity index 100% rename from src/structure/types.ts rename to packages/typed-binary/src/structure/types.ts diff --git a/src/test/bool.test.ts b/packages/typed-binary/src/test/bool.test.ts similarity index 100% rename from src/test/bool.test.ts rename to packages/typed-binary/src/test/bool.test.ts diff --git a/src/test/byte.test.ts b/packages/typed-binary/src/test/byte.test.ts similarity index 100% rename from src/test/byte.test.ts rename to packages/typed-binary/src/test/byte.test.ts diff --git a/src/test/chars.test.ts b/packages/typed-binary/src/test/chars.test.ts similarity index 100% rename from src/test/chars.test.ts rename to packages/typed-binary/src/test/chars.test.ts diff --git a/src/test/dynamicArray.test.ts b/packages/typed-binary/src/test/dynamicArray.test.ts similarity index 100% rename from src/test/dynamicArray.test.ts rename to packages/typed-binary/src/test/dynamicArray.test.ts diff --git a/src/test/float.test.ts b/packages/typed-binary/src/test/float.test.ts similarity index 100% rename from src/test/float.test.ts rename to packages/typed-binary/src/test/float.test.ts diff --git a/src/test/helpers/mock.ts b/packages/typed-binary/src/test/helpers/mock.ts similarity index 100% rename from src/test/helpers/mock.ts rename to packages/typed-binary/src/test/helpers/mock.ts diff --git a/src/test/int.test.ts b/packages/typed-binary/src/test/int.test.ts similarity index 100% rename from src/test/int.test.ts rename to packages/typed-binary/src/test/int.test.ts diff --git a/src/test/keyed.test.ts b/packages/typed-binary/src/test/keyed.test.ts similarity index 100% rename from src/test/keyed.test.ts rename to packages/typed-binary/src/test/keyed.test.ts diff --git a/src/test/object.test.ts b/packages/typed-binary/src/test/object.test.ts similarity index 100% rename from src/test/object.test.ts rename to packages/typed-binary/src/test/object.test.ts diff --git a/src/test/optional.test.ts b/packages/typed-binary/src/test/optional.test.ts similarity index 100% rename from src/test/optional.test.ts rename to packages/typed-binary/src/test/optional.test.ts diff --git a/src/test/parsed.test.ts b/packages/typed-binary/src/test/parsed.test.ts similarity index 100% rename from src/test/parsed.test.ts rename to packages/typed-binary/src/test/parsed.test.ts diff --git a/src/test/random.ts b/packages/typed-binary/src/test/random.ts similarity index 100% rename from src/test/random.ts rename to packages/typed-binary/src/test/random.ts diff --git a/src/test/socket-io-usage.test.ts b/packages/typed-binary/src/test/socket-io-usage.test.ts similarity index 100% rename from src/test/socket-io-usage.test.ts rename to packages/typed-binary/src/test/socket-io-usage.test.ts diff --git a/src/test/string.test.ts b/packages/typed-binary/src/test/string.test.ts similarity index 100% rename from src/test/string.test.ts rename to packages/typed-binary/src/test/string.test.ts diff --git a/src/test/tuple.test.ts b/packages/typed-binary/src/test/tuple.test.ts similarity index 100% rename from src/test/tuple.test.ts rename to packages/typed-binary/src/test/tuple.test.ts diff --git a/src/test/unwrap.test.ts b/packages/typed-binary/src/test/unwrap.test.ts similarity index 100% rename from src/test/unwrap.test.ts rename to packages/typed-binary/src/test/unwrap.test.ts diff --git a/src/util.ts b/packages/typed-binary/src/util.ts similarity index 100% rename from src/util.ts rename to packages/typed-binary/src/util.ts diff --git a/src/utilityTypes.test.ts b/packages/typed-binary/src/utilityTypes.test.ts similarity index 100% rename from src/utilityTypes.test.ts rename to packages/typed-binary/src/utilityTypes.test.ts diff --git a/src/utilityTypes.ts b/packages/typed-binary/src/utilityTypes.ts similarity index 100% rename from src/utilityTypes.ts rename to packages/typed-binary/src/utilityTypes.ts diff --git a/packages/typed-binary/tsconfig.json b/packages/typed-binary/tsconfig.json new file mode 100644 index 0000000..9536a0f --- /dev/null +++ b/packages/typed-binary/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.base.json" +} diff --git a/tsconfig.test.json b/packages/typed-binary/tsconfig.test.json similarity index 100% rename from tsconfig.test.json rename to packages/typed-binary/tsconfig.test.json diff --git a/tsup.config.ts b/packages/typed-binary/tsup.config.ts similarity index 100% rename from tsup.config.ts rename to packages/typed-binary/tsup.config.ts diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 43627ee..fc46b41 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,11 +24,14 @@ importers: specifier: ^4.7.5 version: 4.7.5 tsup: - specifier: ^8.2.0 - version: 8.2.0(typescript@5.5.3) + specifier: 8.1.0 + version: 8.1.0(typescript@5.5.3) + tsx: + specifier: ^4.16.2 + version: 4.16.2 typed-binary: specifier: workspace:* - version: 'link:' + version: link:packages/typed-binary typescript: specifier: ^5.5.2 version: 5.5.3 @@ -36,6 +39,37 @@ importers: specifier: ^1.6.0 version: 1.6.0(@types/node@20.14.11) + apps/examples: + dependencies: + typed-binary: + specifier: workspace:* + version: link:../../packages/typed-binary + devDependencies: + tsx: + specifier: ^4.16.2 + version: 4.16.2 + typescript: + specifier: ^5.5.2 + version: 5.5.3 + + packages/typed-binary: + devDependencies: + '@types/node': + specifier: ^20.14.11 + version: 20.14.11 + socket.io: + specifier: ^4.7.5 + version: 4.7.5 + socket.io-client: + specifier: ^4.7.5 + version: 4.7.5 + tsup: + specifier: 8.1.0 + version: 8.1.0(typescript@5.5.3) + typescript: + specifier: ^5.5.2 + version: 5.5.3 + packages: /@biomejs/biome@1.8.3: @@ -175,15 +209,6 @@ packages: dev: true optional: true - /@esbuild/aix-ppc64@0.23.0: - resolution: {integrity: sha512-3sG8Zwa5fMcA9bgqB8AfWPQ+HFke6uD3h1s3RIwUNK8EG7a4buxvuFTs3j1IMs2NXAk9F30C/FF4vxRgQCcmoQ==} - engines: {node: '>=18'} - cpu: [ppc64] - os: [aix] - requiresBuild: true - dev: true - optional: true - /@esbuild/android-arm64@0.21.5: resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==} engines: {node: '>=12'} @@ -193,15 +218,6 @@ packages: dev: true optional: true - /@esbuild/android-arm64@0.23.0: - resolution: {integrity: sha512-EuHFUYkAVfU4qBdyivULuu03FhJO4IJN9PGuABGrFy4vUuzk91P2d+npxHcFdpUnfYKy0PuV+n6bKIpHOB3prQ==} - engines: {node: '>=18'} - cpu: [arm64] - os: [android] - requiresBuild: true - dev: true - optional: true - /@esbuild/android-arm@0.21.5: resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==} engines: {node: '>=12'} @@ -211,15 +227,6 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.23.0: - resolution: {integrity: sha512-+KuOHTKKyIKgEEqKbGTK8W7mPp+hKinbMBeEnNzjJGyFcWsfrXjSTNluJHCY1RqhxFurdD8uNXQDei7qDlR6+g==} - engines: {node: '>=18'} - cpu: [arm] - os: [android] - requiresBuild: true - dev: true - optional: true - /@esbuild/android-x64@0.21.5: resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==} engines: {node: '>=12'} @@ -229,15 +236,6 @@ packages: dev: true optional: true - /@esbuild/android-x64@0.23.0: - resolution: {integrity: sha512-WRrmKidLoKDl56LsbBMhzTTBxrsVwTKdNbKDalbEZr0tcsBgCLbEtoNthOW6PX942YiYq8HzEnb4yWQMLQuipQ==} - engines: {node: '>=18'} - cpu: [x64] - os: [android] - requiresBuild: true - dev: true - optional: true - /@esbuild/darwin-arm64@0.21.5: resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==} engines: {node: '>=12'} @@ -247,15 +245,6 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64@0.23.0: - resolution: {integrity: sha512-YLntie/IdS31H54Ogdn+v50NuoWF5BDkEUFpiOChVa9UnKpftgwzZRrI4J132ETIi+D8n6xh9IviFV3eXdxfow==} - engines: {node: '>=18'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /@esbuild/darwin-x64@0.21.5: resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==} engines: {node: '>=12'} @@ -265,15 +254,6 @@ packages: dev: true optional: true - /@esbuild/darwin-x64@0.23.0: - resolution: {integrity: sha512-IMQ6eme4AfznElesHUPDZ+teuGwoRmVuuixu7sv92ZkdQcPbsNHzutd+rAfaBKo8YK3IrBEi9SLLKWJdEvJniQ==} - engines: {node: '>=18'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /@esbuild/freebsd-arm64@0.21.5: resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==} engines: {node: '>=12'} @@ -283,15 +263,6 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64@0.23.0: - resolution: {integrity: sha512-0muYWCng5vqaxobq6LB3YNtevDFSAZGlgtLoAc81PjUfiFz36n4KMpwhtAd4he8ToSI3TGyuhyx5xmiWNYZFyw==} - engines: {node: '>=18'} - cpu: [arm64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/freebsd-x64@0.21.5: resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==} engines: {node: '>=12'} @@ -301,15 +272,6 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64@0.23.0: - resolution: {integrity: sha512-XKDVu8IsD0/q3foBzsXGt/KjD/yTKBCIwOHE1XwiXmrRwrX6Hbnd5Eqn/WvDekddK21tfszBSrE/WMaZh+1buQ==} - engines: {node: '>=18'} - cpu: [x64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-arm64@0.21.5: resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==} engines: {node: '>=12'} @@ -319,15 +281,6 @@ packages: dev: true optional: true - /@esbuild/linux-arm64@0.23.0: - resolution: {integrity: sha512-j1t5iG8jE7BhonbsEg5d9qOYcVZv/Rv6tghaXM/Ug9xahM0nX/H2gfu6X6z11QRTMT6+aywOMA8TDkhPo8aCGw==} - engines: {node: '>=18'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-arm@0.21.5: resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} engines: {node: '>=12'} @@ -337,15 +290,6 @@ packages: dev: true optional: true - /@esbuild/linux-arm@0.23.0: - resolution: {integrity: sha512-SEELSTEtOFu5LPykzA395Mc+54RMg1EUgXP+iw2SJ72+ooMwVsgfuwXo5Fn0wXNgWZsTVHwY2cg4Vi/bOD88qw==} - engines: {node: '>=18'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-ia32@0.21.5: resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==} engines: {node: '>=12'} @@ -355,15 +299,6 @@ packages: dev: true optional: true - /@esbuild/linux-ia32@0.23.0: - resolution: {integrity: sha512-P7O5Tkh2NbgIm2R6x1zGJJsnacDzTFcRWZyTTMgFdVit6E98LTxO+v8LCCLWRvPrjdzXHx9FEOA8oAZPyApWUA==} - engines: {node: '>=18'} - cpu: [ia32] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-loong64@0.21.5: resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==} engines: {node: '>=12'} @@ -373,15 +308,6 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.23.0: - resolution: {integrity: sha512-InQwepswq6urikQiIC/kkx412fqUZudBO4SYKu0N+tGhXRWUqAx+Q+341tFV6QdBifpjYgUndV1hhMq3WeJi7A==} - engines: {node: '>=18'} - cpu: [loong64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-mips64el@0.21.5: resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==} engines: {node: '>=12'} @@ -391,15 +317,6 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el@0.23.0: - resolution: {integrity: sha512-J9rflLtqdYrxHv2FqXE2i1ELgNjT+JFURt/uDMoPQLcjWQA5wDKgQA4t/dTqGa88ZVECKaD0TctwsUfHbVoi4w==} - engines: {node: '>=18'} - cpu: [mips64el] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-ppc64@0.21.5: resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==} engines: {node: '>=12'} @@ -409,15 +326,6 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64@0.23.0: - resolution: {integrity: sha512-cShCXtEOVc5GxU0fM+dsFD10qZ5UpcQ8AM22bYj0u/yaAykWnqXJDpd77ublcX6vdDsWLuweeuSNZk4yUxZwtw==} - engines: {node: '>=18'} - cpu: [ppc64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-riscv64@0.21.5: resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==} engines: {node: '>=12'} @@ -427,15 +335,6 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64@0.23.0: - resolution: {integrity: sha512-HEtaN7Y5UB4tZPeQmgz/UhzoEyYftbMXrBCUjINGjh3uil+rB/QzzpMshz3cNUxqXN7Vr93zzVtpIDL99t9aRw==} - engines: {node: '>=18'} - cpu: [riscv64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-s390x@0.21.5: resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==} engines: {node: '>=12'} @@ -445,15 +344,6 @@ packages: dev: true optional: true - /@esbuild/linux-s390x@0.23.0: - resolution: {integrity: sha512-WDi3+NVAuyjg/Wxi+o5KPqRbZY0QhI9TjrEEm+8dmpY9Xir8+HE/HNx2JoLckhKbFopW0RdO2D72w8trZOV+Wg==} - engines: {node: '>=18'} - cpu: [s390x] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-x64@0.21.5: resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==} engines: {node: '>=12'} @@ -463,15 +353,6 @@ packages: dev: true optional: true - /@esbuild/linux-x64@0.23.0: - resolution: {integrity: sha512-a3pMQhUEJkITgAw6e0bWA+F+vFtCciMjW/LPtoj99MhVt+Mfb6bbL9hu2wmTZgNd994qTAEw+U/r6k3qHWWaOQ==} - engines: {node: '>=18'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/netbsd-x64@0.21.5: resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==} engines: {node: '>=12'} @@ -481,24 +362,6 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64@0.23.0: - resolution: {integrity: sha512-cRK+YDem7lFTs2Q5nEv/HHc4LnrfBCbH5+JHu6wm2eP+d8OZNoSMYgPZJq78vqQ9g+9+nMuIsAO7skzphRXHyw==} - engines: {node: '>=18'} - cpu: [x64] - os: [netbsd] - requiresBuild: true - dev: true - optional: true - - /@esbuild/openbsd-arm64@0.23.0: - resolution: {integrity: sha512-suXjq53gERueVWu0OKxzWqk7NxiUWSUlrxoZK7usiF50C6ipColGR5qie2496iKGYNLhDZkPxBI3erbnYkU0rQ==} - engines: {node: '>=18'} - cpu: [arm64] - os: [openbsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/openbsd-x64@0.21.5: resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==} engines: {node: '>=12'} @@ -508,15 +371,6 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64@0.23.0: - resolution: {integrity: sha512-6p3nHpby0DM/v15IFKMjAaayFhqnXV52aEmv1whZHX56pdkK+MEaLoQWj+H42ssFarP1PcomVhbsR4pkz09qBg==} - engines: {node: '>=18'} - cpu: [x64] - os: [openbsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/sunos-x64@0.21.5: resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} engines: {node: '>=12'} @@ -526,15 +380,6 @@ packages: dev: true optional: true - /@esbuild/sunos-x64@0.23.0: - resolution: {integrity: sha512-BFelBGfrBwk6LVrmFzCq1u1dZbG4zy/Kp93w2+y83Q5UGYF1d8sCzeLI9NXjKyujjBBniQa8R8PzLFAUrSM9OA==} - engines: {node: '>=18'} - cpu: [x64] - os: [sunos] - requiresBuild: true - dev: true - optional: true - /@esbuild/win32-arm64@0.21.5: resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==} engines: {node: '>=12'} @@ -544,15 +389,6 @@ packages: dev: true optional: true - /@esbuild/win32-arm64@0.23.0: - resolution: {integrity: sha512-lY6AC8p4Cnb7xYHuIxQ6iYPe6MfO2CC43XXKo9nBXDb35krYt7KGhQnOkRGar5psxYkircpCqfbNDB4uJbS2jQ==} - engines: {node: '>=18'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@esbuild/win32-ia32@0.21.5: resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==} engines: {node: '>=12'} @@ -562,15 +398,6 @@ packages: dev: true optional: true - /@esbuild/win32-ia32@0.23.0: - resolution: {integrity: sha512-7L1bHlOTcO4ByvI7OXVI5pNN6HSu6pUQq9yodga8izeuB1KcT2UkHaH6118QJwopExPn0rMHIseCTx1CRo/uNA==} - engines: {node: '>=18'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@esbuild/win32-x64@0.21.5: resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==} engines: {node: '>=12'} @@ -580,15 +407,6 @@ packages: dev: true optional: true - /@esbuild/win32-x64@0.23.0: - resolution: {integrity: sha512-Arm+WgUFLUATuoxCJcahGuk6Yj9Pzxd6l11Zb/2aAuv5kWWvvfhLFo2fni4uSK5vzlUdCGZ/BdV5tH8klj8p8g==} - engines: {node: '>=18'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@isaacs/cliui@8.0.2: resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} @@ -1191,13 +1009,13 @@ packages: ieee754: 1.2.1 dev: true - /bundle-require@5.0.0(esbuild@0.23.0): - resolution: {integrity: sha512-GuziW3fSSmopcx4KRymQEJVbZUfqlCqcq7dvs6TYwKRZiegK/2buMxQTPs6MGlNv50wms1699qYO54R8XfRX4w==} + /bundle-require@4.2.1(esbuild@0.21.5): + resolution: {integrity: sha512-7Q/6vkyYAwOmQNRw75x+4yRtZCZJXUDmHHlFdkiV0wgv/reNjtJwpu1jPJ0w2kbEpIM0uoKI3S4/f39dU7AjSA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} peerDependencies: - esbuild: '>=0.18' + esbuild: '>=0.17' dependencies: - esbuild: 0.23.0 + esbuild: 0.21.5 load-tsconfig: 0.2.5 dev: true @@ -1348,11 +1166,6 @@ packages: resolution: {integrity: sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==} dev: true - /consola@3.2.3: - resolution: {integrity: sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==} - engines: {node: ^14.18.0 || >=16.10.0} - dev: true - /cookie@0.4.2: resolution: {integrity: sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==} engines: {node: '>= 0.6'} @@ -1613,38 +1426,6 @@ packages: '@esbuild/win32-x64': 0.21.5 dev: true - /esbuild@0.23.0: - resolution: {integrity: sha512-1lvV17H2bMYda/WaFb2jLPeHU3zml2k4/yagNMG8Q/YtfMjCwEUZa2eXXMgZTVSL5q1n4H7sQ0X6CdJDqqeCFA==} - engines: {node: '>=18'} - hasBin: true - requiresBuild: true - optionalDependencies: - '@esbuild/aix-ppc64': 0.23.0 - '@esbuild/android-arm': 0.23.0 - '@esbuild/android-arm64': 0.23.0 - '@esbuild/android-x64': 0.23.0 - '@esbuild/darwin-arm64': 0.23.0 - '@esbuild/darwin-x64': 0.23.0 - '@esbuild/freebsd-arm64': 0.23.0 - '@esbuild/freebsd-x64': 0.23.0 - '@esbuild/linux-arm': 0.23.0 - '@esbuild/linux-arm64': 0.23.0 - '@esbuild/linux-ia32': 0.23.0 - '@esbuild/linux-loong64': 0.23.0 - '@esbuild/linux-mips64el': 0.23.0 - '@esbuild/linux-ppc64': 0.23.0 - '@esbuild/linux-riscv64': 0.23.0 - '@esbuild/linux-s390x': 0.23.0 - '@esbuild/linux-x64': 0.23.0 - '@esbuild/netbsd-x64': 0.23.0 - '@esbuild/openbsd-arm64': 0.23.0 - '@esbuild/openbsd-x64': 0.23.0 - '@esbuild/sunos-x64': 0.23.0 - '@esbuild/win32-arm64': 0.23.0 - '@esbuild/win32-ia32': 0.23.0 - '@esbuild/win32-x64': 0.23.0 - dev: true - /escape-string-regexp@1.0.5: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} engines: {node: '>=0.8.0'} @@ -1847,6 +1628,12 @@ packages: engines: {node: '>=16'} dev: true + /get-tsconfig@4.7.6: + resolution: {integrity: sha512-ZAqrLlu18NbDdRaHq+AKXzAmqIUPswPWKUchfytdAjiRFnCe5ojG2bstg6mRiZabkKfCoL/e98pbBELIV/YCeA==} + dependencies: + resolve-pkg-maps: 1.0.0 + dev: true + /getos@3.2.1: resolution: {integrity: sha512-U56CfOK17OKgTVqozZjUKNdkfEv6jk5WISBJ8SHoagjE6L69zOwl3Z+O8myjY9MEW3i2HPWQBt/LTbCgcC973Q==} dependencies: @@ -2421,25 +2208,20 @@ packages: pathe: 1.1.2 dev: true - /postcss-load-config@6.0.1: - resolution: {integrity: sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==} - engines: {node: '>= 18'} + /postcss-load-config@4.0.2: + resolution: {integrity: sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==} + engines: {node: '>= 14'} peerDependencies: - jiti: '>=1.21.0' postcss: '>=8.0.9' - tsx: ^4.8.1 - yaml: ^2.4.2 + ts-node: '>=9.0.0' peerDependenciesMeta: - jiti: - optional: true postcss: optional: true - tsx: - optional: true - yaml: + ts-node: optional: true dependencies: lilconfig: 3.1.2 + yaml: 2.4.5 dev: true /postcss@8.4.39: @@ -2531,6 +2313,10 @@ packages: engines: {node: '>=8'} dev: true + /resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + dev: true + /restore-cursor@3.1.0: resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} engines: {node: '>=8'} @@ -2936,8 +2722,8 @@ packages: resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} dev: true - /tsup@8.2.0(typescript@5.5.3): - resolution: {integrity: sha512-XoarnVlfXxbv8ODHtxUq8D2XPc9luX+pamnp1kHSKLknKCDcX0Rkc21NHdbpugH6hKoNiETXypKKVgVu46vVRg==} + /tsup@8.1.0(typescript@5.5.3): + resolution: {integrity: sha512-UFdfCAXukax+U6KzeTNO2kAARHcWxmKsnvSPXUcfA1D+kU05XDccCrkffCQpFaWDsZfV0jMyTsxU39VfCp6EOg==} engines: {node: '>=18'} hasBin: true peerDependencies: @@ -2955,16 +2741,15 @@ packages: typescript: optional: true dependencies: - bundle-require: 5.0.0(esbuild@0.23.0) + bundle-require: 4.2.1(esbuild@0.21.5) cac: 6.7.14 chokidar: 3.6.0 - consola: 3.2.3 debug: 4.3.5(supports-color@8.1.1) - esbuild: 0.23.0 + esbuild: 0.21.5 execa: 5.1.1 globby: 11.1.0 joycon: 3.1.1 - postcss-load-config: 6.0.1 + postcss-load-config: 4.0.2 resolve-from: 5.0.0 rollup: 4.19.0 source-map: 0.8.0-beta.0 @@ -2972,10 +2757,19 @@ packages: tree-kill: 1.2.2 typescript: 5.5.3 transitivePeerDependencies: - - jiti - supports-color - - tsx - - yaml + - ts-node + dev: true + + /tsx@4.16.2: + resolution: {integrity: sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==} + engines: {node: '>=18.0.0'} + hasBin: true + dependencies: + esbuild: 0.21.5 + get-tsconfig: 4.7.6 + optionalDependencies: + fsevents: 2.3.3 dev: true /tunnel-agent@0.6.0: @@ -3244,6 +3038,12 @@ packages: engines: {node: '>=0.4.0'} dev: true + /yaml@2.4.5: + resolution: {integrity: sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==} + engines: {node: '>= 14'} + hasBin: true + dev: true + /yauzl@2.10.0: resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==} dependencies: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index b4356b2..44665b7 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,2 +1,3 @@ packages: - - './' + - 'apps/**' + - 'packages/**' diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 0000000..657895e --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,35 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig.json to read more about this file */ + + /* Language and Environment */ + "target": "ESNext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, + + /* Modules */ + "module": "esnext" /* Specify what module code is generated. */, + "moduleResolution": "bundler" /* Specify how TypeScript looks up a file from a given module specifier. */, + "types": [ + "node" + ] /* Specify type package names to be included without being referenced in a source file. */, + + /* Emit */ + "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */, + "emitDeclarationOnly": true /* Only output d.ts files and not JavaScript files. */, + "sourceMap": true /* Create source map files for emitted JavaScript files. */, + "outDir": "dist" /* Specify an output folder for all emitted files. */, + "declarationDir": "types" /* Specify the output directory for generated declaration files. */, + + /* Interop Constraints */ + "allowSyntheticDefaultImports": true /* Allow 'import x from y' when a module doesn't have a default export. */, + "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */, + "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, + + /* Type Checking */ + "strict": true /* Enable all strict type-checking options. */, + "strictNullChecks": true /* When type checking, take into account `null` and `undefined`. */, + + /* Completeness */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + }, + "exclude": ["examples", "dist"] +} diff --git a/tsconfig.json b/tsconfig.json index 163e181..ffcbb94 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,104 +1,3 @@ { - "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ - - /* Projects */ - // "incremental": true, /* Enable incremental compilation */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - - /* Language and Environment */ - "target": "ESNext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, - // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ - // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */ - // "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - - /* Modules */ - "module": "esnext" /* Specify what module code is generated. */, - // "rootDir": "./" /* Specify the root folder within your source files. */, - "moduleResolution": "bundler" /* Specify how TypeScript looks up a file from a given module specifier. */, - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */ - "types": [ - "node" - ] /* Specify type package names to be included without being referenced in a source file. */, - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "resolveJsonModule": true, /* Enable importing .json files */ - // "noResolve": true, /* Disallow `import`s, `require`s or ``s from expanding the number of files TypeScript should add to a project. */ - - /* JavaScript Support */ - // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */ - // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */ - - /* Emit */ - "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */, - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - "emitDeclarationOnly": true /* Only output d.ts files and not JavaScript files. */, - "sourceMap": true /* Create source map files for emitted JavaScript files. */, - // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */ - "outDir": "dist" /* Specify an output folder for all emitted files. */, - // "removeComments": true, /* Disable emitting comments. */ - // "noEmit": true, /* Disable emitting files from a compilation. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */ - // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ - // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */ - "declarationDir": "types" /* Specify the output directory for generated declaration files. */, - // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ - - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - "allowSyntheticDefaultImports": true /* Allow 'import x from y' when a module doesn't have a default export. */, - "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */, - // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, - - /* Type Checking */ - "strict": true /* Enable all strict type-checking options. */, - // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */ - "strictNullChecks": true /* When type checking, take into account `null` and `undefined`. */, - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */ - // "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ - }, - "exclude": ["examples", "dist"] + "extends": "./tsconfig.base.json" }