Skip to content

Commit

Permalink
Drop support for CommonJS. This package is native ESM now.
Browse files Browse the repository at this point in the history
If your project uses CommonJS, you will have to convert to ESM or use the dynamic import() function
  • Loading branch information
mjradwin committed Nov 8, 2024
1 parent 4e2e58e commit d205307
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 134 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
node-version: [16.x, 18.x, 20.x, 22.x]
node-version: [18.x, 20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down
23 changes: 0 additions & 23 deletions bin/leyning-csv

This file was deleted.

108 changes: 40 additions & 68 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 11 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hebcal/leyning",
"version": "9.0.0",
"version": "9.0.1",
"author": "Michael J. Radwin (https://github.com/mjradwin)",
"keywords": [
"hebcal",
Expand All @@ -16,13 +16,12 @@
"parashah"
],
"description": "Torah Reading API for Parashat HaShavua and holidays",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"module": "./dist/esm/index.js",
"typings": "dist/esm/index.d.ts",
"type": "module",
"exports": {
".": {
"import": "./dist/esm/index.js",
"require": "./dist/index.cjs",
"types": "./dist/esm/index.d.ts"
},
"./dist/esm/*": "./dist/esm/*.js"
Expand All @@ -34,17 +33,15 @@
"bugs": {
"url": "https://github.com/hebcal/hebcal-leyning/issues"
},
"typings": "dist/es/index.d.ts",
"files": [
"dist",
"bin"
"dist"
],
"bin": {
"leyning-csv": "bin/leyning-csv"
},
"engines": {
"node": ">=18"
},
"dependencies": {
"@hebcal/core": "^5.7.6",
"@hebcal/hdate": "^0.11.6",
"@hebcal/core": "^5.7.7",
"@hebcal/hdate": "^0.12.0",
"tslib": "^2.8.1"
},
"scripts": {
Expand Down Expand Up @@ -80,14 +77,13 @@
"@types/node": "^22.9.0",
"gts": "^5.3.1",
"jest": "^29.7.0",
"rollup": "^4.24.4",
"@rollup/plugin-babel": "^6.0.4",
"pretty-bytes": "^6.1.1",
"rollup": "^4.24.4",
"rollup-plugin-bundle-size": "^1.0.3",
"rollup-plugin-visualizer": "^5.12.0",
"ts-jest": "^29.2.5",
"ttag-cli": "^1.10.12",
"typedoc": "^0.26.11",
"typescript": "^5.6.3"
}
}
}
15 changes: 1 addition & 14 deletions rollup.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,7 @@ const iifeGlobals = {
const tsOptions = {rootDir: './src'};
module.exports = defineConfig([
{
input: 'src/index.ts',
output: [{file: pkg.main, format: 'cjs', name: pkg.name, banner}],
// Explicitly exclude @hebcal packages for use with `npm link`.
external: [/node_modules/, /@hebcal/],
plugins: [
typescript(tsOptions),
nodeResolve(),
commonjs(),
json({compact: true, preferConst: true}),
bundleSize(),
],
},
{
input: 'src/index.ts',
input: ['src/index.ts', 'src/csv.ts'],
output: [
{
dir: 'dist/esm',
Expand Down
13 changes: 0 additions & 13 deletions tsconfig-cjs.json

This file was deleted.

0 comments on commit d205307

Please sign in to comment.