Skip to content

Commit

Permalink
chore(build): add CJS, ESM, bundled ESM, and bundled UMD artifacts
Browse files Browse the repository at this point in the history
feat(tooling): switch from npm to pnpm

chore(tooling): convert config to JSON format

- Build CJS, ESM, bundled ESM and bundled UMD artifacts
- Use pnpm instead of npm
- Convert eslint config to JSON
  • Loading branch information
buzz committed Jul 28, 2023
1 parent 6636ee6 commit 5b2e332
Show file tree
Hide file tree
Showing 14 changed files with 4,850 additions and 15,647 deletions.
17 changes: 0 additions & 17 deletions .eslintrc.js

This file was deleted.

17 changes: 17 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"env": {
"node": true,
"es6": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"extends": ["plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
"plugins": ["prettier"],
"root": true,
"rules": {
"prettier/prettier": "error"
}
}
23 changes: 0 additions & 23 deletions __tests__/.eslintrc.js

This file was deleted.

23 changes: 23 additions & 0 deletions __tests__/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"env": {
"es6": true,
"node": true,
"jest/globals": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"extends": ["plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
"plugins": ["jest", "prettier"],
"rules": {
"jest/no-disabled-tests": "off",
"jest/no-focused-tests": "error",
"jest/no-identical-title": "error",
"jest/prefer-to-have-length": "warn",
"jest/valid-expect": "error",
"prettier/prettier": "error"
},
"root": true
}
27 changes: 25 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
module.exports = {
presets: [['@babel/preset-env', { targets: { node: 'current' } }], '@babel/preset-typescript'],
export default () => {
const sharedPresets = ['@babel/preset-typescript']

const shared = {
ignore: ['./src/cli.ts', './__tests__', './**/*.d.ts'],
presets: sharedPresets,
sourceMaps: true,
}

return {
env: {
ESM_UNBUNDLED: shared,
ESM_BUNDLED: {
...shared,
presets: [['@babel/preset-env', { targets: '> 0.25%, not dead' }], ...sharedPresets],
},
CJS: {
...shared,
presets: [
['@babel/preset-env', { modules: 'commonjs', targets: { node: 'current' } }],
...sharedPresets,
],
},
},
}
}
11 changes: 0 additions & 11 deletions examples/browser-multiple/.eslintrc.js

This file was deleted.

11 changes: 11 additions & 0 deletions examples/browser-multiple/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"env": {
"browser": true
},
"globals": {
"MediaInfo": "readonly"
},
"parserOptions": {
"sourceType": "script"
}
}
11 changes: 0 additions & 11 deletions examples/browser-simple/.eslintrc.js

This file was deleted.

11 changes: 11 additions & 0 deletions examples/browser-simple/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"env": {
"browser": true
},
"globals": {
"MediaInfo": "readonly"
},
"parserOptions": {
"sourceType": "script"
}
}
Loading

0 comments on commit 5b2e332

Please sign in to comment.