Skip to content

Commit

Permalink
Merge pull request #55 from octet-stream/esm
Browse files Browse the repository at this point in the history
  • Loading branch information
octet-stream authored Jun 12, 2022
2 parents 3e8109a + 50586bd commit b7b3444
Show file tree
Hide file tree
Showing 40 changed files with 1,072 additions and 1,539 deletions.
4 changes: 2 additions & 2 deletions .c8rc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"include": ["lib/**/**.ts"],
"exclude": ["lib/__helper__", "lib/**/*.test.ts"]
"include": ["src/**/*.ts"],
"exclude": ["src/__helper__", "src/**/*.test.ts"]
}
39 changes: 4 additions & 35 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,65 +1,34 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.eslint.json"
},
"env": {
"browser": true,
"node": true
},
"plugins": [
"@typescript-eslint",
"ava"
],
"extends": [
"airbnb-typescript",
"@octetstream",
"plugin:ava/recommended"
"plugin:ava/recommended",
"@octetstream/eslint-config/esm/typescript"
],
"settings": {
"import/resolver": {
"typescript": {}
}
},
"rules": {
"no-void": 0,
"func-names": 0,
"no-shadow": 0,
"no-use-before-define": 0,
"max-len": [
"error",
{
"code": 80,
"ignoreComments": true
}
],
"import/no-unresolved": [
"error",
{
"ignore": [
"dinky.js"
"formdata-node"
]
}
],

"no-plusplus": 0,

// These two rules are false-positive and have no solution for TS
"no-redeclare": 0,
"no-dupe-class-members": 0,
"lines-between-class-members": 0,

"@typescript-eslint/semi": 0,
"@typescript-eslint/no-shadow": 0,
"@typescript-eslint/quotes": [
"error",
"double"
],
"@typescript-eslint/object-curly-spacing": [
"error",
"never"
],
"@typescript-eslint/comma-dangle": 0
"lines-between-class-members": 0
}
}
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ jobs:
node-version: ${{ matrix.node }}

- name: Setup pnpm
uses: pnpm/action-setup@v2.0.1
uses: pnpm/action-setup@v2
with:
version: 6.2.1
run_install: true

- run: pnpm run ci

- name: Upload codecov report
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
if: matrix.node == '16.x' && matrix.os == 'ubuntu-latest'
with:
file: ./coverage/coverage-final.json
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ coverage
*.old
@type

/lib/**/*.js
/lib
8 changes: 3 additions & 5 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ pnpm-lock.yaml
/.editorconfig
/.eslintrc.json
/.lintstagedrc
/ava.config.cjs
/ava.config.js
/yarn.lock
/test.mjs
/tsconfig.json
/tsconfig.esm.json
/tsconfig.cjs.json
/tsconfig.eslint.json
/tsconfig.d.ts.json
/tsconfig.ava.json
/lib/**/*.ts
/src/**/*.ts

!/lib/node-domexception.d.ts
!/src/node-domexception.d.ts
14 changes: 0 additions & 14 deletions ava.config.cjs

This file was deleted.

11 changes: 11 additions & 0 deletions ava.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export default {
extensions: {
ts: "module"
},
nodeArguments: [
"--loader=ts-node/esm/transpile-only"
],
files: [
"src/**/*.test.ts"
]
}
3 changes: 0 additions & 3 deletions lib/__helper__/sleep.ts

This file was deleted.

3 changes: 0 additions & 3 deletions lib/cjs/package.json

This file was deleted.

8 changes: 0 additions & 8 deletions lib/deprecateConstructorEntries.ts

This file was deleted.

3 changes: 0 additions & 3 deletions lib/esm/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions lib/index.ts

This file was deleted.

69 changes: 31 additions & 38 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "formdata-node",
"version": "4.3.3",
"type": "module",
"description": "Spec-compliant FormData implementation for Node.js",
"repository": "octet-stream/form-data",
"sideEffects": false,
Expand All @@ -14,28 +15,25 @@
],
"author": "Nick K. <[email protected]>",
"license": "MIT",
"main": "./lib/cjs/index.js",
"module": "./lib/esm/browser.js",
"browser": "./lib/cjs/browser.js",
"main": "./lib/index.js",
"module": "./lib/browser.js",
"browser": "./lib/browser.js",
"exports": {
"./package.json": "./package.json",
".": {
"node": {
"types": "./@type/index.d.ts",
"import": "./lib/esm/index.js",
"require": "./lib/cjs/index.js"
"import": "./lib/index.js"
},
"browser": {
"types": "./@type/browser.d.ts",
"import": "./lib/esm/browser.js",
"require": "./lib/cjs/browser.js"
"import": "./lib/browser.js"
},
"default": "./lib/esm/index.js"
"default": "./lib/index.js"
},
"./file-from-path": {
"types": "./@type/fileFromPath.d.ts",
"import": "./lib/esm/fileFromPath.js",
"require": "./lib/cjs/fileFromPath.js"
"import": "./lib/fileFromPath.js"
}
},
"types": "./@type/index.d.ts",
Expand All @@ -47,51 +45,46 @@
}
},
"engines": {
"node": ">= 12.20"
"node": ">= 14.17"
},
"scripts": {
"eslint": "eslint lib/**/*.ts",
"eslint": "eslint src/**/*.ts",
"staged": "lint-staged",
"coverage": "c8 npm test",
"report:html": "c8 -r=html npm test",
"ci": "c8 npm test && c8 report --reporter=json",
"build:esm": "ttsc --project tsconfig.esm.json",
"build:cjs": "ttsc --project tsconfig.cjs.json",
"build:types": "ttsc --project tsconfig.d.ts.json",
"build": "npm run build:esm && npm run build:cjs && npm run build:types",
"build:types": "tsc --project tsconfig.d.ts.json",
"build": "tsc && npm run build:types",
"test": "ava --fail-fast",
"cleanup": "npx rimraf @type \"lib/**/*.js\"",
"cleanup": "del-cli @type lib",
"prepare": "npm run cleanup && npm run build",
"postinstall": "husky install",
"prepublishOnly": "pinst --disable",
"postpublish": "pinst --enable"
},
"devDependencies": {
"@octetstream/eslint-config": "5.0.0",
"@types/node": "17.0.19",
"@octetstream/eslint-config": "6.2.1",
"@types/node": "17.0.42",
"@types/sinon": "10.0.11",
"@typescript-eslint/eslint-plugin": "4.32.0",
"@typescript-eslint/parser": "4.32.0",
"@zoltu/typescript-transformer-append-js-extension": "1.0.1",
"ava": "4.0.1",
"c8": "7.11.0",
"eslint": "7.32.0",
"eslint-config-airbnb-typescript": "12.3.1",
"eslint-import-resolver-typescript": "2.5.0",
"eslint-plugin-ava": "12.0.0",
"eslint-plugin-jsx-a11y": "6.4.1",
"eslint-plugin-react": "7.26.1",
"husky": "7.0.4",
"lint-staged": "12.3.4",
"@typescript-eslint/eslint-plugin": "5.27.1",
"@typescript-eslint/parser": "5.27.1",
"ava": "4.3.0",
"c8": "7.11.3",
"del-cli": "4.0.1",
"eslint": "8.17.0",
"eslint-config-airbnb-typescript": "17.0.0",
"eslint-import-resolver-typescript": "2.7.1",
"eslint-plugin-ava": "13.2.0",
"eslint-plugin-import": "^2.26.0",
"husky": "8.0.1",
"lint-staged": "13.0.1",
"pinst": "3.0.0",
"rimraf": "^3.0.2",
"sinon": "13.0.1",
"ts-node": "10.5.0",
"ttypescript": "1.5.13",
"typescript": "4.5.5"
"sinon": "14.0.0",
"ts-node": "10.8.1",
"typescript": "4.7.3"
},
"dependencies": {
"node-domexception": "1.0.0",
"web-streams-polyfill": "4.0.0-beta.1"
"web-streams-polyfill": "4.0.0-beta.2"
}
}
Loading

0 comments on commit b7b3444

Please sign in to comment.