Skip to content

Commit 287e4b4

Browse files
authored
add preconstruct (#62)
* add preconstruct * strip out old build steps * turn off no-unresolved for preconstruct * very specific flow ignore * update preconstruct
1 parent 4b3b4a4 commit 287e4b4

File tree

8 files changed

+501
-31
lines changed

8 files changed

+501
-31
lines changed

.changeset/0fcb46d3/changes.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"releases": [
3+
{ "name": "kind2string", "type": "patch" },
4+
{ "name": "pretty-proptypes", "type": "patch" }
5+
],
6+
"dependents": []
7+
}

.changeset/0fcb46d3/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Updated build to use preconstruct (this shouldn't affect usage, but calling this out just in case)

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module.exports = {
2323
rules: {
2424
// Error on prettier violations
2525
'prettier/prettier': 'error',
26-
26+
'import/no-unresolved': 'off',
2727
'prefer-const': 'off',
2828

2929
// New eslint style rules that is not disabled by prettier:

jest.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const preconstruct = require('preconstruct');
2+
3+
module.exports = {
4+
moduleNameMapper: preconstruct.aliases.jest(__dirname)
5+
};

package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,22 @@
1010
"dev:pretty-proptypes": "bolt w pretty-proptypes run dev",
1111
"lint": "yarn eslint \"./**/*.js\"",
1212
"validate": "yarn lint && yarn test && yarn flow",
13-
"build": "bolt ws build"
13+
"build": "preconstruct build",
14+
"clean": "yarn delete:modules && yarn delete:dist",
15+
"delete:dist": "bolt ws exec --parallel -- rm -rf dist",
16+
"delete:modules": "bolt ws exec --parallel -- rm -rf node_modules && rm -rf node_modules"
1417
},
1518
"bolt": {
1619
"workspaces": [
1720
"packages/*"
1821
]
1922
},
23+
"preconstruct": {
24+
"packages": [
25+
"packages/kind2string",
26+
"packages/pretty-proptypes"
27+
]
28+
},
2029
"dependencies": {
2130
"@atlaskit/build-releases": "^3.0.3",
2231
"@babel/core": "7.0.0-beta.56",
@@ -67,6 +76,7 @@
6776
"jest": "^23.6.0",
6877
"jest-in-case": "^1.0.2",
6978
"jsdom": "^11.7.0",
79+
"preconstruct": "^0.0.58",
7080
"prettier": "^1.13.7",
7181
"react": "^16.3.1",
7282
"react-addons-test-utils": "^15.6.2",

packages/kind2string/package.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
{
22
"name": "kind2string",
33
"version": "0.5.3",
4-
"main": "dist/index.js",
4+
"main": "dist/kind2string.cjs.js",
5+
"module": "dist/kind2string.esm.js",
56
"license": "MIT",
67
"author": "Atlassian",
78
"repository": "atlassian/extract-react-types",
89
"description": "Utility to ensure extract-react-types output can be rendered without errors",
9-
"scripts": {
10-
"build": "babel src -d dist --ignore __tests__/",
11-
"prepublish": "yarn build",
12-
"dev": "yarn build --watch"
13-
},
1410
"files": [
1511
"dist"
1612
],
1713
"devDependencies": {
1814
"extract-react-types": "^0.16.1"
1915
},
2016
"dependencies": {}
21-
}
17+
}

packages/pretty-proptypes/package.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@
33
"version": "0.6.0",
44
"description": "prettily render prop types from react components",
55
"repository": "atlassian/extract-react-types",
6-
"main": "dist/index.js",
7-
"scripts": {
8-
"build": "babel src -d dist --ignore *.test.js",
9-
"prepublish": "yarn build",
10-
"dev": "yarn build --watch"
11-
},
6+
"main": "dist/pretty-proptypes.cjs.js",
7+
"module": "dist/pretty-proptypes.esm.js",
128
"keywords": [
139
"extract-react-types",
1410
"react",
@@ -43,4 +39,4 @@
4339
"react-addons-test-utils": "^15.6.2",
4440
"react-dom": "^16.3.1"
4541
}
46-
}
42+
}

0 commit comments

Comments
 (0)