diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c4f72bd..812f9a3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,15 +17,15 @@ jobs: cache: 'npm' - name: Install duckdb-utils depdenencies run: | - cd duckdb-utils - npm install + cd duckdb-utils/dist + npm ci - name: Install dependencies - run: npm install + run: npm ci - name: Build run: npm run build - name: Set up `npm link` run: | - cd duckdb-utils + cd duckdb-utils/dist npm link - name: Run `npm link` run: npm link duckdb-utils diff --git a/README.md b/README.md index 9d355ca..8bcae6b 100644 --- a/README.md +++ b/README.md @@ -26,5 +26,9 @@ RUN npm run build # ❌ `worker terminated with 1 pending requests` inside Asyn [duckdb-utils/src/duckdb.ts](duckdb-utils/src/duckdb.ts) instantiates an `AsyncDuckDB`: ```typescript - +const { worker, bundle } = await nodeWorkerBundle() +const logger = { log: () => {}, } +const db = new AsyncDuckDB(logger, worker) ``` + +This works when the [duckdb-utils](duckdb-utils) module is installed directly, but breaks when `npm link`ed. diff --git a/duckdb-utils b/duckdb-utils index 9752248..c6bc453 160000 --- a/duckdb-utils +++ b/duckdb-utils @@ -1 +1 @@ -Subproject commit 97522482c03ea5d5c830f7a1247a3a60e36e5117 +Subproject commit c6bc4532c5dfb4868a0f0a376b1cfcb0bf67ad43 diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..f00aac2 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,689 @@ +{ + "name": "next-duckdb-wasm", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "next-duckdb-wasm", + "version": "0.1.0", + "dependencies": { + "@duckdb/duckdb-wasm": "^1.28.1-dev87.0", + "duckdb-utils": "file:duckdb-utils/dist", + "next": "^13.3.4", + "react": "18.2.0", + "react-dom": "18.2.0", + "web-worker": "^1.3.0" + }, + "devDependencies": { + "@types/node": "20.11.4", + "@types/react": "18.2.48", + "@types/react-dom": "18.2.18", + "typescript": "5.3.3" + } + }, + "../next-utils/dist": { + "name": "next-utils", + "version": "0.1.2", + "extraneous": true, + "dependencies": { + "@duckdb/duckdb-wasm": "^1.28.0", + "@fortawesome/fontawesome-svg-core": "^6.4.2", + "@fortawesome/free-solid-svg-icons": "^6.4.2", + "@fortawesome/react-fontawesome": "^0.2.0", + "@mdx-js/loader": "^2.3.0", + "@mdx-js/react": "^2.3.0", + "@vanilla-extract/css": "^1.9.2", + "@vanilla-extract/next-plugin": "^2.1.1", + "commander": "^11.0.0", + "leaflet": "^1.9.4", + "lodash": "^4.17.21", + "node-fetch": "^3.3.1", + "plotly.js": "^2.0.0", + "react-leaflet": "^4.2.1", + "react-markdown": "^8.0.3", + "react-plotly.js": "^2.5.1", + "rehype-raw": "^6.1.1", + "remark-gfm": "^3.0.1", + "web-worker": "^1.2.0" + }, + "bin": { + "nugh": "next-utils-github.sh", + "nul": "next-utils-local.sh", + "write-redirects": "write-redirects.js" + }, + "devDependencies": { + "@types/emscripten": "^1.39.6", + "@types/leaflet": "^1.9.8", + "@types/lodash": "^4.14.191", + "@types/mdx": "^2.0.3", + "@types/node": "^18.11.9", + "@types/node-fetch": "^2.6.2", + "@types/react": "^18.0.25", + "@types/react-dom": "^18.0.9", + "@types/react-leaflet": "^3.0.0", + "@types/react-plotly.js": "^2.5.2", + "eslint": "8.28.0", + "eslint-config-next": "13.0.4", + "typescript": "^4.9.3" + }, + "peerDependencies": { + "@next/mdx": "^13.3.4", + "next": "^13.3.4", + "react": "^18.0.0", + "react-dom": "^18.0.0" + } + }, + "node_modules/@75lb/deep-merge": { + "version": "1.1.1", + "license": "MIT", + "dependencies": { + "lodash.assignwith": "^4.2.0", + "typical": "^7.1.1" + }, + "engines": { + "node": ">=12.17" + } + }, + "node_modules/@duckdb/duckdb-wasm": { + "version": "1.28.1-dev87.0", + "license": "MIT", + "dependencies": { + "apache-arrow": "^14.0.1" + } + }, + "node_modules/@next/env": { + "version": "13.5.6", + "license": "MIT" + }, + "node_modules/@next/swc-darwin-arm64": { + "version": "13.5.6", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@swc/helpers": { + "version": "0.5.2", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@types/command-line-args": { + "version": "5.2.0", + "license": "MIT" + }, + "node_modules/@types/command-line-usage": { + "version": "5.0.2", + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "20.11.4", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/pad-left": { + "version": "2.1.1", + "license": "MIT" + }, + "node_modules/@types/prop-types": { + "version": "15.7.11", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "18.2.48", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } + }, + "node_modules/@types/react-dom": { + "version": "18.2.18", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/react": "*" + } + }, + "node_modules/@types/scheduler": { + "version": "0.16.8", + "dev": true, + "license": "MIT" + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/apache-arrow": { + "version": "14.0.2", + "license": "Apache-2.0", + "dependencies": { + "@types/command-line-args": "5.2.0", + "@types/command-line-usage": "5.0.2", + "@types/node": "20.3.0", + "@types/pad-left": "2.1.1", + "command-line-args": "5.2.1", + "command-line-usage": "7.0.1", + "flatbuffers": "23.5.26", + "json-bignum": "^0.0.3", + "pad-left": "^2.1.0", + "tslib": "^2.5.3" + }, + "bin": { + "arrow2csv": "bin/arrow2csv.js" + } + }, + "node_modules/apache-arrow/node_modules/@types/node": { + "version": "20.3.0", + "license": "MIT" + }, + "node_modules/array-back": { + "version": "3.1.0", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/busboy": { + "version": "1.6.0", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001577", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk-template": { + "version": "0.4.0", + "license": "MIT", + "dependencies": { + "chalk": "^4.1.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/chalk-template?sponsor=1" + } + }, + "node_modules/client-only": { + "version": "0.0.1", + "license": "MIT" + }, + "node_modules/color-convert": { + "version": "2.0.1", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "license": "MIT" + }, + "node_modules/command-line-args": { + "version": "5.2.1", + "license": "MIT", + "dependencies": { + "array-back": "^3.1.0", + "find-replace": "^3.0.0", + "lodash.camelcase": "^4.3.0", + "typical": "^4.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/command-line-args/node_modules/typical": { + "version": "4.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/command-line-usage": { + "version": "7.0.1", + "license": "MIT", + "dependencies": { + "array-back": "^6.2.2", + "chalk-template": "^0.4.0", + "table-layout": "^3.0.0", + "typical": "^7.1.1" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/command-line-usage/node_modules/array-back": { + "version": "6.2.2", + "license": "MIT", + "engines": { + "node": ">=12.17" + } + }, + "node_modules/csstype": { + "version": "3.1.3", + "dev": true, + "license": "MIT" + }, + "node_modules/duckdb-utils": { + "version": "0.1.2", + "resolved": "file:duckdb-utils/dist", + "dependencies": { + "@duckdb/duckdb-wasm": "^1.28.0", + "web-worker": "^1.3.0" + } + }, + "node_modules/duckdb-utils/node_modules/@duckdb/duckdb-wasm": { + "version": "1.28.0", + "resolved": "https://registry.npmjs.org/@duckdb/duckdb-wasm/-/duckdb-wasm-1.28.0.tgz", + "integrity": "sha512-YaswpEmxr1Sp20/FZbWR7bZBJqj6xQXX2m4LLzYBnA02g4K1yrpxsBWmkxQyMbrH6AHKhcUUqAlaXfA2Rvaa3w==", + "dependencies": { + "apache-arrow": "^13.0.0" + } + }, + "node_modules/duckdb-utils/node_modules/@types/node": { + "version": "20.3.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.0.tgz", + "integrity": "sha512-cumHmIAf6On83X7yP+LrsEyUOf/YlociZelmpRYaGFydoaPdxdt80MAbu6vWerQT2COCp2nPvHdsbD7tHn/YlQ==" + }, + "node_modules/duckdb-utils/node_modules/apache-arrow": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/apache-arrow/-/apache-arrow-13.0.0.tgz", + "integrity": "sha512-3gvCX0GDawWz6KFNC28p65U+zGh/LZ6ZNKWNu74N6CQlKzxeoWHpi4CgEQsgRSEMuyrIIXi1Ea2syja7dwcHvw==", + "dependencies": { + "@types/command-line-args": "5.2.0", + "@types/command-line-usage": "5.0.2", + "@types/node": "20.3.0", + "@types/pad-left": "2.1.1", + "command-line-args": "5.2.1", + "command-line-usage": "7.0.1", + "flatbuffers": "23.5.26", + "json-bignum": "^0.0.3", + "pad-left": "^2.1.0", + "tslib": "^2.5.3" + }, + "bin": { + "arrow2csv": "bin/arrow2csv.js" + } + }, + "node_modules/find-replace": { + "version": "3.0.0", + "license": "MIT", + "dependencies": { + "array-back": "^3.0.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/flatbuffers": { + "version": "23.5.26", + "license": "SEE LICENSE IN LICENSE" + }, + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "license": "BSD-2-Clause" + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "license": "ISC" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "license": "MIT" + }, + "node_modules/json-bignum": { + "version": "0.0.3", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/lodash.assignwith": { + "version": "4.2.0", + "license": "MIT" + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "license": "MIT" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/nanoid": { + "version": "3.3.7", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/next": { + "version": "13.5.6", + "license": "MIT", + "dependencies": { + "@next/env": "13.5.6", + "@swc/helpers": "0.5.2", + "busboy": "1.6.0", + "caniuse-lite": "^1.0.30001406", + "postcss": "8.4.31", + "styled-jsx": "5.1.1", + "watchpack": "2.4.0" + }, + "bin": { + "next": "dist/bin/next" + }, + "engines": { + "node": ">=16.14.0" + }, + "optionalDependencies": { + "@next/swc-darwin-arm64": "13.5.6", + "@next/swc-darwin-x64": "13.5.6", + "@next/swc-linux-arm64-gnu": "13.5.6", + "@next/swc-linux-arm64-musl": "13.5.6", + "@next/swc-linux-x64-gnu": "13.5.6", + "@next/swc-linux-x64-musl": "13.5.6", + "@next/swc-win32-arm64-msvc": "13.5.6", + "@next/swc-win32-ia32-msvc": "13.5.6", + "@next/swc-win32-x64-msvc": "13.5.6" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.1.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "sass": "^1.3.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "sass": { + "optional": true + } + } + }, + "node_modules/pad-left": { + "version": "2.1.0", + "license": "MIT", + "dependencies": { + "repeat-string": "^1.5.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "license": "ISC" + }, + "node_modules/postcss": { + "version": "8.4.31", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/react": { + "version": "18.2.0", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "18.2.0", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.0" + }, + "peerDependencies": { + "react": "^18.2.0" + } + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "license": "MIT", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/scheduler": { + "version": "0.23.0", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stream-read-all": { + "version": "3.0.1", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/streamsearch": { + "version": "1.1.0", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/styled-jsx": { + "version": "5.1.1", + "license": "MIT", + "dependencies": { + "client-only": "0.0.1" + }, + "engines": { + "node": ">= 12.0.0" + }, + "peerDependencies": { + "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/table-layout": { + "version": "3.0.2", + "license": "MIT", + "dependencies": { + "@75lb/deep-merge": "^1.1.1", + "array-back": "^6.2.2", + "command-line-args": "^5.2.1", + "command-line-usage": "^7.0.0", + "stream-read-all": "^3.0.1", + "typical": "^7.1.1", + "wordwrapjs": "^5.1.0" + }, + "bin": { + "table-layout": "bin/cli.js" + }, + "engines": { + "node": ">=12.17" + } + }, + "node_modules/table-layout/node_modules/array-back": { + "version": "6.2.2", + "license": "MIT", + "engines": { + "node": ">=12.17" + } + }, + "node_modules/tslib": { + "version": "2.6.2", + "license": "0BSD" + }, + "node_modules/typescript": { + "version": "5.3.3", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typical": { + "version": "7.1.1", + "license": "MIT", + "engines": { + "node": ">=12.17" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "dev": true, + "license": "MIT" + }, + "node_modules/watchpack": { + "version": "2.4.0", + "license": "MIT", + "dependencies": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/web-worker": { + "version": "1.3.0", + "license": "Apache-2.0" + }, + "node_modules/wordwrapjs": { + "version": "5.1.0", + "license": "MIT", + "engines": { + "node": ">=12.17" + } + } + } +}