Skip to content

cleanup dist conf #262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,16 @@ jobs:
- '18'
- '20'
- '22'

steps:
- uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
cache: npm
node-version: ${{ matrix.node-version }}

- run: npm install -g nyc
- run: npm ci
- run: npm run test:cover

- uses: codecov/codecov-action@v5
with:
files: coverage/coverage-final.json
Expand All @@ -39,7 +36,6 @@ jobs:
strategy:
matrix:
browser: [ChromeHeadless, FirefoxHeadless]

steps:
- uses: actions/checkout@v4
- name: Setup Node.js
Expand All @@ -54,23 +50,21 @@ jobs:

deno:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: "v2.x"
- run: npm ci
- run: deno test test/deno_test.ts
- run: npm run test:deno

bun:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- run: bun install
- run: bun test test/bun.spec.ts
- run: npm run test:bun

3 changes: 1 addition & 2 deletions karma.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ export default function configure(config: any) {
test: /\.tsx?$/,
loader: "ts-loader",
options: {
configFile: "tsconfig.test-karma.json",
// FIXME: some types for dependencies cannot be resolved, so ignore type checking for now.
transpileOnly: true,
configFile: "tsconfig.test-karma.json",
},
},
],
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@
"description": "MessagePack for ECMA-262/JavaScript/TypeScript",
"author": "The MessagePack community",
"license": "ISC",
"main": "./dist/index.js",
"main": "./dist.cjs/index.js",
"module": "./dist.esm/index.mjs",
"cdn": "./dist.umd/msgpack.min.js",
"unpkg": "./dist.umd/msgpack.min.js",
"types": "./dist/index.d.ts",
"types": "./dist.esm/index.d.ts",
"sideEffects": false,
"scripts": {
"build": "npm publish --dry-run",
"prepare": "npm run clean && webpack --bail && tsc --build tsconfig.dist.json tsconfig.dist.esm.json && ts-node tools/esmify.ts dist.esm/*.js dist.esm/*/*.js",
"prepare": "npm run clean && webpack --bail && tsc --build tsconfig.dist.cjs.json tsconfig.dist.esm.json && ts-node tools/esmify.ts dist.esm/*.js dist.esm/*/*.js",
"prepublishOnly": "npm run test:dist",
"clean": "rimraf build dist dist.*",
"test": "mocha 'test/**/*.test.ts'",
"test:dist": "npm run lint && npm run test && npm run test:deno",
"test:cover": "npm run cover:clean && npx nyc --no-clean npm run 'test' && npm run cover:report",
"test:deno": "deno test test/deno_test.ts",
"test:bun": "bun test test/bun.spec.ts",
"test:fuzz": "npm exec --yes -- jsfuzz@git+https://gitlab.com/gitlab-org/security-products/analyzers/fuzzers/jsfuzz.git#39e6cf16613a0e30c7a7953f62e64292dbd5d3f3 --fuzzTime 60 --no-versifier test/decode.jsfuzz.js corpus",
"cover:clean": "rimraf .nyc_output coverage/",
"cover:report": "npx nyc report --reporter=text-summary --reporter=html --reporter=json",
Expand Down
6 changes: 4 additions & 2 deletions tsconfig.dist.json → tsconfig.dist.cjs.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"declaration": true,
"module": "CommonJS",
"outDir": "./dist.cjs",
"declaration": false,
"noEmitOnError": true,
"noEmit": false,
"incremental": false
},
"include": ["src/**/*.ts"]
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.dist.esm.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "es2020",
"module": "ES2020",
"outDir": "./dist.esm",
"declaration": false,
"declaration": true,
"noEmitOnError": true,
"noEmit": false,
"incremental": false
},
"include": ["src/**/*.ts"]
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.dist.webpack.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "esnext",
"module": "ESNext",
"noEmitOnError": true,
"noEmit": false,
"outDir": "./build/webpack"
},
"include": ["src/**/*.ts"]
Expand Down
7 changes: 5 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* Basic Options */
"target": "ES2020", /* the baseline */
"module": "CommonJS", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"lib": ["ES2024", "dom"], /* Specify library files to be included in the compilation. */
"lib": ["ES2024", "DOM"], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
Expand Down Expand Up @@ -41,6 +41,8 @@
"noPropertyAccessFromIndexSignature": true,
"noImplicitOverride": true,
"verbatimModuleSyntax": false,
// "allowImportingTsExtensions": true,
"noEmit": true,

/* Module Resolution Options */
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
Expand All @@ -55,6 +57,7 @@
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
"resolveJsonModule": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true

// "erasableSyntaxOnly": true
Expand All @@ -69,5 +72,5 @@
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
},
"exclude": ["assembly"]
"exclude": ["example", "benchmark", "test/bun*", "test/deno*", "mod.ts"]
}
3 changes: 2 additions & 1 deletion tsconfig.test-karma.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "esnext",
"module": "ESNext",
"outDir": "./build/karma",
"noEmit": false,
"incremental": false
}
}
1 change: 1 addition & 0 deletions webpack.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const config = {
test: /\.tsx?$/,
loader: "ts-loader",
options: {
transpileOnly: true,
configFile: "tsconfig.dist.webpack.json",
},
},
Expand Down
Loading