diff --git a/.github/workflows/general.yaml b/.github/workflows/general.yaml index a1795301..366040f5 100644 --- a/.github/workflows/general.yaml +++ b/.github/workflows/general.yaml @@ -72,7 +72,9 @@ jobs: name: binaries path: dpkit/compile/build - name: Test Binaries - run: unzip -j dpkit/compile/build/*linux*.zip "dp*" && ./dp --version + run: | + unzip -j dpkit/compile/build/*linux-x64.zip "dp*" + ./dp --version services: postgres: @@ -120,12 +122,14 @@ jobs: with: name: binaries path: dpkit/compile/build - # - name: Test Binaries - # run: unzip -j dpkit/compile/build/*macos*.zip "dp*" && ./dp --version + - name: Test Binaries + run: | + unzip -j dpkit/compile/build/*macos-arm64.zip "dp*" + ./dp --version test-windows: needs: [test-compile] - runs-on: macos-latest + runs-on: windows-latest steps: - name: Checkout Repo @@ -143,20 +147,25 @@ jobs: run: pnpm ci:install - name: Build Packages run: pnpm build - - name: Test Packages - run: pnpm test - - name: Download Binaries - uses: actions/download-artifact@v5 - with: - name: binaries - path: dpkit/compile/build + # - name: Test Packages + # run: pnpm win:test + # - name: Download Binaries + # uses: actions/download-artifact@v5 + # with: + # name: binaries + # path: dpkit/compile/build + # TODO: Enable Windows tests # - name: Test Binaries - # run: unzip -j dpkit/compile/build/*windows*.zip "dp*" && ./dp.exe --version + # run: | + # Expand-Archive dpkit\compile\build\*windows*.zip + # $exe = Get-ChildItem -Recurse -Name "dp.exe" | Select-Object -First 1 + # icacls ".\$exe" /grant Everyone:F + # & ".\$exe" --version # We have to split the release step because for some reason # using semantic-release before compilation inflates the binary sizes release-draft: - # needs: [test-linux, test-macos, test-windows] + needs: [test-linux, test-macos, test-windows] if: github.event_name == 'push' runs-on: ubuntu-latest @@ -224,9 +233,7 @@ jobs: - name: Publish Release uses: softprops/action-gh-release@v2 with: - tag_name: v${{ needs.release-draft.outputs.version }} files: dpkit/compile/build/*.zip - make_latest: true - draft: false + tag_name: v${{ needs.release-draft.outputs.version }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/all/index.ts b/all/index.ts index 90ad4b3a..965d9d51 100644 --- a/all/index.ts +++ b/all/index.ts @@ -9,7 +9,9 @@ export * from "@dpkit/github" export * from "@dpkit/inline" export * from "@dpkit/table" export * from "@dpkit/zenodo" -export * from "@dpkit/zip" + +// TODO: Enable after migrated away from yauzl-promise (uses native crc32) +//export * from "@dpkit/zip" export * from "./dialect/index.ts" export * from "./package/index.ts" diff --git a/all/plugin.ts b/all/plugin.ts index eb5acebe..da47af67 100644 --- a/all/plugin.ts +++ b/all/plugin.ts @@ -12,7 +12,9 @@ import { ParquetPlugin } from "@dpkit/parquet" import type { TablePlugin } from "@dpkit/table" import { XlsxPlugin } from "@dpkit/xlsx" import { ZenodoPlugin } from "@dpkit/zenodo" -import { ZipPlugin } from "@dpkit/zip" + +// TODO: Enable after migrated away from yauzl-promise (uses native crc32) +//import { ZipPlugin } from "@dpkit/zip" export class Dpkit { plugins: TablePlugin[] = [] @@ -30,7 +32,7 @@ dpkit.register(DatahubPlugin) dpkit.register(GithubPlugin) dpkit.register(ZenodoPlugin) dpkit.register(FolderPlugin) -dpkit.register(ZipPlugin) +//dpkit.register(ZipPlugin) // Table functions dpkit.register(ArrowPlugin) diff --git a/core/general/descriptor/load.spec.ts b/core/general/descriptor/load.spec.ts index bfc9b75b..b6e428f1 100644 --- a/core/general/descriptor/load.spec.ts +++ b/core/general/descriptor/load.spec.ts @@ -52,10 +52,10 @@ describe("loadDescriptor", () => { }) it("throws error for unsupported URL protocol", async () => { - const testUrl = "file:///path/to/schema.json" + const testUrl = "bad:///path/to/schema.json" await expect(loadDescriptor(testUrl)).rejects.toThrow( - "Unsupported remote protocol: file:", + "Unsupported remote protocol: bad", ) }) diff --git a/core/general/descriptor/load.ts b/core/general/descriptor/load.ts index 4898a382..b9771743 100644 --- a/core/general/descriptor/load.ts +++ b/core/general/descriptor/load.ts @@ -1,4 +1,5 @@ import { node } from "../node.ts" +import { getProtocol } from "../path.ts" import { getBasepath, isRemotePath } from "../path.ts" import { parseDescriptor } from "./process/parse.ts" @@ -23,12 +24,12 @@ export async function loadDescriptor( : await loadLocalDescriptor(path) } -const ALLOWED_REMOTE_PROTOCOLS = ["http:", "https:", "ftp:", "ftps:"] +const ALLOWED_REMOTE_PROTOCOLS = ["http", "https", "ftp", "ftps"] async function loadRemoteDescriptor(path: string) { const url = new URL(path) - const protocol = url.protocol.toLowerCase() + const protocol = getProtocol(path) if (!ALLOWED_REMOTE_PROTOCOLS.includes(protocol)) { throw new Error(`Unsupported remote protocol: ${protocol}`) } diff --git a/core/general/path.spec.ts b/core/general/path.spec.ts index a9fe96ad..7ac14e75 100644 --- a/core/general/path.spec.ts +++ b/core/general/path.spec.ts @@ -1,4 +1,4 @@ -import { relative } from "node:path" +import { join, relative } from "node:path" import { describe, expect, it } from "vitest" import { denormalizePath, @@ -28,7 +28,7 @@ describe("isRemotePath", () => { { description: "file URL", path: "file:///path/to/file.txt", - isRemote: true, + isRemote: false, }, { description: "absolute path", @@ -153,12 +153,12 @@ describe("getBasepath", () => { { description: "local file path", path: "some/path/to/file.txt", - basepath: "some/path/to", + basepath: join("some", "path", "to"), }, { description: "local path with no file", path: "some/path/to/", - basepath: "some/path", + basepath: join("some", "path"), }, { description: "root level file", @@ -176,13 +176,13 @@ describe("normalizePath", () => { description: "local path without basepath", path: "path/to/file.txt", basepath: undefined, - normalizedPath: "path/to/file.txt", + normalizedPath: join("path", "to", "file.txt"), }, { description: "local path with local basepath", path: "file.txt", basepath: "path/to", - normalizedPath: "path/to/file.txt", + normalizedPath: join("path", "to", "file.txt"), }, { description: "remote path", @@ -212,7 +212,7 @@ describe("normalizePath", () => { description: "path with empty basepath", path: "path/to/file.txt", basepath: "", - normalizedPath: "path/to/file.txt", + normalizedPath: join("path", "to", "file.txt"), }, ])("$description", ({ path, basepath, normalizedPath }) => { expect(normalizePath(path, { basepath })).toEqual(normalizedPath) diff --git a/core/general/path.ts b/core/general/path.ts index 4394153a..d8c2d97a 100644 --- a/core/general/path.ts +++ b/core/general/path.ts @@ -2,12 +2,8 @@ import slugify from "@sindresorhus/slugify" import { node } from "./node.ts" export function isRemotePath(path: string) { - try { - new URL(path) - return true - } catch { - return false - } + const protocol = getProtocol(path) + return protocol !== "file" } export function getName(filename?: string) { @@ -26,7 +22,14 @@ export function getName(filename?: string) { export function getProtocol(path: string) { try { const url = new URL(path) - return url.protocol.replace(":", "") + const protocol = url.protocol.replace(":", "") + + // Handle Windows drive letters + if (protocol.length < 2) { + return "file" + } + + return protocol } catch { return "file" } diff --git a/dpkit/scripts/compile.ts b/dpkit/scripts/compile.ts index fd336e0e..d57970a2 100644 --- a/dpkit/scripts/compile.ts +++ b/dpkit/scripts/compile.ts @@ -54,12 +54,24 @@ const targets = [ polars: "nodejs-polars-linux-x64-gnu", libsql: "libsql-linux-x64-gnu", }, + { + name: "bun-linux-arm64", + dpkit: "linux-arm64", + polars: "nodejs-polars-linux-arm64-gnu", + libsql: "libsql-linux-arm64-gnu", + }, { name: "bun-darwin-x64", dpkit: "macos-x64", polars: "nodejs-polars-darwin-x64", libsql: "libsql-darwin-x64", }, + { + name: "bun-darwin-arm64", + dpkit: "macos-arm64", + polars: "nodejs-polars-darwin-arm64", + libsql: "libsql-darwin-arm64", + }, { name: "bun-windows-x64", dpkit: "windows-x64", @@ -87,7 +99,7 @@ for (const target of targets) { ` // For some reason bun creates it with no permissions - if (target.name === "bun-windows-x64") { + if (target.name.startsWith("bun-windows")) { await $build`chmod +r ${folder}/dp.exe` } diff --git a/package.json b/package.json index a95d13fc..6dab4597 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,6 @@ "ci:install": "pnpm install --ignore-scripts", "ci:publish": "pnpm -r publish --access public --ignore-scripts --no-git-checks", "ci:version": "pnpm -r exec pnpm version --no-git-tag-version", - "check": "pnpm run lint && pnpm run type", "clean": "rm pnpm-lock.yaml && find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' +", "compile": "pnpm -F dpkit compile", "coverage": "vitest --ui", @@ -21,15 +20,16 @@ "lint": "biome check", "prepare": "husky", "spec": "vitest run", - "test": "pnpm check && pnpm run spec", + "test": "pnpm lint && pnpm type && pnpm spec", + "win:test": "pnpm spec", "type": "tsc --noEmit" }, "devDependencies": { "@biomejs/biome": "1.9.4", "@semantic-release/exec": "7.1.0", "@types/node": "24.2.0", - "@vitest/coverage-v8": "3.1.4", - "@vitest/ui": "3.1.4", + "@vitest/coverage-v8": "3.2.4", + "@vitest/ui": "3.2.4", "execa": "9.6.0", "husky": "9.1.7", "npm-check-updates": "18.0.1", @@ -37,7 +37,7 @@ "tempy": "3.1.0", "type-fest": "^4.41.0", "typescript": "5.9.2", - "vitest": "3.1.4" + "vitest": "3.2.4" }, "packageManager": "pnpm@10.11.0+sha512.6540583f41cc5f628eb3d9773ecee802f4f9ef9923cc45b69890fb47991d4b092964694ec3a4f738a420c918a333062c8b925d312f42e4f0c263eb603551f977" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ec81db01..a8e01275 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,11 +18,11 @@ importers: specifier: 24.2.0 version: 24.2.0 '@vitest/coverage-v8': - specifier: 3.1.4 - version: 3.1.4(vitest@3.1.4) + specifier: 3.2.4 + version: 3.2.4(vitest@3.2.4) '@vitest/ui': - specifier: 3.1.4 - version: 3.1.4(vitest@3.1.4) + specifier: 3.2.4 + version: 3.2.4(vitest@3.2.4) execa: specifier: 9.6.0 version: 9.6.0 @@ -45,8 +45,8 @@ importers: specifier: 5.9.2 version: 5.9.2 vitest: - specifier: 3.1.4 - version: 3.1.4(@types/debug@4.1.12)(@types/node@24.2.0)(@vitest/ui@3.1.4)(tsx@4.20.3)(yaml@2.8.1) + specifier: 3.2.4 + version: 3.2.4(@types/debug@4.1.12)(@types/node@24.2.0)(@vitest/ui@3.2.4)(tsx@4.20.3)(yaml@2.8.1) all: dependencies: @@ -1548,9 +1548,15 @@ packages: '@tybys/wasm-util@0.10.1': resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==} + '@types/chai@5.2.2': + resolution: {integrity: sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg==} + '@types/debug@4.1.12': resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + '@types/estree-jsx@1.0.5': resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==} @@ -1614,51 +1620,48 @@ packages: '@ungap/structured-clone@1.3.0': resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==} - '@vitest/coverage-v8@3.1.4': - resolution: {integrity: sha512-G4p6OtioySL+hPV7Y6JHlhpsODbJzt1ndwHAFkyk6vVjpK03PFsKnauZIzcd0PrK4zAbc5lc+jeZ+eNGiMA+iw==} + '@vitest/coverage-v8@3.2.4': + resolution: {integrity: sha512-EyF9SXU6kS5Ku/U82E259WSnvg6c8KTjppUncuNdm5QHpe17mwREHnjDzozC8x9MZ0xfBUFSaLkRv4TMA75ALQ==} peerDependencies: - '@vitest/browser': 3.1.4 - vitest: 3.1.4 + '@vitest/browser': 3.2.4 + vitest: 3.2.4 peerDependenciesMeta: '@vitest/browser': optional: true - '@vitest/expect@3.1.4': - resolution: {integrity: sha512-xkD/ljeliyaClDYqHPNCiJ0plY5YIcM0OlRiZizLhlPmpXWpxnGMyTZXOHFhFeG7w9P5PBeL4IdtJ/HeQwTbQA==} + '@vitest/expect@3.2.4': + resolution: {integrity: sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==} - '@vitest/mocker@3.1.4': - resolution: {integrity: sha512-8IJ3CvwtSw/EFXqWFL8aCMu+YyYXG2WUSrQbViOZkWTKTVicVwZ/YiEZDSqD00kX+v/+W+OnxhNWoeVKorHygA==} + '@vitest/mocker@3.2.4': + resolution: {integrity: sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==} peerDependencies: msw: ^2.4.9 - vite: ^5.0.0 || ^6.0.0 + vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0 peerDependenciesMeta: msw: optional: true vite: optional: true - '@vitest/pretty-format@3.1.4': - resolution: {integrity: sha512-cqv9H9GvAEoTaoq+cYqUTCGscUjKqlJZC7PRwY5FMySVj5J+xOm1KQcCiYHJOEzOKRUhLH4R2pTwvFlWCEScsg==} - '@vitest/pretty-format@3.2.4': resolution: {integrity: sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==} - '@vitest/runner@3.1.4': - resolution: {integrity: sha512-djTeF1/vt985I/wpKVFBMWUlk/I7mb5hmD5oP8K9ACRmVXgKTae3TUOtXAEBfslNKPzUQvnKhNd34nnRSYgLNQ==} + '@vitest/runner@3.2.4': + resolution: {integrity: sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==} - '@vitest/snapshot@3.1.4': - resolution: {integrity: sha512-JPHf68DvuO7vilmvwdPr9TS0SuuIzHvxeaCkxYcCD4jTk67XwL45ZhEHFKIuCm8CYstgI6LZ4XbwD6ANrwMpFg==} + '@vitest/snapshot@3.2.4': + resolution: {integrity: sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==} - '@vitest/spy@3.1.4': - resolution: {integrity: sha512-Xg1bXhu+vtPXIodYN369M86K8shGLouNjoVI78g8iAq2rFoHFdajNvJJ5A/9bPMFcfQqdaCpOgWKEoMQg/s0Yg==} + '@vitest/spy@3.2.4': + resolution: {integrity: sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==} - '@vitest/ui@3.1.4': - resolution: {integrity: sha512-CFc2Bpb3sz4Sdt53kdNGq+qZKLftBwX4qZLC03CBUc0N1LJrOoL0ZeK0oq/708mtnpwccL0BZCY9d1WuiBSr7Q==} + '@vitest/ui@3.2.4': + resolution: {integrity: sha512-hGISOaP18plkzbWEcP/QvtRW1xDXF2+96HbEX6byqQhAUbiS5oH6/9JwW+QsQCIYON2bI6QZBF+2PvOmrRZ9wA==} peerDependencies: - vitest: 3.1.4 + vitest: 3.2.4 - '@vitest/utils@3.1.4': - resolution: {integrity: sha512-yriMuO1cfFhmiGc8ataN51+9ooHRuURdfAZfwFd3usWynjzpLslZdYnRegTv32qdgtJTsj15FoeZe2g15fY1gg==} + '@vitest/utils@3.2.4': + resolution: {integrity: sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==} accepts@1.3.8: resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} @@ -1749,6 +1752,9 @@ packages: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} + ast-v8-to-istanbul@0.3.5: + resolution: {integrity: sha512-9SdXjNheSiE8bALAQCQQuT6fgQaoxJh7IRYrRGZ8/9nv8WhJeC1aXAwN8TbaOssGOukUvyvnkgD9+Yuykvl1aA==} + astring@1.9.0: resolution: {integrity: sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg==} hasBin: true @@ -2856,6 +2862,9 @@ packages: js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + js-tokens@9.0.1: + resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} + js-yaml@4.1.0: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true @@ -4212,6 +4221,9 @@ packages: resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} engines: {node: '>=0.10.0'} + strip-literal@3.0.0: + resolution: {integrity: sha512-TcccoMhJOM3OebGhSBEmp3UZ2SfDMZUEBdRA/9ynfLi8yYajyWX3JiXArcJt4Umh4vISpspkQIY8ZZoCqjbviA==} + style-to-js@1.1.17: resolution: {integrity: sha512-xQcBGDxJb6jjFCTzvQtfiPn6YvvP2O8U1MDIPNfJQlWMYfktPy+iGsHE7cssjs7y84d9fQaK4UF3RIJaAHSoYA==} @@ -4284,8 +4296,8 @@ packages: resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} engines: {node: '>=14.0.0'} - tinyspy@3.0.2: - resolution: {integrity: sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==} + tinyspy@4.0.4: + resolution: {integrity: sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==} engines: {node: '>=14.0.0'} to-arraybuffer@1.0.1: @@ -4556,8 +4568,8 @@ packages: vfile@6.0.3: resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==} - vite-node@3.1.4: - resolution: {integrity: sha512-6enNwYnpyDo4hEgytbmc6mYWHXDHYEn0D1/rw4Q+tnHUGtKTJsn8T1YkX6Q18wI5LCrS8CTYlBaiCqxOy2kvUA==} + vite-node@3.2.4: + resolution: {integrity: sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true @@ -4609,16 +4621,16 @@ packages: vite: optional: true - vitest@3.1.4: - resolution: {integrity: sha512-Ta56rT7uWxCSJXlBtKgIlApJnT6e6IGmTYxYcmxjJ4ujuZDI59GUQgVDObXXJujOmPDBYXHK1qmaGtneu6TNIQ==} + vitest@3.2.4: + resolution: {integrity: sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@types/debug': ^4.1.12 '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 - '@vitest/browser': 3.1.4 - '@vitest/ui': 3.1.4 + '@vitest/browser': 3.2.4 + '@vitest/ui': 3.2.4 happy-dom: '*' jsdom: '*' peerDependenciesMeta: @@ -5790,10 +5802,16 @@ snapshots: tslib: 2.8.1 optional: true + '@types/chai@5.2.2': + dependencies: + '@types/deep-eql': 4.0.2 + '@types/debug@4.1.12': dependencies: '@types/ms': 2.1.0 + '@types/deep-eql@4.0.2': {} + '@types/estree-jsx@1.0.5': dependencies: '@types/estree': 1.0.8 @@ -5862,10 +5880,11 @@ snapshots: '@ungap/structured-clone@1.3.0': {} - '@vitest/coverage-v8@3.1.4(vitest@3.1.4)': + '@vitest/coverage-v8@3.2.4(vitest@3.2.4)': dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 1.0.2 + ast-v8-to-istanbul: 0.3.5 debug: 4.4.3 istanbul-lib-coverage: 3.2.2 istanbul-lib-report: 3.0.1 @@ -5876,62 +5895,60 @@ snapshots: std-env: 3.9.0 test-exclude: 7.0.1 tinyrainbow: 2.0.0 - vitest: 3.1.4(@types/debug@4.1.12)(@types/node@24.2.0)(@vitest/ui@3.1.4)(tsx@4.20.3)(yaml@2.8.1) + vitest: 3.2.4(@types/debug@4.1.12)(@types/node@24.2.0)(@vitest/ui@3.2.4)(tsx@4.20.3)(yaml@2.8.1) transitivePeerDependencies: - supports-color - '@vitest/expect@3.1.4': + '@vitest/expect@3.2.4': dependencies: - '@vitest/spy': 3.1.4 - '@vitest/utils': 3.1.4 + '@types/chai': 5.2.2 + '@vitest/spy': 3.2.4 + '@vitest/utils': 3.2.4 chai: 5.3.3 tinyrainbow: 2.0.0 - '@vitest/mocker@3.1.4(vite@6.3.6(@types/node@24.2.0)(tsx@4.20.3)(yaml@2.8.1))': + '@vitest/mocker@3.2.4(vite@6.3.6(@types/node@24.2.0)(tsx@4.20.3)(yaml@2.8.1))': dependencies: - '@vitest/spy': 3.1.4 + '@vitest/spy': 3.2.4 estree-walker: 3.0.3 magic-string: 0.30.19 optionalDependencies: vite: 6.3.6(@types/node@24.2.0)(tsx@4.20.3)(yaml@2.8.1) - '@vitest/pretty-format@3.1.4': - dependencies: - tinyrainbow: 2.0.0 - '@vitest/pretty-format@3.2.4': dependencies: tinyrainbow: 2.0.0 - '@vitest/runner@3.1.4': + '@vitest/runner@3.2.4': dependencies: - '@vitest/utils': 3.1.4 + '@vitest/utils': 3.2.4 pathe: 2.0.3 + strip-literal: 3.0.0 - '@vitest/snapshot@3.1.4': + '@vitest/snapshot@3.2.4': dependencies: - '@vitest/pretty-format': 3.1.4 + '@vitest/pretty-format': 3.2.4 magic-string: 0.30.19 pathe: 2.0.3 - '@vitest/spy@3.1.4': + '@vitest/spy@3.2.4': dependencies: - tinyspy: 3.0.2 + tinyspy: 4.0.4 - '@vitest/ui@3.1.4(vitest@3.1.4)': + '@vitest/ui@3.2.4(vitest@3.2.4)': dependencies: - '@vitest/utils': 3.1.4 + '@vitest/utils': 3.2.4 fflate: 0.8.2 flatted: 3.3.3 pathe: 2.0.3 sirv: 3.0.2 tinyglobby: 0.2.15 tinyrainbow: 2.0.0 - vitest: 3.1.4(@types/debug@4.1.12)(@types/node@24.2.0)(@vitest/ui@3.1.4)(tsx@4.20.3)(yaml@2.8.1) + vitest: 3.2.4(@types/debug@4.1.12)(@types/node@24.2.0)(@vitest/ui@3.2.4)(tsx@4.20.3)(yaml@2.8.1) - '@vitest/utils@3.1.4': + '@vitest/utils@3.2.4': dependencies: - '@vitest/pretty-format': 3.1.4 + '@vitest/pretty-format': 3.2.4 loupe: 3.2.1 tinyrainbow: 2.0.0 @@ -6010,6 +6027,12 @@ snapshots: assertion-error@2.0.1: {} + ast-v8-to-istanbul@0.3.5: + dependencies: + '@jridgewell/trace-mapping': 0.3.31 + estree-walker: 3.0.3 + js-tokens: 9.0.1 + astring@1.9.0: {} astro-expressive-code@0.41.3(astro@5.12.9(@types/node@24.2.0)(rollup@4.50.1)(tsx@4.20.3)(typescript@5.9.2)(yaml@2.8.1)): @@ -7369,6 +7392,8 @@ snapshots: js-tokens@4.0.0: {} + js-tokens@9.0.1: {} + js-yaml@4.1.0: dependencies: argparse: 2.0.1 @@ -9044,6 +9069,10 @@ snapshots: strip-json-comments@2.0.1: {} + strip-literal@3.0.0: + dependencies: + js-tokens: 9.0.1 + style-to-js@1.1.17: dependencies: style-to-object: 1.0.9 @@ -9119,7 +9148,7 @@ snapshots: tinyrainbow@2.0.0: {} - tinyspy@3.0.2: {} + tinyspy@4.0.4: {} to-arraybuffer@1.0.1: {} @@ -9329,7 +9358,7 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.3 - vite-node@3.1.4(@types/node@24.2.0)(tsx@4.20.3)(yaml@2.8.1): + vite-node@3.2.4(@types/node@24.2.0)(tsx@4.20.3)(yaml@2.8.1): dependencies: cac: 6.7.14 debug: 4.4.3 @@ -9368,20 +9397,22 @@ snapshots: optionalDependencies: vite: 6.3.6(@types/node@24.2.0)(tsx@4.20.3)(yaml@2.8.1) - vitest@3.1.4(@types/debug@4.1.12)(@types/node@24.2.0)(@vitest/ui@3.1.4)(tsx@4.20.3)(yaml@2.8.1): + vitest@3.2.4(@types/debug@4.1.12)(@types/node@24.2.0)(@vitest/ui@3.2.4)(tsx@4.20.3)(yaml@2.8.1): dependencies: - '@vitest/expect': 3.1.4 - '@vitest/mocker': 3.1.4(vite@6.3.6(@types/node@24.2.0)(tsx@4.20.3)(yaml@2.8.1)) + '@types/chai': 5.2.2 + '@vitest/expect': 3.2.4 + '@vitest/mocker': 3.2.4(vite@6.3.6(@types/node@24.2.0)(tsx@4.20.3)(yaml@2.8.1)) '@vitest/pretty-format': 3.2.4 - '@vitest/runner': 3.1.4 - '@vitest/snapshot': 3.1.4 - '@vitest/spy': 3.1.4 - '@vitest/utils': 3.1.4 + '@vitest/runner': 3.2.4 + '@vitest/snapshot': 3.2.4 + '@vitest/spy': 3.2.4 + '@vitest/utils': 3.2.4 chai: 5.3.3 debug: 4.4.3 expect-type: 1.2.2 magic-string: 0.30.19 pathe: 2.0.3 + picomatch: 4.0.3 std-env: 3.9.0 tinybench: 2.9.0 tinyexec: 0.3.2 @@ -9389,12 +9420,12 @@ snapshots: tinypool: 1.1.1 tinyrainbow: 2.0.0 vite: 6.3.6(@types/node@24.2.0)(tsx@4.20.3)(yaml@2.8.1) - vite-node: 3.1.4(@types/node@24.2.0)(tsx@4.20.3)(yaml@2.8.1) + vite-node: 3.2.4(@types/node@24.2.0)(tsx@4.20.3)(yaml@2.8.1) why-is-node-running: 2.3.0 optionalDependencies: '@types/debug': 4.1.12 '@types/node': 24.2.0 - '@vitest/ui': 3.1.4(vitest@3.1.4) + '@vitest/ui': 3.2.4(vitest@3.2.4) transitivePeerDependencies: - jiti - less diff --git a/site/public/install.sh b/site/public/install.sh new file mode 100755 index 00000000..85dacde9 --- /dev/null +++ b/site/public/install.sh @@ -0,0 +1,97 @@ +#!/bin/sh + +# This script installs dpkit +# +# Quick install: `curl https://dpkit.dev/install.sh | sh` +# +# Acknowledgments: +# - eget (https://github.com/zyedidia/eget) + +set -e -u + +# Program + +echo "Program: dp" + +# Version + +githubLatestTag() { + finalUrl=$(curl "https://github.com/$1/releases/latest" -s -L -I -o /dev/null -w '%{url_effective}') + printf "%s\n" "${finalUrl##*v}" +} + +version=$(githubLatestTag datisthq/dpkit) +echo "Version: $version" + +# Platform + +platform='' +machine=$(uname -m) + +if [ "${GETEGET_PLATFORM:-x}" != "x" ]; then + platform="$GETEGET_PLATFORM" +else + case "$(uname -s | tr '[:upper:]' '[:lower:]')" in + "linux") + case "$machine" in + "arm64"* | "aarch64"* ) platform='linux-arm64' ;; + *"64") platform='linux-x64' ;; + esac + ;; + "darwin") + case "$machine" in + "arm64"* | "aarch64"* ) platform='macos-arm64' ;; + *"64") platform='macos-x64' ;; + esac + ;; + "msys"*|"cygwin"*|"mingw"*|*"_nt"*|"win"*) + case "$machine" in + *"64") platform='windows-x64' ;; + esac + ;; + esac +fi + +if [ "x$platform" = "x" ]; then + cat << 'EOM' +/=====================================\\ +| COULD NOT DETECT PLATFORM | +\\=====================================/ +Uh oh! We couldn't automatically detect your operating system. +To continue with installation, please choose from one of the following values: +- linux-x64 +- linux-arm64 +- macos-x64 +- macos-arm64 +- windows-x64 +Export your selection as the DPKIT_PLATFORM environment variable, and then +re-run this script. +For example: + $ export DPKIT_PLATFORM=linux-x64 + $ curl https://dpkit.dev/install.sh | sh +EOM + exit 1 +else + echo "Platform: $platform" +fi + +# Download + +archive="dp-$version-$platform.zip" +source="https://github.com/datisthq/dpkit/releases/download/v$version/$archive" +echo "Downloading: $source" +wget -qL --show-progress "https://github.com/datisthq/dpkit/releases/download/v$version/$archive" -O $archive + +# Extract + +echo "Extracting: $archive" +unzip -nqj $archive + +# Remove + +echo "Removing: $archive" +unlink $archive + +# Done + +echo 'Done: run it with "./dp"'