Skip to content

Commit

Permalink
feat: 🎸 reset codebase to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
ArrayKnight committed Aug 11, 2020
1 parent 84166d4 commit 043823d
Show file tree
Hide file tree
Showing 41 changed files with 1,075 additions and 472 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/coverage/
/dist/
/docs/
/node_modules/
/src/**/*.stories.tsx
53 changes: 53 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"env": {
"browser": true,
"es6": true,
"jest": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:jest-dom/recommended",
"plugin:prettier/recommended",
"plugin:testing-library/recommended",
"prettier/@typescript-eslint"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "prettier", "react", "react-hooks"],
"rules": {
"@typescript-eslint/explicit-function-return-type": [
2,
{
"allowExpressions": true,
"allowTypedFunctionExpressions": true,
"allowHigherOrderFunctions": true
}
],
"@typescript-eslint/no-unused-vars": [1, { "args": "after-used" }],
"@typescript-eslint/no-unsafe-return": [0],
"@typescript-eslint/no-use-before-define": [
2,
{
"classes": true,
"functions": false,
"variables": true
}
],
"@typescript-eslint/restrict-template-expressions": [0],
"react/display-name": [0],
"react/prop-types": [0]
},
"settings": {
"react": {
"pragma": "React",
"version": "detect"
}
}
}
40 changes: 0 additions & 40 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

19 changes: 0 additions & 19 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

24 changes: 0 additions & 24 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/release.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
.env*

# Generated
/coverage/
/dist/
/docs/
package-lock.json
Expand Down
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
LICENSE

# Generated
/coverage/
/dist/
/docs/
/node_modules/
package-lock.json
yarn.lock

Expand Down
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"arrowParens": "always",
"endOfLine": "auto",
"semi": false,
"singleQuote": true,
"tabWidth": 4,
Expand Down
2 changes: 1 addition & 1 deletion .storybook-dist/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const createCompiler = require('@storybook/addon-docs/mdx-compiler-plugin')

module.exports = {
addons: ['@storybook/addon-knobs/register', './dist/register'],
addons: ['@storybook/addon-knobs/register', '../dist/register'],
stories: ['../src/examples/*.stories.mdx', '../src/examples/*.stories.tsx'],
webpackFinal: async (config) => {
config.module.rules.push(
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Storybook Addon Headless allows you to preview data from a headless CMS inside stories in [Storybook](https://storybook.js.org/). It supports Restful and GraphQL APIs with the help of [Axios](https://github.com/axios/axios) and [Apollo Client](https://github.com/apollographql/apollo-client) respectively. And each query can handle variables which are validated using [Ajv](https://github.com/epoberezkin/ajv).

### Upgrading to v2

_Dependencies **Storybook@6** and **Apollo@3** have been released!_

Be aware of the change to Storybook's story parameters, StoryContext (where `data` is accessed) is now the second parameter.

## Examples

Check out examples and detailed documentation:
Expand Down
28 changes: 28 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
collectCoverageFrom: [
'src/**/*.[jt]s?(x)',
'!src/**/*.d.ts',
'!src/**/index.ts',
'!src/examples/*',
'!src/**/?(*.){stories,styled}.[jt]s?(x)',
],
moduleFileExtensions: [
'web.js',
'js',
'web.ts',
'ts',
'web.tsx',
'tsx',
'json',
'web.jsx',
'jsx',
'node',
],
setupFilesAfterEnv: ['jest-expect-message'],
testEnvironment: 'jest-environment-jsdom-fourteen',
testURL: 'http://localhost',
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.[jt]sx?$'],
}
104 changes: 59 additions & 45 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
"description": "Storybook addon to preview content from a headless CMS in components",
"version": "0.0.0-development",
"license": "MIT",
"force": true,
"scripts": {
"preinstall": "rm -rf node_modules && rm -f package-lock.json && rm -f yarn.lock",
"prebuild": "npm run clean",
"build": "npm-run-all build:*",
"build:dist": "npm run rollup",
"build:docs": "npm run storybook:build",
"clean": "rm -rf dist && rm -rf docs",
"commit": "npm run lint && git add -i && npx git-cz@4.2.0",
"lint": "tslint --fix -p tsconfig.json -c tslint.json",
"commit": "npm run lint && git add -i && npx git-cz",
"lint": "eslint \"src/**/*.[j|t]s?(x)\"",
"rollup": "rollup -c",
"rollup:watch": "rollup -c -w",
"semantic-release": "semantic-release",
Expand All @@ -23,9 +22,9 @@
"storybook:start:dev": "start-storybook -c .storybook-dev",
"storybook:start:dist": "wait-on dist/register.js && start-storybook -c .storybook-dist",
"storybook:build": "wait-on dist/register.js && build-storybook -c .storybook-dist -o docs",
"upgrade": "npm-run-all upgrade:*",
"upgrade:dep": "npm-check --update --production",
"upgrade:dev": "npm-check --update --dev-only --save-exact"
"test": "jest --silent",
"test:coverage": "jest --verbose --coverage",
"upgrade": "npm-check --update --save-exact"
},
"husky": {
"hooks": {
Expand All @@ -45,49 +44,64 @@
]
},
"devDependencies": {
"@commitlint/cli": "8.3.5",
"@commitlint/config-conventional": "8.3.4",
"@material-ui/core": "4.9.0",
"@storybook/addon-actions": "5.3.9",
"@storybook/addon-docs": "5.3.9",
"@storybook/addon-knobs": "5.3.9",
"@storybook/react": "5.3.9",
"@commitlint/cli": "9.1.1",
"@commitlint/config-conventional": "9.1.1",
"@material-ui/core": "4.11.0",
"@storybook/addon-actions": "6.0.2",
"@storybook/addon-docs": "6.0.2",
"@storybook/addon-knobs": "6.0.2",
"@storybook/react": "6.0.2",
"@testing-library/jest-dom": "5.11.3",
"@testing-library/react": "10.4.8",
"@types/ajv-keywords": "3.4.0",
"@types/react": "16.9.19",
"babel-loader": "8.0.6",
"babel-preset-react-app": "9.1.1",
"husky": "4.2.1",
"lint-staged": "10.0.7",
"npm-check": "5.9.0",
"@types/jest": "26.0.9",
"@types/jest-expect-message": "1.0.2",
"@types/react": "16.9.46",
"@typescript-eslint/eslint-plugin": "3.9.0",
"@typescript-eslint/parser": "3.9.0",
"babel-loader": "8.1.0",
"babel-preset-react-app": "9.1.2",
"eslint": "7.6.0",
"eslint-config-prettier": "6.11.0",
"eslint-config-react": "1.1.7",
"eslint-plugin-jest-dom": "3.1.7",
"eslint-plugin-prettier": "3.1.4",
"eslint-plugin-react": "7.20.5",
"eslint-plugin-react-hooks": "4.0.8",
"eslint-plugin-testing-library": "3.6.0",
"husky": "4.2.5",
"jest": "26.3.0",
"jest-environment-jsdom-fourteen": "1.0.1",
"jest-expect-message": "1.0.2",
"lint-staged": "10.2.11",
"npm-check": "5.9.2",
"npm-run-all": "4.1.5",
"prettier": "1.19.1",
"react-is": "16.12.0",
"rollup": "1.31.0",
"rollup-plugin-typescript2": "0.25.3",
"semantic-release": "17.0.2",
"tslint": "6.0.0",
"tslint-config-prettier": "1.18.0",
"tslint-react": "4.2.0",
"tslint-react-hooks": "2.2.1",
"typescript": "3.7.5",
"wait-on": "4.0.0"
"prettier": "2.0.5",
"react-is": "16.13.1",
"rollup": "2.23.1",
"rollup-plugin-typescript2": "0.27.2",
"semantic-release": "17.1.1",
"ts-jest": "26.2.0",
"typescript": "3.9.7",
"wait-on": "5.2.0"
},
"dependencies": {
"@storybook/addons": "^5.3.9",
"@storybook/api": "^5.3.9",
"@storybook/components": "^5.3.9",
"@storybook/core-events": "^5.3.9",
"@storybook/theming": "^5.3.9",
"ajv": "^6.11.0",
"ajv-keywords": "^3.4.1",
"apollo-boost": "^0.4.7",
"axios": "^0.19.1",
"change-case": "^4.1.1",
"date-fns": "^2.9.0",
"downshift": "^4.0.7",
"graphql": "^14.5.8",
"react": "^16.12.0",
"react-json-view": "^1.19.1"
"@apollo/client": "3.1.3",
"@storybook/addons": "6.0.2",
"@storybook/api": "6.0.2",
"@storybook/components": "6.0.2",
"@storybook/core": "6.0.2",
"@storybook/core-events": "6.0.2",
"@storybook/theming": "6.0.2",
"ajv": "6.12.3",
"ajv-keywords": "3.5.2",
"axios": "0.19.2",
"change-case": "4.1.1",
"date-fns": "2.15.0",
"downshift": "6.0.3",
"graphql": "15.3.0",
"react": "16.13.1",
"react-json-view": "1.19.1"
},
"private": false,
"repository": {
Expand Down
Loading

0 comments on commit 043823d

Please sign in to comment.