Skip to content

Commit

Permalink
chore: convert source to CommonJs and publish source directly
Browse files Browse the repository at this point in the history
Allow us to work on the code as it's going to run
instead of the hybrid ConnonJS-ESM format that cannot run anywhere
natively.
`babel-plugin-add-module-exports` always overwrote module.exports,
so the module.exports.default that Babel created was not
visible to consumers.
I've tested importing the code from CommonJS and native ESM.
  • Loading branch information
ludofischer committed Feb 5, 2022
1 parent d491fba commit b55adcb
Show file tree
Hide file tree
Showing 17 changed files with 67 additions and 1,061 deletions.
7 changes: 0 additions & 7 deletions .babelrc

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules
test/fixtures/*.actual.css
dist
src/parser.js
yarn-error.log
24 changes: 11 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,41 @@
"calculation",
"calc"
],
"main": "dist/index.js",
"main": "src/index.js",
"types": "types/index.d.ts",
"files": [
"dist",
"src",
"types",
"LICENSE"
],
"scripts": {
"prepare": "pnpm run build && tsc",
"build": "rimraf dist && babel src --out-dir dist --ignore src/__tests__/**/*.js && jison src/parser.jison -o dist/parser.js",
"build": "jison src/parser.jison -o src/parser.js",
"lint": "eslint src && tsc",
"pretest": "pnpm run build",
"test": "uvu -r @babel/register src/__tests__"
"test": "uvu src/__tests__"
},
"author": "Andy Jansson",
"license": "MIT",
"repository": "https://github.com/postcss/postcss-calc.git",
"eslintConfig": {
"extends": [
"eslint:recommended",
"plugin:import/recommended"
"eslint:recommended"
],
"env": {
"node": true,
"es2017": true
},
"ignorePatterns": ["src/parser.js"],
"rules": {
"curly": "error"
}
},
"devDependencies": {
"@babel/cli": "^7.16.8",
"@babel/core": "^7.16.12",
"@babel/plugin-transform-modules-commonjs": "^7.16.8",
"@babel/register": "^7.16.9",
"babel-plugin-add-module-exports": "^1.0.0",
"@types/node": "^17.0.14",
"eslint": "^8.7.0",
"eslint-plugin-import": "^2.25.4",
"jison-gho": "^0.6.1-216",
"postcss": "^8.2.2",
"rimraf": "^3.0.2",
"typescript": "^4.5.5",
"uvu": "^0.5.3"
},
Expand Down
Loading

0 comments on commit b55adcb

Please sign in to comment.