mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-03 13:53:53 +02:00
Add loose build mode
This commit is contained in:
@@ -40,6 +40,7 @@
|
|||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "./scripts/build.sh",
|
"build": "./scripts/build.sh",
|
||||||
|
"build-loose": "./scripts/build.sh --loose",
|
||||||
"watch": "tsx scripts/bundle.ts --watch",
|
"watch": "tsx scripts/bundle.ts --watch",
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"test": "npm run pre-test && npx vitest --run",
|
"test": "npm run pre-test && npx vitest --run",
|
||||||
|
|||||||
+30
-17
@@ -3,6 +3,17 @@ set -e
|
|||||||
|
|
||||||
# This script must be executed via `npm run build`
|
# This script must be executed via `npm run build`
|
||||||
|
|
||||||
|
LOOSE=false
|
||||||
|
if [ "$1" = "--loose" ]; then
|
||||||
|
LOOSE=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$LOOSE" = true ]; then
|
||||||
|
API_EXTRACTOR_FLAGS="--local"
|
||||||
|
else
|
||||||
|
API_EXTRACTOR_FLAGS=""
|
||||||
|
fi
|
||||||
|
|
||||||
# Clear the stuff from last build
|
# Clear the stuff from last build
|
||||||
rm -rf dist
|
rm -rf dist
|
||||||
rm -rf packages/mp3-encoder/dist
|
rm -rf packages/mp3-encoder/dist
|
||||||
@@ -36,25 +47,27 @@ npm run fix-build-import-paths
|
|||||||
tsx scripts/bundle.ts
|
tsx scripts/bundle.ts
|
||||||
|
|
||||||
# Declaration file rollup and checks
|
# Declaration file rollup and checks
|
||||||
api-extractor run
|
api-extractor run $API_EXTRACTOR_FLAGS
|
||||||
api-extractor run -c packages/mp3-encoder/api-extractor.json
|
api-extractor run $API_EXTRACTOR_FLAGS -c packages/mp3-encoder/api-extractor.json
|
||||||
api-extractor run -c packages/ac3/api-extractor.json
|
api-extractor run $API_EXTRACTOR_FLAGS -c packages/ac3/api-extractor.json
|
||||||
api-extractor run -c packages/aac-encoder/api-extractor.json
|
api-extractor run $API_EXTRACTOR_FLAGS -c packages/aac-encoder/api-extractor.json
|
||||||
api-extractor run -c packages/flac-encoder/api-extractor.json
|
api-extractor run $API_EXTRACTOR_FLAGS -c packages/flac-encoder/api-extractor.json
|
||||||
api-extractor run -c packages/prores/api-extractor.json
|
api-extractor run $API_EXTRACTOR_FLAGS -c packages/prores/api-extractor.json
|
||||||
api-extractor run -c packages/server/api-extractor.json
|
api-extractor run $API_EXTRACTOR_FLAGS -c packages/server/api-extractor.json
|
||||||
|
|
||||||
# Checks that all symbols are documented
|
if [ "$LOOSE" = false ]; then
|
||||||
tsx scripts/check-docblocks.ts dist/mediabunny.d.ts
|
# Checks that all symbols are documented
|
||||||
tsx scripts/check-docblocks.ts packages/mp3-encoder/dist/mediabunny-mp3-encoder.d.ts
|
tsx scripts/check-docblocks.ts dist/mediabunny.d.ts
|
||||||
tsx scripts/check-docblocks.ts packages/ac3/dist/mediabunny-ac3.d.ts
|
tsx scripts/check-docblocks.ts packages/mp3-encoder/dist/mediabunny-mp3-encoder.d.ts
|
||||||
tsx scripts/check-docblocks.ts packages/aac-encoder/dist/mediabunny-aac-encoder.d.ts
|
tsx scripts/check-docblocks.ts packages/ac3/dist/mediabunny-ac3.d.ts
|
||||||
tsx scripts/check-docblocks.ts packages/flac-encoder/dist/mediabunny-flac-encoder.d.ts
|
tsx scripts/check-docblocks.ts packages/aac-encoder/dist/mediabunny-aac-encoder.d.ts
|
||||||
tsx scripts/check-docblocks.ts packages/prores/dist/mediabunny-prores.d.ts
|
tsx scripts/check-docblocks.ts packages/flac-encoder/dist/mediabunny-flac-encoder.d.ts
|
||||||
tsx scripts/check-docblocks.ts packages/server/dist/mediabunny-server.d.ts
|
tsx scripts/check-docblocks.ts packages/prores/dist/mediabunny-prores.d.ts
|
||||||
|
tsx scripts/check-docblocks.ts packages/server/dist/mediabunny-server.d.ts
|
||||||
|
|
||||||
# Checks that API docs are generatable
|
# Checks that API docs are generatable
|
||||||
npm run docs:generate -- --dry
|
npm run docs:generate -- --dry
|
||||||
|
fi
|
||||||
|
|
||||||
# Appends stuff to the declaration files to register the global variables these libraries expose
|
# Appends stuff to the declaration files to register the global variables these libraries expose
|
||||||
echo 'export as namespace Mediabunny;' >> dist/mediabunny.d.ts
|
echo 'export as namespace Mediabunny;' >> dist/mediabunny.d.ts
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Copyright (c) 2025-present, Vanilagy and contributors
|
* Copyright (c) 2026-present, Vanilagy and contributors
|
||||||
*
|
*
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
|||||||
Reference in New Issue
Block a user