Skip to content

Commit

Permalink
Add conditional exports
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebarron committed Nov 10, 2023
1 parent 9d546c1 commit 659afab
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "parquet-wasm"
version = "0.5.0"
version = "0.6.0-beta.1"
authors = ["Kyle Barron <[email protected]>"]
edition = "2021"
description = "WebAssembly Parquet reader and writer."
Expand Down
7 changes: 6 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,12 @@ cp tmp_build/{bundler,bundler2}/arrow* pkg/bundler/
cp tmp_build/{esm,esm2}/arrow* pkg/esm
cp tmp_build/{node,node2}/arrow* pkg/node

cp tmp_build/bundler/{package.json,LICENSE_APACHE,LICENSE_MIT,README.md} pkg/
cp tmp_build/bundler/{LICENSE_APACHE,LICENSE_MIT,README.md} pkg/

# Copy in combined package.json from template
# https://stackoverflow.com/a/24904276
# Note that keys from the second file will overwrite keys from the first.
jq -s '.[0] * .[1]' templates/package.json tmp_build/bundler/package.json > pkg/package.json

# Create minimal package.json in esm/ folder with type: module
echo '{"type": "module"}' > pkg/esm/package.json
Expand Down
59 changes: 59 additions & 0 deletions templates/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"name": "parquet-wasm",
"collaborators": [
"Kyle Barron <[email protected]>"
],
"description": "WebAssembly Parquet reader and writer.",
"version": "0.5.0",
"license": "MIT OR Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/kylebarron/parquet-wasm"
},
"files": [
"*"
],
"module": "bundler/arrow2.js",
"types": "bundler/arrow2.d.ts",
"sideEffects": [
"./arrow1.js",
"./snippets/*"
],
"keywords": [
"parquet",
"webassembly",
"arrow"
],
"exports": {
"./arrow1": {
"import": {
"types": "./esm/arrow1.d.ts",
"import": "./esm/arrow1.js"
},
"browser": {
"types": "./esm/arrow1.d.ts",
"import": "./esm/arrow1.js"
},
"node": {
"types": "./node/arrow1.d.ts",
"require": "./node/arrow1.js",
"import": "./node/arrow1.js"
}
},
"./arrow2": {
"import": {
"types": "./esm/arrow2.d.ts",
"import": "./esm/arrow2.js"
},
"browser": {
"types": "./esm/arrow2.d.ts",
"import": "./esm/arrow2.js"
},
"node": {
"types": "./node/arrow2.d.ts",
"require": "./node/arrow2.js",
"import": "./node/arrow2.js"
}
}
}
}

0 comments on commit 659afab

Please sign in to comment.