Skip to content

Commit

Permalink
feat: make bundle names more specific
Browse files Browse the repository at this point in the history
  • Loading branch information
ankoh committed Jan 11, 2022
1 parent b17d6a7 commit f2950b2
Show file tree
Hide file tree
Showing 29 changed files with 141 additions and 145 deletions.
46 changes: 23 additions & 23 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,8 @@ jobs:
./packages/duckdb-wasm/src/bindings/duckdb.wasm
retention-days: 1

wasm_next:
name: WASM / Next
wasm_eh:
name: WASM / EH
runs-on: ubuntu-latest
needs:
- native_debug
Expand All @@ -436,10 +436,10 @@ jobs:
path: |
./.emscripten_cache
./.ccache
key: ${{ runner.os }}-wasm6-next-${{ hashFiles('git_submodule_status.txt') }}-${{ hashFiles('lib/src/**') }}-${{ hashFiles('lib/include/**') }}
key: ${{ runner.os }}-wasm6-eh-${{ hashFiles('git_submodule_status.txt') }}-${{ hashFiles('lib/src/**') }}-${{ hashFiles('lib/include/**') }}
restore-keys: |
${{ runner.os }}-wasm6-next-${{ hashFiles('git_submodule_status.txt') }}
${{ runner.os }}-wasm6-next-
${{ runner.os }}-wasm6-eh-${{ hashFiles('git_submodule_status.txt') }}
${{ runner.os }}-wasm6-eh-
- name: Prepare repository
uses: duckdb/duckdb-wasm-ci-env@v0.5
Expand All @@ -454,20 +454,20 @@ jobs:
with:
script: |-
ccache -z
./scripts/wasm_build_lib.sh release next
./scripts/wasm_build_lib.sh release eh
ccache -s
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: wasm-next
name: wasm-eh
path: |
./packages/duckdb-wasm/src/bindings/duckdb-next.js
./packages/duckdb-wasm/src/bindings/duckdb-next.wasm
./packages/duckdb-wasm/src/bindings/duckdb-eh.js
./packages/duckdb-wasm/src/bindings/duckdb-eh.wasm
retention-days: 1

wasm_next_coi:
name: WASM / Next COI
wasm_coi:
name: WASM / COI
runs-on: ubuntu-latest
needs:
- native_debug
Expand All @@ -488,10 +488,10 @@ jobs:
path: |
./.emscripten_cache
./.ccache
key: ${{ runner.os }}-wasm6-next-coi-${{ hashFiles('git_submodule_status.txt') }}-${{ hashFiles('lib/src/**') }}-${{ hashFiles('lib/include/**') }}
key: ${{ runner.os }}-wasm6-coi-${{ hashFiles('git_submodule_status.txt') }}-${{ hashFiles('lib/src/**') }}-${{ hashFiles('lib/include/**') }}
restore-keys: |
${{ runner.os }}-wasm6-next-coi-${{ hashFiles('git_submodule_status.txt') }}
${{ runner.os }}-wasm6-next-coi-
${{ runner.os }}-wasm6-coi-${{ hashFiles('git_submodule_status.txt') }}
${{ runner.os }}-wasm6-coi-
- name: Prepare repository
uses: duckdb/duckdb-wasm-ci-env@v0.5
Expand All @@ -506,26 +506,26 @@ jobs:
with:
script: |-
ccache -z
./scripts/wasm_build_lib.sh release next_coi
./scripts/wasm_build_lib.sh release coi
ccache -s
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: wasm-next-coi
name: wasm-coi
path: |
./packages/duckdb-wasm/src/bindings/duckdb-next-coi.js
./packages/duckdb-wasm/src/bindings/duckdb-next-coi.pthread.js
./packages/duckdb-wasm/src/bindings/duckdb-next-coi.wasm
./packages/duckdb-wasm/src/bindings/duckdb-coi.js
./packages/duckdb-wasm/src/bindings/duckdb-coi.pthread.js
./packages/duckdb-wasm/src/bindings/duckdb-coi.wasm
retention-days: 1

js_libs:
name: Javascript Library
runs-on: ubuntu-latest
needs:
- wasm_default
- wasm_next
- wasm_next_coi
- wasm_eh
- wasm_coi
- dataprep
- tpchgen
- duckdb_shell
Expand Down Expand Up @@ -586,12 +586,12 @@ jobs:

- uses: actions/download-artifact@v2
with:
name: wasm-next
name: wasm-eh
path: ./packages/duckdb-wasm/src/bindings/

- uses: actions/download-artifact@v2
with:
name: wasm-next-coi
name: wasm-coi
path: ./packages/duckdb-wasm/src/bindings/

- name: Prepare repository
Expand Down
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -200,33 +200,33 @@ wasm_caches:

# Build the wasm module with debug info
.PHONY: wasm
wasm_fast_next: wasm_caches
wasm_fast_eh: wasm_caches
mkdir -p ${CACHE_DIRS}
${EXEC_ENVIRONMENT} ${ROOT_DIR}/scripts/wasm_build_lib.sh fast next
${EXEC_ENVIRONMENT} ${ROOT_DIR}/scripts/wasm_build_lib.sh fast eh

# Build the wasm module with debug info
.PHONY: wasm
wasm: wasm_caches
mkdir -p ${CACHE_DIRS}
${EXEC_ENVIRONMENT} ${ROOT_DIR}/scripts/wasm_build_lib.sh fast default
${EXEC_ENVIRONMENT} ${ROOT_DIR}/scripts/wasm_build_lib.sh fast next
${EXEC_ENVIRONMENT} ${ROOT_DIR}/scripts/wasm_build_lib.sh fast next_coi
${EXEC_ENVIRONMENT} ${ROOT_DIR}/scripts/wasm_build_lib.sh fast eh
${EXEC_ENVIRONMENT} ${ROOT_DIR}/scripts/wasm_build_lib.sh fast coi

# Build the wasm modules with all debug info
.PHONY: wasm_debug
wasm_debug: wasm_caches
mkdir -p ${CACHE_DIRS}
${EXEC_ENVIRONMENT} ${ROOT_DIR}/scripts/wasm_build_lib.sh debug default
${EXEC_ENVIRONMENT} ${ROOT_DIR}/scripts/wasm_build_lib.sh debug next
${EXEC_ENVIRONMENT} ${ROOT_DIR}/scripts/wasm_build_lib.sh debug next_coi
${EXEC_ENVIRONMENT} ${ROOT_DIR}/scripts/wasm_build_lib.sh debug eh
${EXEC_ENVIRONMENT} ${ROOT_DIR}/scripts/wasm_build_lib.sh debug coi

# Build the wasm modules
.PHONY: wasm_release
wasm_release: wasm_caches
mkdir -p ${CACHE_DIRS}
${EXEC_ENVIRONMENT} ${ROOT_DIR}/scripts/wasm_build_lib.sh release default
${EXEC_ENVIRONMENT} ${ROOT_DIR}/scripts/wasm_build_lib.sh release next
${EXEC_ENVIRONMENT} ${ROOT_DIR}/scripts/wasm_build_lib.sh release next_coi
${EXEC_ENVIRONMENT} ${ROOT_DIR}/scripts/wasm_build_lib.sh release eh
${EXEC_ENVIRONMENT} ${ROOT_DIR}/scripts/wasm_build_lib.sh release coi

# Build the duckdb library in debug mode
.PHONY: js_debug
Expand Down
4 changes: 2 additions & 2 deletions examples/bare-browser/bundle.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ function printErr(err) {

fs.copyFile(path.resolve(DUCKDB_DIST, 'duckdb-browser.mjs'), './duckdb-browser.mjs', printErr);
fs.copyFile(path.resolve(DUCKDB_DIST, 'duckdb.wasm'), './duckdb.wasm', printErr);
fs.copyFile(path.resolve(DUCKDB_DIST, 'duckdb-next.wasm'), './duckdb-next.wasm', printErr);
fs.copyFile(path.resolve(DUCKDB_DIST, 'duckdb-eh.wasm'), './duckdb-eh.wasm', printErr);
fs.copyFile(path.resolve(DUCKDB_DIST, 'duckdb-browser.worker.js'), './duckdb-browser.worker.js', printErr);
fs.copyFile(path.resolve(DUCKDB_DIST, 'duckdb-browser-next.worker.js'), './duckdb-browser-next.worker.js', printErr);
fs.copyFile(path.resolve(DUCKDB_DIST, 'duckdb-browser-eh.worker.js'), './duckdb-browser-eh.worker.js', printErr);
6 changes: 3 additions & 3 deletions examples/bare-browser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
mainModule: './duckdb.wasm',
mainWorker: './duckdb-browser.worker.js',
},
next: {
mainModule: './duckdb-next.wasm',
mainWorker: './duckdb-browser-next.worker.js',
eh: {
mainModule: './duckdb-eh.wasm',
mainWorker: './duckdb-browser-eh.worker.js',
},
});

Expand Down
6 changes: 3 additions & 3 deletions examples/bare-node/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ const DUCKDB_DIST = path.dirname(require.resolve('@duckdb/duckdb-wasm'));
mainModule: path.resolve(DUCKDB_DIST, './duckdb.wasm'),
mainWorker: path.resolve(DUCKDB_DIST, './duckdb-node.worker.cjs'),
},
next: {
mainModule: path.resolve(DUCKDB_DIST, './duckdb-next.wasm'),
mainWorker: path.resolve(DUCKDB_DIST, './duckdb-node-next.worker.cjs'),
eh: {
mainModule: path.resolve(DUCKDB_DIST, './duckdb-eh.wasm'),
mainWorker: path.resolve(DUCKDB_DIST, './duckdb-node-eh.worker.cjs'),
},
});

Expand Down
4 changes: 2 additions & 2 deletions examples/esbuild-browser/bundle.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ function printErr(err) {
}

fs.copyFile(path.resolve(DUCKDB_DIST, 'duckdb.wasm'), './duckdb.wasm', printErr);
fs.copyFile(path.resolve(DUCKDB_DIST, 'duckdb-next.wasm'), './duckdb-next.wasm', printErr);
fs.copyFile(path.resolve(DUCKDB_DIST, 'duckdb-eh.wasm'), './duckdb-eh.wasm', printErr);
fs.copyFile(path.resolve(DUCKDB_DIST, 'duckdb-browser.worker.js'), './duckdb-browser.worker.js', printErr);
fs.copyFile(path.resolve(DUCKDB_DIST, 'duckdb-browser-next.worker.js'), './duckdb-browser-next.worker.js', printErr);
fs.copyFile(path.resolve(DUCKDB_DIST, 'duckdb-browser-eh.worker.js'), './duckdb-browser-eh.worker.js', printErr);

esbuild.build({
entryPoints: ['./index.ts'],
Expand Down
6 changes: 3 additions & 3 deletions examples/esbuild-browser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import * as arrow from 'apache-arrow';
mainModule: './duckdb.wasm',
mainWorker: './duckdb-browser.worker.js',
},
next: {
mainModule: './duckdb-next.wasm',
mainWorker: './duckdb-browser-next.worker.js',
eh: {
mainModule: './duckdb-eh.wasm',
mainWorker: './duckdb-browser-eh.worker.js',
},
});

Expand Down
6 changes: 3 additions & 3 deletions examples/esbuild-node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ const DUCKDB_DIST = path.dirname(require.resolve('@duckdb/duckdb-wasm'));
mainModule: path.resolve(DUCKDB_DIST, './duckdb.wasm'),
mainWorker: path.resolve(DUCKDB_DIST, './duckdb-node.worker.cjs'),
},
next: {
mainModule: path.resolve(DUCKDB_DIST, './duckdb-next.wasm'),
mainWorker: path.resolve(DUCKDB_DIST, './duckdb-node-next.worker.cjs'),
eh: {
mainModule: path.resolve(DUCKDB_DIST, './duckdb-eh.wasm'),
mainWorker: path.resolve(DUCKDB_DIST, './duckdb-node-eh.worker.cjs'),
},
});

Expand Down
8 changes: 4 additions & 4 deletions packages/benchmarks/src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ const DUCKDB_BUNDLES = {
mainModule: path.resolve(__dirname, '../../duckdb-wasm/dist/duckdb.wasm'),
mainWorker: path.resolve(__dirname, '../../duckdb-wasm/dist/duckdb-node.worker.cjs'),
},
next: {
mainModule: path.resolve(__dirname, '../../duckdb-wasm/dist/duckdb-next.wasm'),
mainWorker: path.resolve(__dirname, '../../duckdb-wasm/dist/duckdb-node-next.worker.cjs'),
eh: {
mainModule: path.resolve(__dirname, '../../duckdb-wasm/dist/duckdb-eh.wasm'),
mainWorker: path.resolve(__dirname, '../../duckdb-wasm/dist/duckdb-node-eh.worker.cjs'),
},
};

Expand All @@ -40,7 +40,7 @@ export async function setupSqljs(): Promise<sqljs.SqlJsStatic> {
return await initSQLJs();
}

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
// eslint-disable-eh-line @typescript-eslint/explicit-module-boundary-types
export async function writeReport(report: any, dst: string): Promise<void> {
const reports = path.resolve(__dirname, '../../../reports');
if (!fsSync.existsSync(reports)) {
Expand Down
14 changes: 7 additions & 7 deletions packages/duckdb-wasm-shell/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ import 'react-popper-tooltip/dist/styles.css';

import * as duckdb from '@duckdb/duckdb-wasm';
import duckdb_wasm from '@duckdb/duckdb-wasm/dist/duckdb.wasm';
import duckdb_wasm_next from '@duckdb/duckdb-wasm/dist/duckdb-next.wasm';
import duckdb_wasm_next_coi from '@duckdb/duckdb-wasm/dist/duckdb-next-coi.wasm';
import duckdb_wasm_next from '@duckdb/duckdb-wasm/dist/duckdb-eh.wasm';
import duckdb_wasm_next_coi from '@duckdb/duckdb-wasm/dist/duckdb-coi.wasm';

const DUCKDB_BUNDLES: duckdb.DuckDBBundles = {
mvp: {
mainModule: duckdb_wasm,
mainWorker: new URL('@duckdb/duckdb-wasm/dist/duckdb-browser.worker.js', import.meta.url).toString(),
},
next: {
eh: {
mainModule: duckdb_wasm_next,
mainWorker: new URL('@duckdb/duckdb-wasm/dist/duckdb-browser-next.worker.js', import.meta.url).toString(),
mainWorker: new URL('@duckdb/duckdb-wasm/dist/duckdb-browser-eh.worker.js', import.meta.url).toString(),
},
nextCOI: {
coi: {
mainModule: duckdb_wasm_next_coi,
mainWorker: new URL('@duckdb/duckdb-wasm/dist/duckdb-browser-next-coi.worker.js', import.meta.url).toString(),
mainWorker: new URL('@duckdb/duckdb-wasm/dist/duckdb-browser-coi.worker.js', import.meta.url).toString(),
pthreadWorker: new URL(
'@duckdb/duckdb-wasm/dist/duckdb-browser-next-coi.pthread.worker.js',
'@duckdb/duckdb-wasm/dist/duckdb-browser-coi.pthread.worker.js',
import.meta.url,
).toString(),
},
Expand Down
6 changes: 3 additions & 3 deletions packages/duckdb-wasm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ import * as duckdb from '@duckdb/duckdb-wasm';

// Either bundle them manually, for example as Webpack assets
import duckdb_wasm from '@duckdb/duckdb-wasm/dist/duckdb.wasm';
import duckdb_wasm_next from '@duckdb/duckdb-wasm/dist/duckdb-next.wasm';
import duckdb_wasm_next from '@duckdb/duckdb-wasm/dist/duckdb-eh.wasm';
const MANUAL_BUNDLES: duckdb.DuckDBBundles = {
mvp: {
mainModule: duckdb_wasm,
mainWorker: new URL('@duckdb/duckdb-wasm/dist/duckdb-browser.worker.js', import.meta.url).toString(),
},
next: {
eh: {
mainModule: duckdb_wasm_next,
mainWorker: new URL('@duckdb/duckdb-wasm/dist/duckdb-browser-next.worker.js', import.meta.url).toString(),
mainWorker: new URL('@duckdb/duckdb-wasm/dist/duckdb-browser-eh.worker.js', import.meta.url).toString(),
},
};
// ..., or load the bundles from jsdelivr
Expand Down
Loading

0 comments on commit f2950b2

Please sign in to comment.