From 2c5cbe5001909fc364af728f5cfe8b88c34297bd Mon Sep 17 00:00:00 2001 From: sinclair Date: Sun, 28 Apr 2024 18:56:26 +0900 Subject: [PATCH] Refactor Build Tooling --- hammer.mjs | 2 +- package.json | 3 --- task/build/package/create-package-json.ts | 14 ++++++-------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/hammer.mjs b/hammer.mjs index 9d20e9d6..e44540b4 100644 --- a/hammer.mjs +++ b/hammer.mjs @@ -57,7 +57,7 @@ export async function build_check(target = 'target/build') { await shell(`cd ${target} && attw sinclair-typebox-${version}.tgz`) } export async function build(target = 'target/build') { - // await test() + await test() await clean() await Promise.all([ Build.Package.build(target), diff --git a/package.json b/package.json index 8df5a6ee..f2162e4e 100644 --- a/package.json +++ b/package.json @@ -14,9 +14,6 @@ "type": "git", "url": "https://github.com/sinclairzx81/typebox" }, - "esm.sh": { - "bundle": false - }, "scripts": { "test:typescript": "hammer task test_typescript", "test:static": "hammer task test_static", diff --git a/task/build/package/create-package-json.ts b/task/build/package/create-package-json.ts index 89cd89da..7b7ab984 100644 --- a/task/build/package/create-package-json.ts +++ b/task/build/package/create-package-json.ts @@ -54,7 +54,6 @@ function resolveSubmoduleExports(submodule: string) { import: { types: `./build/esm/${submodule}/index.d.mts`, default: `./build/esm/${submodule}/index.mjs`, - } } } @@ -90,13 +89,12 @@ function resolveMetadata() { author: packageJson.author, license: packageJson.license, repository: packageJson.repository, - // disable auto bundling via esm.sh - 'esm.sh': packageJson['esm.sh'], // flagged by socket.dev - scripts: { test: 'echo test' }, - types: "./build/require/index.d.ts", - main: "./build/require/index.js", - module: "./build/import/index.mjs", - + scripts: { test: 'echo test' }, + // disable auto bundle strategy: see https://github.com/esm-dev/esm.sh#bundling-strategy + 'esm.sh': { 'bundle': false }, + types: "./build/cjs/index.d.ts", + main: "./build/cjs/index.js", + module: "./build/esm/index.mjs" } }