From fef228eeeafea2962db2ba91f6d5f03f3faae1bc Mon Sep 17 00:00:00 2001 From: Kristo Jorgenson Date: Mon, 20 Sep 2021 10:22:48 +0200 Subject: [PATCH] add release:alpha script --- build.ts | 33 ++++++++++++++++----------------- package.json | 5 +++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/build.ts b/build.ts index fead1cc3..effcc70c 100644 --- a/build.ts +++ b/build.ts @@ -10,6 +10,14 @@ import child_process from 'child_process'; const rimraf = util.promisify(origRimraf); const exec = util.promisify(child_process.exec); +/** + * @todo + * + * - Figure out how to export the fonts and include them with dynamic urls in the css? + * - Possibly export a CJS or IIFE version? + * - Possibly add postcss or something to support namespaces? + */ + const isWatchEnabled = process.argv[2] === '-w'; // for now we bundle for production whenever we aren't in watch mode const isProduction = !isWatchEnabled; @@ -20,7 +28,7 @@ const isProduction = !isWatchEnabled; async function generateDts() { try { return await exec( - `tsc --declaration --emitDeclarationOnly --declarationDir dist` + `tsc --declaration --emitDeclarationOnly --declarationDir dist/types` ); } catch (e) { return Promise.reject(e.stdout); @@ -42,6 +50,10 @@ async function buildTs( external: [ 'react-dom', 'react', + /** + * @todo - We currently ignore these fonts, but we need to figure out a better way + * to include them + */ 'fonts/AccessibleDfA.otf', 'fonts/iAWriterDuospace-Regular.ttf', ], @@ -77,21 +89,6 @@ async function buildAll() { await fs.mkdir('dist'); console.log('🧹 Cleaned output folder -', chalk.blue('dist/')); - // build the main entrypoint as an IIFE module for use in a - //