Skip to content

Commit

Permalink
Merge 52affed into 846caa3
Browse files Browse the repository at this point in the history
  • Loading branch information
spautz committed Mar 1, 2020
2 parents 846caa3 + 52affed commit 8c20c16
Show file tree
Hide file tree
Showing 52 changed files with 2,454 additions and 217 deletions.
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

8 changes: 8 additions & 0 deletions .eslintrc.js
Expand Up @@ -15,6 +15,14 @@ module.exports = {
},

rules: {},
ignorePatterns: [
'build/',
'dist/',
'coverage/',
'coverage-local/',
'node_modules/',
'storybook-static/',
],
overrides: [
{
files: ['*.js'],
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -6,5 +6,6 @@
build/
dist/
coverage/
coverage-local/
node_modules/
storybook-static/
4 changes: 4 additions & 0 deletions .prettierignore
@@ -1,3 +1,6 @@
# Unless https://github.com/prettier/prettier/issues/4081 is ever resolved,
# this MUST be copied into each package dir for local runs to work.

# Whitelist supported files only
**/*.*
!**/*.css
Expand All @@ -15,5 +18,6 @@
build/
dist/
coverage/
coverage-local/
node_modules/
storybook-static/
7 changes: 0 additions & 7 deletions .prettierrc

This file was deleted.

2 changes: 1 addition & 1 deletion .storybook/main.js
@@ -1,5 +1,5 @@
module.exports = {
stories: ['../stories/**/*.stories.(js|ts|jsx|tsx)'],
stories: ['../packages/**/stories/**/*.stories.(js|ts|jsx|tsx)'],
addons: ['@storybook/addon-knobs/register', '@storybook/preset-typescript'],
webpackFinal: async (config) => {
config.module.rules.push({
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -51,7 +51,7 @@ Set a falsy value to disable.

Time after which a subtree is removed from the cache. Set a falsy value to disable.

#### `StaticWrapperComponent` (React component, default: [StaticComponentContainer](./src/StaticContainers/StaticComponentContainer.tsx))
#### `StaticWrapperComponent` (React component, default: none)

A component which wraps all potentially-hibernatable routes. It receives a `shouldUpdate` prop. See the
"Preventing Extra Work" section below.
Expand Down
4 changes: 4 additions & 0 deletions babel.config.js
@@ -0,0 +1,4 @@
/* eslint-env node */
module.exports = {
presets: ['@babel/react', '@babel/preset-typescript'],
};
12 changes: 12 additions & 0 deletions jest-base.config.js
@@ -0,0 +1,12 @@
/* eslint-env node */

module.exports = {
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
testRegex: '(/__tests__/.*|/tests/.*|(\\.|/)(test|spec))\\.[jt]sx?$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
modulePathIgnorePatterns: ['dist/'],
collectCoverage: true,
coverageReporters: ['json', 'html'],
};
7 changes: 7 additions & 0 deletions jest.config.js
@@ -0,0 +1,7 @@
/* eslint-env node */
const baseConfig = require('./jest-base.config');

module.exports = {
...baseConfig,
projects: ['<rootDir>/packages/*/'],
};
7 changes: 7 additions & 0 deletions lerna.json
@@ -0,0 +1,7 @@
{
"lerna": "3.20.2",
"packages": ["packages/*"],
"version": "0.0.2",
"npmClient": "yarn",
"useWorkspaces": true
}
120 changes: 36 additions & 84 deletions package.json
@@ -1,68 +1,53 @@
{
"name": "react-router-hibernate",
"version": "0.0.2",
"description": "A react-router Switch which can leave inactive routes mounted-but-inactive until you navigate back",
"keywords": [],
"name": "react-hibernate-workspace",
"private": true,
"license": "MIT",
"homepage": "https://github.com/spautz/react-router-hibernate#readme",
"homepage": "https://github.com/spautz/react-hibernate#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/spautz/react-router-hibernate.git"
"url": "git+https://github.com/spautz/react-hibernate.git"
},
"bugs": {
"url": "https://github.com/spautz/react-router-hibernate/issues"
"url": "https://github.com/spautz/react-hibernate/issues"
},
"author": "Steven Pautz <spautz@gmail.com>",
"files": [
"dist/",
"src/",
"LICENSE",
"README.md"
],
"source": "src/index.ts",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"jsnext:main": "dist/index.esm.js",
"types": "dist/src/index.d.ts",
"sideEffects": false,
"scripts": {
"____ BASE COMMANDS _________________________________________________": "",
"build": "microbundle build --jsx React.createElement",
"build:watch": "microbundle watch --jsx React.createElement",
"clean": "rimraf dist/ storybook-static/",
"format": "prettier --write \"**/*.*\"",
"format:check": "prettier --list-different \"**/*.*\"",
"lint": "eslint \"**/*.{js,jsx,json,ts,tsx}\"",
"prepare": "yon build",
"release": "standard-version --sign --release-as ",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
"build:all": "lerna exec yon build",
"clean:all": "rimraf storybook-static/ && lerna exec yon clean",
"prepare:all": "lerna exec yon prepare",
"test": "jest",
"test:clean": "rimraf coverage/",
"test:coverage": "jest --coverage",
"test:report": "jest --coverage --coverageReporters=text-lcov | coveralls",
"test:watch": "jest --watch",
"format": "prettier --write \"**/*.*\"",
"format:checkup": "prettier --list-different \"**/*.*\"",
"lint": "eslint \"**/*.{js,jsx,json,ts,tsx}\"",
"release": "standard-version --sign --release-as ",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
"types": "tsc --noEmit --p tsconfig.json --jsx react",
"____ HOOKS _________________________________________________________": "",
"prebuild": "yon clean",
"prerelease": "yon clean",
"prepublishOnly": "yon check && yon build",
"prepare": "lerna bootstrap && yon prepare:all",
"prepublishOnly": "yon checkup:all && yon build:all",
"prerelease": "yon clean:all",
"pretest": "yon test:clean",
"____ INTEGRATION ___________________________________________________": "",
"dev": "yon run format && yon run types && yon run lint",
"check": "yon format:check && yon run types && yon run lint",
"ci": "yon run check && yon run test:report && yon run build && yon run build-storybook",
"all": "yon run dev && yon run test:coverage && yon run build && yon run build-storybook"
},
"dependencies": {
"limited-cache": "^0.3.0",
"prop-types": "^15.7.2",
"react-is": "^16.12.0",
"react-reverse-portal": "^1.0.5"
"checkup": "yon format:checkup && yon run types && yon run lint",
"all": "yon run dev && yon run test:coverage",
"dev:all": "yon dev && lerna exec yon dev",
"checkup:all": "yon checkup && lerna exec yon checkup",
"all:all": "yon all && lerna exec yon all",
"ci": "yon run checkup:all && yon run test:report && yon run build:all && yon run build-storybook"
},
"dependencies": {},
"devDependencies": {
"@babel/core": "^7.8.4",
"@material-ui/core": "^4.9.4",
"@babel/core": "^7.8.6",
"@babel/preset-react": "^7.8.3",
"@babel/preset-typescript": "^7.8.3",
"@storybook/addon-knobs": "^5.3.14",
"@storybook/addons": "^5.3.14",
"@storybook/preset-typescript": "^1.2.0",
Expand All @@ -71,7 +56,7 @@
"@testing-library/react": "^9.4.1",
"@types/history": "^4.7.5",
"@types/jest": "^25.1.3",
"@types/node": "^13.7.6",
"@types/node": "^13.7.7",
"@types/react": "^16.9.23",
"@types/react-is": "^16.7.1",
"@types/react-redux": "^7.1.7",
Expand All @@ -85,10 +70,11 @@
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-react": "^7.18.3",
"fork-ts-checker-webpack-plugin": "^4.0.4",
"fork-ts-checker-webpack-plugin": "^4.0.5",
"history": "^4.10.1",
"husky": "^4.2.3",
"jest": "^25.1.0",
"lerna": "^3.20.2",
"lint-staged": "^10.0.7",
"microbundle": "^0.12.0-next.8",
"prettier": "^1.19.1",
Expand All @@ -104,47 +90,10 @@
"standard-version": "^7.1.0",
"ts-jest": "^25.2.1",
"ts-loader": "^6.2.1",
"tslib": "^1.10.0",
"typeface-roboto": "^0.0.75",
"typescript": "^3.7.5",
"tslib": "^1.11.1",
"typescript": "^3.8.3",
"yarn-or-npm": "^3.0.1"
},
"peerDependencies": {
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
"react-redux": ">=7.0.0",
"react-router": ">=5.0.0"
},
"peerDependenciesMeta": {
"react-redux": {
"optional": true
}
},
"jest": {
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
"testRegex": "(/__tests__/.*|/tests/.*|(\\.|/)(test|spec))\\.[jt]sx?$",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
],
"modulePathIgnorePatterns": [
"dist/"
],
"collectCoverage": true,
"coveragePathIgnorePatterns": [
"/util/"
],
"coverageReporters": [
"json",
"html"
]
},
"lint-staged": {
"**/*.{css,html,js,jsx,json,less,md,scss,ts,tsx}": [
"prettier --write"
Expand All @@ -159,5 +108,8 @@
"scripts": {
"postchangelog": "yon format"
}
}
},
"workspaces": [
"packages/*"
]
}
23 changes: 23 additions & 0 deletions packages/react-hibernate-dev-helpers/.prettierignore
@@ -0,0 +1,23 @@
# Unless https://github.com/prettier/prettier/issues/4081 is ever resolved,
# this MUST be copied into each package dir for local runs to work.

# Whitelist supported files only
**/*.*
!**/*.css
!**/*.html
!**/*.js
!**/*.jsx
!**/*.json
!**/*.less
!**/*.md
!**/*.scss
!**/*.ts
!**/*.tsx

# Unless they're somewhere we can ignore
build/
dist/
coverage/
coverage-local/
node_modules/
storybook-static/
68 changes: 68 additions & 0 deletions packages/react-hibernate-dev-helpers/package.json
@@ -0,0 +1,68 @@
{
"name": "react-hibernate-dev-helpers",
"version": "0.0.2",
"description": "A react-router Switch which can leave inactive routes mounted-but-inactive until you navigate back",
"keywords": [],
"license": "MIT",
"homepage": "https://github.com/spautz/react-router-hibernate/packages/dev-helpers#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/spautz/react-router-hibernate.git"
},
"bugs": {
"url": "https://github.com/spautz/react-router-hibernate/issues"
},
"author": "Steven Pautz <spautz@gmail.com>",
"files": [
"dist/",
"src/",
"LICENSE",
"README.md"
],
"source": "src/index.ts",
"main": "dist/index.js",
"module": "dist/index.esm.js",
"jsnext:main": "dist/index.esm.js",
"types": "dist/react-hibernate-dev-helpers/src/index.d.ts",
"sideEffects": false,
"scripts": {
"____ BASE COMMANDS _________________________________________________": "",
"build": "microbundle build --jsx React.createElement",
"build:watch": "microbundle watch --jsx React.createElement",
"clean": "rimraf dist/",
"format": "prettier --write \"**/*.*\"",
"format:checkup": "prettier --list-different \"**/*.*\"",
"lint": "eslint \"**/*.{js,jsx,json,ts,tsx}\"",
"test": "echo \"@TODO: tests for dev-helpers\"",
"test:clean": "rimraf coverage/",
"test:coverage": "echo \"@TODO: tests for dev-helpers\"",
"test:watch": "echo \"@TODO: tests for dev-helpers\"",
"types": "tsc --noEmit --p tsconfig.json --jsx react",
"____ HOOKS _________________________________________________________": "",
"prepare": "yon build",
"prebuild": "yon clean",
"prerelease": "yon clean",
"prepublishOnly": "yon checkup && yon build",
"pretest": "yon test:clean",
"____ INTEGRATION ___________________________________________________": "",
"dev": "yon run format && yon run types && yon run lint",
"checkup": "yon format:checkup && yon run types && yon run lint",
"all": "yon run dev && yon run test:coverage && yon run build"
},
"dependencies": {
"@material-ui/core": "^4.9.4",
"@testing-library/react": "^9.4.1",
"history": "^4.10.1",
"react-is": "^16.13.0",
"react-redux": "^7.2.0",
"react-router": "^5.1.2",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.8",
"typeface-roboto": "^0.0.75"
},
"devDependencies": {},
"peerDependencies": {
"react": ">=16.8.0",
"react-dom": ">=16.8.0"
}
}
4 changes: 4 additions & 0 deletions packages/react-hibernate-dev-helpers/prettier.config.js
@@ -0,0 +1,4 @@
/* eslint-env node */
const baseConfig = require('../../prettier.config');

module.exports = baseConfig;
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions packages/react-hibernate-dev-helpers/src/index.d.ts
@@ -0,0 +1,3 @@
export * from './components';
export * from './jest';
export * from './redux';
3 changes: 3 additions & 0 deletions packages/react-hibernate-dev-helpers/src/index.ts
@@ -0,0 +1,3 @@
export * from './components';
export * from './jest';
export * from './redux';
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions packages/react-hibernate-dev-helpers/tsconfig.json
@@ -0,0 +1,3 @@
{
"extends": "../../tsconfig"
}

0 comments on commit 8c20c16

Please sign in to comment.