diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fc05a35..e4db2db 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,5 +1,3 @@ -# This is a Github Workflow that runs tests on any push or pull request. -# If the tests pass and this is a push to the master branch it also runs Semantic Release. name: CI on: [push, pull_request] @@ -63,7 +61,7 @@ jobs: coverage package.json retention-days: 1 - + release: name: Release ${{ github.ref }} needs: test diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index 1ec4984..0000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,98 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL Advanced" - -permissions: {} - -on: - push: - branches: [ "turn-on-later" ] -# push: -# branches: [ "main" ] -# pull_request: -# branches: [ "main" ] -# schedule: -# - cron: '17 20 * * 0' - -jobs: - analyze: - name: Analyze (${{ matrix.language }}) - # Runner size impacts CodeQL analysis time. To learn more, please see: - # - https://gh.io/recommended-hardware-resources-for-running-codeql - # - https://gh.io/supported-runners-and-hardware-resources - # - https://gh.io/using-larger-runners (GitHub.com only) - # Consider using larger runners or machines with greater resources for possible analysis time improvements. - runs-on: 'ubuntu-latest' - permissions: - # required for all workflows - security-events: write - - # required to fetch internal or private CodeQL packs - packages: read - - # only required for workflows in private repositories - actions: read - contents: read - - strategy: - fail-fast: false - matrix: - include: - - language: javascript-typescript - build-mode: none - # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' - # Use `c-cpp` to analyze code written in C, C++ or both - # Use 'java-kotlin' to analyze code written in Java, Kotlin or both - # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both - # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, - # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. - # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how - # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages - steps: - - name: Checkout repository - uses: actions/checkout@v5 - with: - persist-credentials: false - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - build-mode: ${{ matrix.build-mode }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - # If the analyze step fails for one of the languages you are analyzing with - # "We were unable to automatically build your code", modify the matrix above - # to set the build mode to "manual" for that language. Then modify this step - # to build your code. - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - if: matrix.build-mode == 'manual' - shell: bash - run: | - echo 'If you are using a "manual" build mode for one or more of the' \ - 'languages you are analyzing, replace this with the commands to build' \ - 'your code, for example:' - echo ' make bootstrap' - echo ' make release' - exit 1 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:${{matrix.language}}" diff --git a/.gitignore b/.gitignore index 78a7bf9..30b467e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,3 @@ node_modules/ coverage/ -package/ -reports/ build/ -docs/.vitepress/cache/ -yarn.lock -pnpm-lock.yaml -temp -jsr.json -.npmrc -package-lite.json -package-main.json diff --git a/.size-limit.json b/.size-limit.json deleted file mode 100644 index 10c44d2..0000000 --- a/.size-limit.json +++ /dev/null @@ -1,13 +0,0 @@ -[ - { - "name": "all", - "path": [ - "build", - "README.md", - "LICENSE" - ], - "limit": "2.00 kB", - "brotli": false, - "gzip": false - } -] diff --git a/LICENSE b/LICENSE index 87543b2..2d9b04f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2025 Webpod +Copyright (c) 2026 Webpod Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/package-lock.json b/package-lock.json index ab0d27e..7bd6ef6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,20 +9,10 @@ "version": "0.0.0", "license": "MIT", "devDependencies": { - "@size-limit/file": "^11.2.0", "@types/node": "^24.10.0", "@vitest/coverage-v8": "^4.0.8", "concurrently": "^9.2.1", - "esbuild": "^0.25.12", - "esbuild-node-externals": "^1.18.0", - "esbuild-plugin-entry-chunks": "^0.1.17", - "esbuild-plugin-extract-helpers": "^0.0.6", - "esbuild-plugin-hybrid-export": "^0.3.1", - "esbuild-plugin-transform-hook": "^0.2.0", - "jsr": "^0.13.5", - "minimist": "^1.2.8", "oxc-transform": "^0.96.0", - "size-limit": "^11.2.0", "typescript": "^5.9.3", "vitest": "^4.0.8" } @@ -1167,19 +1157,6 @@ "win32" ] }, - "node_modules/@size-limit/file": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/@size-limit/file/-/file-11.2.0.tgz", - "integrity": "sha512-OZHE3putEkQ/fgzz3Tp/0hSmfVo3wyTpOJSRNm6AmcwX4Nm9YtTfbQQ/hZRwbBFR23S7x2Sd9EbqYzngKwbRoA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "peerDependencies": { - "size-limit": "11.2.0" - } - }, "node_modules/@standard-schema/spec": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.0.0.tgz", @@ -1414,16 +1391,6 @@ "js-tokens": "^9.0.1" } }, - "node_modules/bytes-iec": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/bytes-iec/-/bytes-iec-3.1.1.tgz", - "integrity": "sha512-fey6+4jDK7TFtFg/klGSvNKJctyU7n2aQdnM+CO0ruLPbqqMOM8Tio0Pc+deqUeVKX1tL5DQep1zQ7+37aTAsA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/chai": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.0.tgz", @@ -1464,22 +1431,6 @@ "node": ">=8" } }, - "node_modules/chokidar": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", - "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", - "dev": true, - "license": "MIT", - "dependencies": { - "readdirp": "^4.0.1" - }, - "engines": { - "node": ">= 14.16.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -1621,13 +1572,6 @@ } } }, - "node_modules/depseek": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/depseek/-/depseek-0.4.3.tgz", - "integrity": "sha512-0Ex/Uoz9Y9oipbqvgSc7FoV2q4GTDGORkg8TGgM9Pd3RyvRzrDYScKplWiqHU7WqckbKN5kukqD0opEayu2bXg==", - "dev": true, - "license": "MIT" - }, "node_modules/es-module-lexer": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", @@ -1677,85 +1621,6 @@ "@esbuild/win32-x64": "0.25.12" } }, - "node_modules/esbuild-node-externals": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/esbuild-node-externals/-/esbuild-node-externals-1.18.0.tgz", - "integrity": "sha512-suFVX3SzZlXrGIS9Yqx+ZaHL4w1p0e/j7dQbOM9zk8SfFpnAGnDplHUKXIf9kcPEAfZRL66JuYeVSVlsSEQ5Eg==", - "dev": true, - "license": "MIT", - "dependencies": { - "find-up": "^5.0.0" - }, - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "esbuild": "0.12 - 0.25" - } - }, - "node_modules/esbuild-plugin-entry-chunks": { - "version": "0.1.17", - "resolved": "https://registry.npmjs.org/esbuild-plugin-entry-chunks/-/esbuild-plugin-entry-chunks-0.1.17.tgz", - "integrity": "sha512-cJYPptkXdOr/MOx4Op1pAXPS1leSaOEJLDDqrf/Pl/TJEePqMTSwA8BKhhtIsCZ85W8ZcGbmIvIaPII+STY0bg==", - "dev": true, - "license": "MIT", - "dependencies": { - "depseek": "0.4.3", - "esbuild-plugin-utils": "0.1.0" - }, - "peerDependencies": { - "esbuild": ">=0.19.0" - } - }, - "node_modules/esbuild-plugin-extract-helpers": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/esbuild-plugin-extract-helpers/-/esbuild-plugin-extract-helpers-0.0.6.tgz", - "integrity": "sha512-N3qPM3heSf6O5t5cPWfYCFnztzv/XYfxq6wbZtkjMEF2mcjRtbqRBsdTWadcvYrSgTfrz7YA7NyejStEZApcgg==", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild-plugin-utils": "0.1.0" - }, - "peerDependencies": { - "esbuild": ">=0.19.0" - } - }, - "node_modules/esbuild-plugin-hybrid-export": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/esbuild-plugin-hybrid-export/-/esbuild-plugin-hybrid-export-0.3.1.tgz", - "integrity": "sha512-5lnPXHYueI1yJRx140mJxLmXeFGyoDMSeJzJTekmGOlDhwNwS+hKZvO87wy+go1rJmxGie3f0W08ThSl8Tt11w==", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild-plugin-utils": "0.1.0" - }, - "peerDependencies": { - "esbuild": ">=0.19.0" - } - }, - "node_modules/esbuild-plugin-transform-hook": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/esbuild-plugin-transform-hook/-/esbuild-plugin-transform-hook-0.2.0.tgz", - "integrity": "sha512-U5RU/QdrhuRows952i4yP37hMEOYKMnjpoc9D8WnwfvaPzwEcM6KKAtbcX6LoYG7FfynDRH+DlKG/6MBCBwL6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild-plugin-utils": "0.1.0" - }, - "peerDependencies": { - "esbuild": ">=0.19.0" - } - }, - "node_modules/esbuild-plugin-utils": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/esbuild-plugin-utils/-/esbuild-plugin-utils-0.1.0.tgz", - "integrity": "sha512-WZ8jJ/T8HCs7EVoisKlFszikn8ucafm4q4mkXAgPh2wEk1d/5eGvCldOGQrTs2ti3SP6lRrnMqr3Hkz7iEgvcw==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "esbuild": ">=0.19.0" - } - }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", @@ -1804,23 +1669,6 @@ } } }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "license": "MIT", - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -1940,16 +1788,6 @@ "node": ">=8" } }, - "node_modules/jiti": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz", - "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", - "dev": true, - "license": "MIT", - "bin": { - "jiti": "lib/jiti-cli.mjs" - } - }, "node_modules/js-tokens": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", @@ -1957,49 +1795,6 @@ "dev": true, "license": "MIT" }, - "node_modules/jsr": { - "version": "0.13.5", - "resolved": "https://registry.npmjs.org/jsr/-/jsr-0.13.5.tgz", - "integrity": "sha512-qQP20ZcG28pYes7bCq3uuvixl1TL1EpJzwLPfoQadSyWk9j2AID66qhW8+aXpRDRFDvDkXFnONsSRhpnnQAupg==", - "dev": true, - "license": "MIT", - "dependencies": { - "node-stream-zip": "^1.15.0", - "semiver": "^1.1.0" - }, - "bin": { - "jsr": "dist/bin.js" - } - }, - "node_modules/lilconfig": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", - "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antonk52" - } - }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/magic-string": { "version": "0.30.21", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", @@ -2038,16 +1833,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -2074,30 +1859,6 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "node_modules/nanospinner": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/nanospinner/-/nanospinner-1.2.2.tgz", - "integrity": "sha512-Zt/AmG6qRU3e+WnzGGLuMCEAO/dAu45stNbHY223tUxldaDAeE+FxSPsd9Q+j+paejmm0ZbrNVs5Sraqy3dRxA==", - "dev": true, - "license": "MIT", - "dependencies": { - "picocolors": "^1.1.1" - } - }, - "node_modules/node-stream-zip": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/node-stream-zip/-/node-stream-zip-1.15.0.tgz", - "integrity": "sha512-LN4fydt9TqhZhThkZIVQnF9cwjU3qmUH9h78Mx/K7d3VvfRqqwthLwJEUOEL0QPZ0XQmNN7be5Ggit5+4dq3Bw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.12.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/antelle" - } - }, "node_modules/oxc-transform": { "version": "0.96.0", "resolved": "https://registry.npmjs.org/oxc-transform/-/oxc-transform-0.96.0.tgz", @@ -2128,48 +1889,6 @@ "@oxc-transform/binding-win32-x64-msvc": "0.96.0" } }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/pathe": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", @@ -2226,20 +1945,6 @@ "node": "^10 || ^12 || >=14" } }, - "node_modules/readdirp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", - "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14.18.0" - }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -2302,16 +2007,6 @@ "tslib": "^2.1.0" } }, - "node_modules/semiver": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/semiver/-/semiver-1.1.0.tgz", - "integrity": "sha512-QNI2ChmuioGC1/xjyYwyZYADILWyW6AmS1UH6gDj/SFUUUS4MBAWs/7mxnkRPc/F4iHezDP+O8t0dO8WHiEOdg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/semver": { "version": "7.7.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", @@ -2345,28 +2040,6 @@ "dev": true, "license": "ISC" }, - "node_modules/size-limit": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/size-limit/-/size-limit-11.2.0.tgz", - "integrity": "sha512-2kpQq2DD/pRpx3Tal/qRW1SYwcIeQ0iq8li5CJHQgOC+FtPn2BVmuDtzUCgNnpCrbgtfEHqh+iWzxK+Tq6C+RQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "bytes-iec": "^3.1.1", - "chokidar": "^4.0.3", - "jiti": "^2.4.2", - "lilconfig": "^3.1.3", - "nanospinner": "^1.2.2", - "picocolors": "^1.1.1", - "tinyglobby": "^0.2.11" - }, - "bin": { - "size-limit": "bin.js" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - } - }, "node_modules/source-map-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", @@ -2739,19 +2412,6 @@ "engines": { "node": ">=8" } - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } } } } diff --git a/package.json b/package.json index 9ed1e6e..71ccc8b 100644 --- a/package.json +++ b/package.json @@ -14,18 +14,12 @@ }, "scripts": { "build": "concurrently 'npm:build:*'", - "build:esm": "node scripts/build-oxc.ts", - "build:pkgjson": "node scripts/build-pkgjson.ts", - "build:jsr": "node scripts/build-jsr.ts", - "_build:dts": "tsc --emitDeclarationOnly --outDir build", - "_build:dual": "node scripts/build-esbuild.ts --hybrid --format=cjs", + "build:esm": "node scripts/build.ts", + "build:dts": "tsc --emitDeclarationOnly --outDir build", "test": "concurrently 'npm:test:*'", "test:unit": "vitest run --coverage --config ./vitest.config.js", - "test:size": "size-limit", - "test:jsr": "jsr publish --dry-run", "test:audit": "npm audit", - "smoke:esm": "node test/smoke/index.test.mjs", - "smoke:cjs": "node test/smoke/index.test.cjs" + "smoke:esm": "node test/smoke/index.test.mjs" }, "homepage": "https://github.com/webpod/template#readme", "repository": { @@ -36,22 +30,12 @@ "url": "https://github.com/webpod/template/issues" }, "license": "MIT", - "author": "Webpod ", + "author": "Webpod ", "devDependencies": { - "@size-limit/file": "^11.2.0", "@types/node": "^24.10.0", "@vitest/coverage-v8": "^4.0.8", "concurrently": "^9.2.1", - "esbuild": "^0.25.12", - "esbuild-node-externals": "^1.18.0", - "esbuild-plugin-entry-chunks": "^0.1.17", - "esbuild-plugin-extract-helpers": "^0.0.6", - "esbuild-plugin-hybrid-export": "^0.3.1", - "esbuild-plugin-transform-hook": "^0.2.0", - "jsr": "^0.13.5", - "minimist": "^1.2.8", "oxc-transform": "^0.96.0", - "size-limit": "^11.2.0", "typescript": "^5.9.3", "vitest": "^4.0.8" } diff --git a/scripts/build-esbuild.ts b/scripts/build-esbuild.ts deleted file mode 100644 index fc819da..0000000 --- a/scripts/build-esbuild.ts +++ /dev/null @@ -1,164 +0,0 @@ -import process from 'node:process' -import path from 'node:path' -import fs from 'node:fs' -import util from 'node:util' - -import esbuild from 'esbuild' -import { nodeExternalsPlugin } from 'esbuild-node-externals' -import { entryChunksPlugin } from 'esbuild-plugin-entry-chunks' -import { transformHookPlugin } from 'esbuild-plugin-transform-hook' -import { extractHelpersPlugin } from 'esbuild-plugin-extract-helpers' -import { hybridExportPlugin } from 'esbuild-plugin-hybrid-export' - -const outdir = 'build' -const argv = util.parseArgs({ - options: { - banner: { type: 'boolean' }, - sourcemap: { type: 'boolean', default: false }, - hybrid: { type: 'boolean', default: false }, - minify: { type: 'boolean', default: false }, - - entry: { type: 'string', default: './src/index.ts' }, - external: { type: 'string', default: 'node:*' }, - bundle: { type: 'string', default: 'src' }, // 'all' | 'none' - license: { type: 'string', default: 'eof' }, - format: { type: 'string', default: 'cjs,esm' }, - cwd: { type: 'string', default: process.cwd()}, - } -}).values - -const plugins = [] -const cwd = [argv.cwd].flat().pop() -const formats = argv.format.split(',') -const bundle = argv.bundle !== 'none' && !process.argv.includes('--no-bundle') -const entryPoints = argv.entry.includes('*') - ? fs.globSync(unwrapQuotes(argv.entry).split(':'), { cwd }) - : unwrapQuotes(argv.entry).split(':') -const external = bundle - ? argv.external.split(',') - : undefined // https://github.com/evanw/esbuild/issues/1466 - -if (bundle && entryPoints.length > 1) { - plugins.push(entryChunksPlugin()) -} - -if (argv.bundle === 'src') { - // https://github.com/evanw/esbuild/issues/619 - // https://github.com/pradel/esbuild-node-externals/pull/52 - plugins.push(nodeExternalsPlugin()) -} - -if (argv.hybrid) { - plugins.push( - hybridExportPlugin({ - loader: 'reexport', - to: 'build', - toExt: '.js', - }) - ) -} - -const cjsPlugins = [ - extractHelpersPlugin({ - helper: 'cjslib.cjs', - cwd: outdir, - include: /\.cjs/, - }), - transformHookPlugin({ - hooks: [ - { - on: 'end', - pattern: entryPointsToRegexp(entryPoints), - transform(contents: string) { - return contents - .toString() - .replaceAll('"node:', '"') - .replace( - /0 && \(module\.exports =(.|\n)+/, - ($0) => { - if (!$0.includes('...')) return $0 - - const vars: string[] = [] - const reexports: string[] = [] - const lines = $0.split('\n').slice(1, -1) - lines.forEach((l) => { - const e = /\s*\.{3}(require\(.+\))/.exec(l)?.[1] - if (e) { - reexports.push(e) - } else { - vars.push(l) - } - }) - - return `0 && (module.exports = Object.assign({ -${vars.join('\n')} -}, ${reexports.join(',\n')}))` - } - ) - }, - },] - }) -] -const esmConfig = { - logLevel: 'error', - absWorkingDir: cwd, - entryPoints, - outdir, - bundle, - external, - plugins, - minify: argv.minify, - legalComments: argv.license, - sourcemap: argv.sourcemap, - sourcesContent: false, - tsconfig: './tsconfig.json', - platform: 'node', - target: 'es2019', - format: 'esm', - outExtension: { - '.js': '.mjs' - }, -} - -const cjsConfig = { - ...esmConfig, - outdir: outdir, - target: 'es2015', - format: 'cjs', - banner: {}, - outExtension: { - '.js': '.cjs' - }, - plugins: [ - ...plugins, - ...cjsPlugins - ], -} - -for (const format of formats) { - const config = format === 'cjs' ? cjsConfig : esmConfig - - await esbuild - .build(config) - .catch((e) => { - console.error(e) - process.exit(1) - }) -} - -function entryPointsToRegexp(entryPoints: string[]) { - return new RegExp( - '(' + entryPoints.map((e) => escapeRegExp(path.parse(e).name)).join('|') + ')\\.cjs$' - ) -} - -function escapeRegExp(str: string) { - return str.replace(/[/\-\\^$*+?.()|[\]{}]/g, '\\$&') -} - -function unwrapQuotes(str: string) { - return str.replace(/^['"]|['"]$/g, '') -} - -console.log('build:esbuild — ok') -process.exit(0) diff --git a/scripts/build-jsr.ts b/scripts/build-jsr.ts deleted file mode 100644 index d870263..0000000 --- a/scripts/build-jsr.ts +++ /dev/null @@ -1,22 +0,0 @@ -import fs from 'node:fs' -import path from 'node:path' - -const cwd = process.cwd() -const pkgJson = JSON.parse(fs.readFileSync(path.resolve(cwd, 'package.json'), 'utf-8')) - -fs.writeFileSync(path.resolve(cwd, 'jsr.json'), JSON.stringify({ - name: '@webpod/template', - version: pkgJson.version, - exports: { - '.': './src/index.ts' - }, - publish: { - include: [ - 'src', - 'LICENSE', - 'README.md' - ] - } -}, null, 2)) - -console.log('build:jsr — ok') diff --git a/scripts/build-pkgjson.ts b/scripts/build-pkgjson.ts deleted file mode 100644 index 1606fba..0000000 --- a/scripts/build-pkgjson.ts +++ /dev/null @@ -1,41 +0,0 @@ -import fs from 'node:fs' -import path from 'node:path' - -const __dirname = path.dirname(new URL(import.meta.url).pathname) -const root = path.resolve(__dirname, '..') -const source = 'package.json' -const dest = process.env.PKGJSON_PATH || 'package-main.json' -const _pkgJson = JSON.parse(fs.readFileSync(path.join(root, source), 'utf-8')) - -const whitelist = new Set([ - 'name', - 'version', - 'description', - 'type', - 'module', - 'main', - 'types', - 'typesVersions', - 'exports', - 'bin', - 'man', - 'files', - 'engines', - 'optionalDependencies', - 'publishConfig', - 'keywords', - 'repository', - 'homepage', - 'author', - 'license', -]) - -const pkgJson = - Object.fromEntries( - Object.entries(_pkgJson) - .filter(([k]) => whitelist.has(k))) - -fs.writeFileSync(path.resolve(root, dest), JSON.stringify(pkgJson, null, 2) + '\n') - -console.log(`${dest} prepared for npm`) -console.log('build:pkgjson — ok') diff --git a/scripts/build-oxc.ts b/scripts/build.ts similarity index 96% rename from scripts/build-oxc.ts rename to scripts/build.ts index 55ebb4f..b11ad7c 100644 --- a/scripts/build-oxc.ts +++ b/scripts/build.ts @@ -25,4 +25,4 @@ for (const file of fs.globSync('**/*.ts', { cwd: srcDir })) { fs.writeFileSync(path.join(targetDir, name + '.d.ts'), declaration as string) } -console.log('build:oxc — ok') +console.log('build — ok') diff --git a/test/smoke/index.smoke.cjs b/test/smoke/index.smoke.cjs deleted file mode 100644 index a561b72..0000000 --- a/test/smoke/index.smoke.cjs +++ /dev/null @@ -1,3 +0,0 @@ -const {foo} = require('./../../build/index.cjs') - -console.log('smoke:cjs — ok') diff --git a/tsconfig.json b/tsconfig.json index 29290ca..56adbe2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,10 +13,6 @@ "forceConsistentCasingInFileNames": true, "allowJs": false }, - "ts-node": { - "transpileOnly": true, - "files": true, - }, "include": [ "src" ],