Skip to content

Commit

Permalink
Switch packages to be modules by default.
Browse files Browse the repository at this point in the history
Update build process
closes [#21](#21)
  • Loading branch information
ivandotv committed May 17, 2022
1 parent 0a8b50f commit efa79b5
Show file tree
Hide file tree
Showing 14 changed files with 260 additions and 44 deletions.
9 changes: 9 additions & 0 deletions .changeset/khaki-boats-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'envelop-no-alias': major
'graphql-no-alias': major
---

Switch packages to be `modules` by default.
Update build process

closes [#21](https://github.com/ivandotv/graphql-no-alias/issues/21)
10 changes: 10 additions & 0 deletions .lintstagedrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
'src/**/*.{js,jsx,ts,tsx,json,css,scss,md}': [
'eslint --fix',
'prettier --ignore-unknown --write'
],
'tests/**/*.{js,jsx,ts,tsx,json}': [
'eslint --fix',
'prettier --ignore-unknown --write'
]
}
10 changes: 0 additions & 10 deletions .lintstagedrc.json

This file was deleted.

File renamed without changes.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"release": "pnpm multi run prepublishOnly --workspace-concurrency 1 && pnpm changeset publish"
},
"dependencies": {
"husky": "^7.0.4",
"lint-staged": "^12.2.2",
"prettier": "^2.5.1"
"husky": "^8.0.1",
"lint-staged": "^12.4.1",
"prettier": "^2.6.2"
},
"devDependencies": {
"@changesets/cli": "^2.19.0",
"del": "^6.0.0",
"minimist": "^1.2.5"
"@changesets/cli": "^2.22.0",
"del": "^6.1.0",
"minimist": "^1.2.6"
}
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const baseConfig = require('../../jest.config')
const baseConfig = require('../../jest.config.cjs')

module.exports = {
...baseConfig,
Expand Down
10 changes: 6 additions & 4 deletions packages/envelop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
],
"author": "ivandotv",
"license": "MIT",
"main": "./dist/prod/envelop-no-alias.js",
"type": "module",
"main": "./dist/prod/index.cjs",
"module": "./dist/prod/index.modern.js",
"exports": {
"import": "./dist/prod/envelop-no-alias.esm.js",
"require": "./dist/prod/envelop-no-alias.js"
"require": "./dist/prod/index.cjs",
"default": "./dist/prod/index.modern.js"
},
"types": "./dist/types/index.d.ts",
"files": [
Expand All @@ -34,7 +36,7 @@
"test": "jest --verbose --coverage --no-cache",
"test:watch": "jest --watch",
"test:ci": "jest --runInBand --ci --coverage --coverageDirectory=coverage",
"build:prod": "NODE_ENV=production microbundle --tsconfig ./tsconfig.json --format modern,cjs --target node --output dist/prod",
"build:prod": "NODE_ENV=production microbundle --tsconfig ./tsconfig.json --format modern,cjs --output dist/prod/index.js",
"build": "rm -rf ./dist && pnpm build:prod",
"prepublishOnly": "pnpm build",
"release": "pnpm run prepublishOnly && pnpm changeset publish"
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const baseConfig = require('../../jest.config')
const baseConfig = require('../../jest.config.cjs')

module.exports = {
...baseConfig,
Expand Down
10 changes: 6 additions & 4 deletions packages/no-alias/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
],
"author": "ivandotv",
"license": "MIT",
"main": "./dist/prod/graphql-no-alias.js",
"type": "module",
"main": "./dist/prod/index.cjs",
"module": "./dist/prod/index.modern.js",
"exports": {
"import": "./dist/prod/graphql-no-alias.esm.js",
"require": "./dist/prod/graphql-no-alias.js"
"require": "./dist/prod/index.cjs",
"default": "./dist/prod/index.modern.js"
},
"types": "./dist/types/index.d.ts",
"files": [
Expand All @@ -32,7 +34,7 @@
"test": "NODE_ENV=test jest --verbose --coverage --no-cache",
"test:watch": "NODE_ENV=test jest --watch",
"test:ci": "NODE_ENV=test jest --runInBand --ci --coverage --coverageDirectory=coverage",
"build:prod": "NODE_ENV=production microbundle --tsconfig ./tsconfig.json --format modern,cjs --target node --output dist/prod",
"build:prod": "NODE_ENV=production microbundle --tsconfig ./tsconfig.json --format modern,cjs --output dist/prod/index.js",
"build": "rm -rf ./dist && pnpm build:prod",
"prepublishOnly": "pnpm build",
"release": "pnpm run prepublishOnly && pnpm changeset publish"
Expand Down
Loading

0 comments on commit efa79b5

Please sign in to comment.