Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 31 additions & 14 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,29 +1,46 @@
{
"presets": [
["@babel/preset-env", {
"shippedProposals": true,
"targets": {
"node": "8"
[
"@babel/preset-env", {
"modules": false,
"shippedProposals": true,
"targets": {
"node": 8
}
}
}],
],
"@babel/preset-react",
"@babel/preset-flow"
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-syntax-dynamic-import"
[
"module-resolver",
{
"cwd": "babelrc",
"alias": {
"^(flowtip-core|flowtip-react-dom)/(lib|es|src)($|/.*$)":
"./packages/\\1/src/\\3",
"^(flowtip-core|flowtip-react-dom)$": "./packages/\\1/src",
}
}
]
],
"env": {
"test": {
"plugins": [
["module-resolver", {
"alias": {
"flowtip-core/lib": "./packages/flowtip-core/src",
"flowtip-core": "./packages/flowtip-core/src",
"flowtip-react-dom/lib": "./packages/flowtip-react-dom/src",
"flowtip-react-dom": "./packages/flowtip-react-dom/src",
}
}]
"@babel/plugin-transform-modules-commonjs"
]
},
"lib": {
"plugins": [
"@babel/plugin-transform-modules-commonjs",
["module-resolver", {}]
]
},
"es": {
"plugins": [
["module-resolver", {}]
]
}
}
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
coverage
dist
es
lib
flow-typed
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ suppress_comment=\\(.\\|\n\\)*\\$ExpectError
# Map requests to `lib` folder in each package to `src`. This makes flow
# reference the src files and prevents the need for running the prepare script
# when flow-checking changes across packages.
module.name_mapper='^\(flowtip-core\|flowtip-react-dom\)/lib\($\|/.*$\)' -> '<PROJECT_ROOT>/packages/\1/src\2'
module.name_mapper='^\(flowtip-core\|flowtip-react-dom\)/\(lib\|es\|src\)\($\|/.*$\)' -> '<PROJECT_ROOT>/packages/\1/src\3'
module.name_mapper='^\(flowtip-core\|flowtip-react-dom\)$' -> '<PROJECT_ROOT>/packages/\1/src'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
*.log
coverage
es
lib
dist
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
coverage
dist
es
lib
flow-typed
125 changes: 119 additions & 6 deletions package-lock.json

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

18 changes: 12 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
{
"private": true,
"name": "flowtip-packages",
"scripts": {
"flow": "./node_modules/.bin/flow",
"format": "./node_modules/.bin/prettier --write '**/*.js'",
"lerna": "./node_modules/.bin/lerna",
"lint": "./node_modules/.bin/eslint .",
"prepare": "./node_modules/.bin/lerna bootstrap",
"spec": "./node_modules/.bin/jest --runInBand=${SPEC_SERIAL:-$CI} --coverage=${SPEC_COVERAGE:-$CI}",
"build": "npm run clean && npm run build:flow && npm run build:es && npm run build:lib",
"build:es": "BABEL_ENV=es npx babel --copy-files -s --relative -d ../es packages/*/src",
"build:flow": "npx lerna exec ncp src es && npx lerna exec ncp src lib && npx renamer --regex --find '$' --replace '.flow' 'packages/*/@(es|lib)/**/*.js'",
"build:lib": "BABEL_ENV=lib npx babel --copy-files -s --relative -d ../lib packages/*/src",
"clean": "npx lerna exec rimraf lib es",
"flow": "npx flow",
"format": "npx prettier --write '**/*.js'",
"lint": "npx eslint .",
"prepare": "npx lerna bootstrap && npm run build",
"spec": "npx jest --runInBand=${SPEC_SERIAL:-$CI} --coverage=${SPEC_COVERAGE:-$CI}",
"spec:watch": "npm run spec -- --watch",
"test": "npm run flow --silent && npm run lint --slient && npm run spec --silent"
},
"devDependencies": {
"@babel/cli": "^7.0.0-beta.40",
"@babel/core": "^7.0.0-beta.40",
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.40",
"@babel/plugin-transform-modules-commonjs": "^7.0.0-beta.42",
"@babel/preset-env": "^7.0.0-beta.40",
"@babel/preset-flow": "^7.0.0-beta.40",
"@babel/preset-react": "^7.0.0-beta.40",
Expand Down
16 changes: 7 additions & 9 deletions packages/flowtip-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
"version": "5.1.0",
"author": "Neal Granger <neal@nealg.com>",
"main": "./lib",
"module": "./es",
"sideEffects": false,
"files": [
"lib",
"es"
],
"repository": {
"type": "git",
"url": "https://github.com/metalabdesign/flowtip.git"
Expand All @@ -19,13 +25,5 @@
"url": "https://github.com/qiushihe/metalabdesign/issues"
},
"homepage": "https://github.com/metalabdesign/flowtip/tree/master/packages/flowtip-react-dom",
"files": [
"lib"
],
"scripts": {
"clean": "../../node_modules/.bin/rimraf lib",
"build": "../../node_modules/.bin/babel --copy-files -s -d lib src",
"copy": "../../node_modules/.bin/ncp src lib && ../../node_modules/.bin/renamer --regex --find '$' --replace '.flow' 'lib/**/*.js'",
"prepare": "npm run clean && npm run copy && npm run build"
}
"sideEffects": false
}
16 changes: 7 additions & 9 deletions packages/flowtip-react-dom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
"version": "5.1.0",
"author": "Neal Granger <neal@nealg.com>",
"main": "./lib",
"module": "./es",
"sideEffects": false,
"files": [
"README.md",
"lib",
"es"
],
"repository": {
"type": "git",
"url": "https://github.com/metalabdesign/flowtip.git"
Expand All @@ -19,15 +26,6 @@
"url": "https://github.com/qiushihe/metalabdesign/issues"
},
"homepage": "https://github.com/metalabdesign/flowtip/tree/master/packages/flowtip-react-dom",
"files": [
"lib"
],
"scripts": {
"clean": "../../node_modules/.bin/rimraf lib",
"build": "../../node_modules/.bin/babel --copy-files -s -d lib src",
"copy": "../../node_modules/.bin/ncp src lib && ../../node_modules/.bin/renamer --regex --find '$' --replace '.flow' 'lib/**/*.js'",
"prepare": "npm run clean && npm run copy && npm run build"
},
"dependencies": {
"flowtip-core": "^5.1.0",
"react-resize-observer": "^0.2.1"
Expand Down