Skip to content

Commit e1cad39

Browse files
committed
Installed package from template: "@lunde/create-react-pkg"
0 parents  commit e1cad39

17 files changed

+1123
-0
lines changed

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
/coverage
3+
/dist
4+
/test
5+
*.config.js

.eslintrc

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"parserOptions": {
4+
"ecmaFeatures": {
5+
"jsx": true
6+
}
7+
},
8+
"plugins": ["@typescript-eslint", "jest", "react", "react-hooks"],
9+
"extends": [
10+
"eslint:recommended",
11+
"plugin:react/recommended",
12+
"plugin:jest/recommended",
13+
"plugin:@typescript-eslint/recommended"
14+
],
15+
"rules": {
16+
"@typescript-eslint/member-delimiter-style": "off",
17+
"@typescript-eslint/interface-name-prefix": "off",
18+
"@typescript-eslint/no-explicit-any": "off",
19+
"@typescript-eslint/ban-ts-ignore": "off",
20+
"@typescript-eslint/camelcase": "off",
21+
"@typescript-eslint/explicit-function-return-type": "off",
22+
"@typescript-eslint/no-use-before-define": "off",
23+
"no-console": "off",
24+
"no-prototype-builtins": "off",
25+
"react/no-children-prop": "off",
26+
"react/display-name": "off",
27+
"react/prop-types": "off",
28+
"react-hooks/rules-of-hooks": "error",
29+
"react-hooks/exhaustive-deps": "warn"
30+
},
31+
"settings": {
32+
"react": {
33+
"pragma": "React",
34+
"version": "detect"
35+
}
36+
},
37+
"env": {
38+
"browser": true,
39+
"node": true,
40+
"es6": true,
41+
"jest/globals": true
42+
},
43+
"globals": {
44+
"__DEV__": true
45+
},
46+
"overrides": [
47+
{
48+
"files": ["**/test.ts", "**/*.test.ts", "**/test.tsx", "**/*.test.tsx"],
49+
"settings": {
50+
"import/resolver": {
51+
"jest": {
52+
"jestConfigFile": "./jest.config.js"
53+
}
54+
}
55+
}
56+
}
57+
]
58+
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
coverage

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
/coverage

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"trailingComma": "es5",
3+
"tabWidth": 2,
4+
"semi": false,
5+
"singleQuote": true,
6+
"bracketSpacing": false
7+
}

.travis.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
sudo: false
2+
language: node_js
3+
cache:
4+
yarn: true
5+
directories:
6+
- node_modules
7+
notifications:
8+
email: false
9+
node_js: '12'
10+
install: yarn install
11+
script: yarn validate
12+
after_script: npx codecov@3
13+
branches:
14+
only:
15+
- master

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Jared Lunde
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<hr>
2+
<div align="center">
3+
<h1 align="center">
4+
@-ui/react-layout
5+
</h1>
6+
</div>
7+
8+
<p align="center">
9+
<a href="https://bundlephobia.com/result?p=@-ui/react-layout">
10+
<img alt="Bundlephobia" src="https://img.shields.io/bundlephobia/minzip/@-ui/react-layout?style=for-the-badge&labelColor=24292e">
11+
</a>
12+
<a aria-label="Types" href="https://www.npmjs.com/package/@-ui/react-layout">
13+
<img alt="Types" src="https://img.shields.io/npm/types/@-ui/react-layout?style=for-the-badge&labelColor=24292e">
14+
</a>
15+
<a aria-label="Code coverage report" href="https://codecov.io/gh/dash-ui/-ui">
16+
<img alt="Code coverage" src="https://img.shields.io/codecov/c/gh/dash-ui/-ui?style=for-the-badge&labelColor=24292e">
17+
</a>
18+
<a aria-label="Build status" href="https://travis-ci.com/dash-ui/-ui">
19+
<img alt="Build status" src="https://img.shields.io/travis/com/dash-ui/-ui?style=for-the-badge&labelColor=24292e">
20+
</a>
21+
<a aria-label="NPM version" href="https://www.npmjs.com/package/@-ui/react-layout">
22+
<img alt="NPM Version" src="https://img.shields.io/npm/v/@-ui/react-layout?style=for-the-badge&labelColor=24292e">
23+
</a>
24+
<a aria-label="License" href="https://jaredlunde.mit-license.org/">
25+
<img alt="MIT License" src="https://img.shields.io/npm/l/@-ui/react-layout?style=for-the-badge&labelColor=24292e">
26+
</a>
27+
</p>
28+
29+
<pre align="center">npm i @-ui/react-layout</pre>
30+
<hr>
31+
32+
Layout primitives for React using @-ui/spacing
33+
34+
## Quick Start
35+
36+
```jsx harmony
37+
import _ from '@-ui/react-layout'
38+
```
39+
40+
## API
41+
42+
### Props
43+
44+
| Prop | Type | Default | Required? | Description |
45+
| ---- | ---- | ------- | --------- | ----------- |
46+
| | | | | |
47+
48+
## LICENSE
49+
50+
MIT

babel.config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.exports = api => {
2+
const module = api.env('module')
3+
const presetEnv = [
4+
'@lunde/es',
5+
{
6+
env: {
7+
modules: module ? false : 'commonjs',
8+
targets: module
9+
? {
10+
browsers: '> 2%',
11+
}
12+
: {
13+
node: '8',
14+
},
15+
},
16+
devExpression: false,
17+
objectAssign: false,
18+
},
19+
]
20+
21+
return {
22+
presets: ['@babel/preset-react', presetEnv],
23+
plugins: ['optimize-react', 'typescript-to-proptypes'],
24+
}
25+
}

jest.config.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const path = require('path')
2+
3+
module.exports = {
4+
// testEnvironment: 'jest-environment-jsdom',
5+
moduleDirectories: [
6+
'node_modules',
7+
path.join(__dirname, 'src'),
8+
path.join(__dirname, 'test'),
9+
],
10+
testMatch: ['<rootDir>/src/**/?(*.)test.{ts,tsx}'],
11+
collectCoverageFrom: ['**/src/**/*.{ts,tsx}'],
12+
// moduleNameMapper: {},
13+
setupFilesAfterEnv: [require.resolve('./test/setup.js')],
14+
snapshotResolver: require.resolve('./test/resolve-snapshot.js'),
15+
// coverageThreshold: {
16+
// global: {
17+
// statements:17,
18+
// branches: 4,
19+
// lines: 17,
20+
// functions: 20
21+
// }
22+
// },
23+
globals: {
24+
__DEV__: true,
25+
},
26+
}

package.json

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"name": "@-ui/react-layout",
3+
"version": "1.0.0",
4+
"homepage": "https://github.com/dash-ui/-ui#readme",
5+
"repository": "github:dash-ui/-ui",
6+
"bugs": "https://github.com/dash-ui/-ui/issues",
7+
"license": "MIT",
8+
"description": "",
9+
"keywords": [
10+
"react",
11+
"react component",
12+
"react layout"
13+
],
14+
"main": "dist/main/index.js",
15+
"module": "dist/module/index.js",
16+
"types": "types/index.d.ts",
17+
"files": [
18+
"/dist",
19+
"/types"
20+
],
21+
"sideEffects": false,
22+
"scripts": {
23+
"build": "npm run build-main && npm run build-module && npm run build-types",
24+
"build-main": "npm run compile -- -d dist/main --env-name main",
25+
"build-module": "npm run compile -- -d dist/module --env-name module",
26+
"build-types": "tsc -p tsconfig.json -d --outDir types --emitDeclarationOnly",
27+
"check-types": "tsc --noEmit -p tsconfig.json",
28+
"compile": "babel src -x .ts,.tsx --ignore \"**/*.test.ts\",\"**/test.ts\",\"**/*.test.tsx\",\"**/test.tsx\" --delete-dir-on-start",
29+
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,md,yml,json,eslintrc,prettierrc}\"",
30+
"lint": "eslint . --ext .ts,.tsx",
31+
"prepublishOnly": "npm run lint && npm run test && npm run build && npm run format",
32+
"test": "jest",
33+
"validate": "npm run check-types && npm run lint && npm run test -- --coverage"
34+
},
35+
"husky": {
36+
"hooks": {
37+
"pre-commit": "npm run build-types && git add types && lint-staged"
38+
}
39+
},
40+
"lint-staged": {
41+
"**/*.{ts,tsx,js,jsx}": [
42+
"eslint",
43+
"prettier --write"
44+
],
45+
"**/*.{md,yml,json,eslintrc,prettierrc}": [
46+
"prettier --write"
47+
]
48+
},
49+
"devDependencies": {
50+
"@lunde/create-react-pkg": "file:/Users/jaredlunde/.npm/_npx/36542/lib/node_modules/@lunde/create-react-pkg/",
51+
"@babel/preset-react": "latest",
52+
"@lunde/babel-preset-es": "latest",
53+
"@testing-library/jest-dom": "latest",
54+
"@testing-library/react": "latest",
55+
"@testing-library/react-hooks": "latest",
56+
"jest": "latest",
57+
"babel-plugin-optimize-react": "latest",
58+
"eslint": "latest",
59+
"eslint-import-resolver-jest": "latest",
60+
"eslint-plugin-react": "latest",
61+
"eslint-plugin-react-hooks": "latest",
62+
"eslint-plugin-jest": "latest",
63+
"husky": "latest",
64+
"lint-staged": "latest",
65+
"prettier": "latest",
66+
"react": "latest",
67+
"react-dom": "latest",
68+
"react-test-renderer": "latest",
69+
"@types/jest": "latest",
70+
"@types/react": "latest",
71+
"@types/react-dom": "latest",
72+
"@typescript-eslint/eslint-plugin": "latest",
73+
"@typescript-eslint/parser": "latest",
74+
"babel-plugin-typescript-to-proptypes": "latest",
75+
"ts-jest": "latest",
76+
"typescript": "latest"
77+
},
78+
"dependencies": {},
79+
"peerDependencies": {
80+
"react": ">=16.8",
81+
"react-dom": ">=16.8",
82+
"prop-types": ">=15.6"
83+
}
84+
}

src/index.test.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* jest */
2+
// import React from 'react'
3+
// import {renderHook} from '@testing-library/react-hooks'
4+
// import {render} from '@testing-library/react'
5+
const hello = world => `hello ${world}`
6+
7+
test('passes', () => {
8+
expect(hello('world')).toMatchSnapshot()
9+
})

src/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// import React from 'react'
2+
const Component = (): string => 'Hello world'
3+
export default Component

test/resolve-snapshot.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const path = require('path')
2+
const snapshots = '__snapshots__'
3+
4+
module.exports = {
5+
resolveSnapshotPath: (testPath, snapshotExtension) =>
6+
path.join(
7+
testPath
8+
.split('/')
9+
.slice(0, -1)
10+
.join('/'),
11+
snapshots,
12+
testPath.split('/').pop() + snapshotExtension
13+
),
14+
resolveTestPath: (snapshotFilePath, snapshotExtension) =>
15+
path.join(
16+
snapshotFilePath
17+
.split('/')
18+
.slice(0, -2)
19+
.join('/'),
20+
snapshotFilePath
21+
.split('/')
22+
.pop()
23+
.slice(0, -snapshotExtension.length)
24+
),
25+
testPathForConsistencyCheck: 'src/foo.test.js',
26+
}

test/setup.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// This file is for setting up Jest test environments
2+
afterEach(() => {
3+
jest.clearAllMocks()
4+
})

tsconfig.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"include": ["src"],
3+
"exclude": [
4+
"src/**/*.test.ts",
5+
"src/**/test.ts",
6+
"src/**/*.test.tsx",
7+
"src/**/test.tsx"
8+
],
9+
"compilerOptions": {
10+
"target": "es5",
11+
"lib": ["esnext", "dom", "dom.iterable"],
12+
"jsx": "react",
13+
"moduleResolution": "node",
14+
"strictNullChecks": true,
15+
"esModuleInterop": true,
16+
"forceConsistentCasingInFileNames": true,
17+
"allowSyntheticDefaultImports": true,
18+
"noImplicitReturns": false,
19+
"noUnusedLocals": true,
20+
"noFallthroughCasesInSwitch": true,
21+
"noEmitOnError": true
22+
}
23+
}

0 commit comments

Comments
 (0)