2021-12-27 11:21:25 +01:00
|
|
|
#!/bin/bash
|
2022-04-20 18:55:48 +02:00
|
|
|
# Exit whenever one of the commands fail with a non-zero exit code
|
|
|
|
set -e
|
|
|
|
set -o pipefail
|
2022-04-20 00:28:09 +02:00
|
|
|
# Enable extended globs so we can use the `!(filename)` glob syntax
|
|
|
|
shopt -s extglob
|
|
|
|
|
2022-05-06 00:57:25 +02:00
|
|
|
# Only remove the directory contents instead of the whole directory to maintain
|
|
|
|
# the `npm link`/`yarn link` symlink
|
2022-02-26 08:12:00 +01:00
|
|
|
rm -rf target/*
|
2021-12-20 19:17:31 +01:00
|
|
|
yarn run vite build -c vite.sdk-assets-config.js
|
|
|
|
yarn run vite build -c vite.sdk-lib-config.js
|
2021-12-17 14:28:25 +01:00
|
|
|
yarn tsc -p tsconfig-declaration.json
|
|
|
|
./scripts/sdk/create-manifest.js ./target/package.json
|
2021-12-21 15:28:34 +01:00
|
|
|
mkdir target/paths
|
2022-01-12 18:31:55 +01:00
|
|
|
# this doesn't work, the ?url imports need to be in the consuming project, so disable for now
|
|
|
|
# ./scripts/sdk/transform-paths.js ./src/platform/web/sdk/paths/vite.js ./target/paths/vite.js
|
2021-12-22 16:20:54 +01:00
|
|
|
cp doc/SDK.md target/README.md
|
2023-05-11 14:43:09 +02:00
|
|
|
cp doc/SDK-CHANGELOG.md target/CHANGELOG.md
|
2022-05-18 07:21:56 +02:00
|
|
|
pushd target/asset-build
|
|
|
|
rm index.html
|
|
|
|
popd
|
|
|
|
pushd target/asset-build/assets
|
2022-04-20 18:59:49 +02:00
|
|
|
# Remove all `*.wasm` and `*.js` files except for `main.js`
|
2022-02-26 08:12:00 +01:00
|
|
|
rm !(main).js *.wasm
|
2021-12-21 12:24:33 +01:00
|
|
|
popd
|