Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
chore: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanClementsHax committed Jan 9, 2022
1 parent a98c721 commit 5633730
Show file tree
Hide file tree
Showing 27 changed files with 6,992 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .czrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"path": "./node_modules/cz-conventional-changelog"
}
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
yarn.lock
lib
dist
examples
37 changes: 37 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"extends": [
// js/ts specific
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"typescript",
// jest
"plugin:jest/recommended",
"plugin:jest/style",
// must be last for prettier to work well with eslint
"prettier"
],
"env": {
"es6": true,
"node": true
},
"rules": {
"quotes": [
"warn",
"single",
{ "avoidEscape": true, "allowTemplateLiterals": false }
],
"no-console": "warn"
},
"overrides": [
{
"files": ["**/*.ts?(x)"],
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/explicit-module-boundary-types": "error"
}
}
]
}
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on:
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: restore dependencies
uses: bahmutov/npm-install@v1
- run: yarn lint:all
test:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: restore dependencies
uses: bahmutov/npm-install@v1
- run: yarn test
type_check:
name: type check
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: restore dependencies
uses: bahmutov/npm-install@v1
- run: yarn type-check
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: setup node
uses: actions/setup-node@v2
with:
node-version: 'lts/*'
registry-url: https://registry.npmjs.org/
- name: restore dependencies
uses: bahmutov/npm-install@v1
- name: release
run: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,6 @@ dist

# TernJS port file
.tern-port

# build output
lib
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn test:all
4 changes: 4 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
. "$(dirname "$0")/_/husky.sh"

exec < /dev/tty && node_modules/.bin/cz --hook || true
6 changes: 6 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"*.@(ts|tsx|js|jsx)": ["yarn lint:js", "yarn format"],
"*.json": ["yarn format"],
"*.*rc": ["yarn format --parser json"],
"*.@(css|scss)": ["yarn lint:styles", "yarn format"]
}
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
yarn.lock
lib
dist
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": true,
"semi": false,
"trailingComma": "none",
"arrowParens": "avoid"
}
3 changes: 3 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"branches": ["main"]
}
5 changes: 5 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
yarn.lock
lib
dist
examples
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"yzhang.markdown-all-in-one",
"davidanson.vscode-markdownlint",
"stylelint.vscode-stylelint"
]
}
16 changes: 16 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"npm.packageManager": "yarn",
"css.validate": false,
"less.validate": false,
"scss.validate": false,
"editor.codeActionsOnSave": {
"source.fixAll.markdownlint": true,
"source.fixAll.stylelint": true
},
"stylelint.validate": ["css", "scss"]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# storybook-addon-next
# storybook-addon-next
12 changes: 12 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testPathIgnorePatterns: ['<rootDir>[/\\\\](node_modules|examples)[/\\\\]'],
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname'
],
setupFilesAfterEnv: ['<rootDir>/src/testSetup.ts'],
resetMocks: true
}
70 changes: 70 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"name": "storybook-addon-next",
"version": "0.0.0-development",
"author": "ryanclementshax",
"license": "MIT",
"description": "A Storybook addon that allows Next.js to work with Storybook out of the box",
"keywords": [
"storybook",
"addon",
"next",
"nextjs"
],
"homepage": "https://github.com/RyanClementsHax/storybook-addon-next#readme",
"repository": {
"type": "git",
"url": "https://github.com/RyanClementsHax/storybook-addon-next.git"
},
"bugs": {
"url": "https://github.com/RyanClementsHax/storybook-addon-next/issues"
},
"main": "lib/index.js",
"types": "lib/index.d.ts",
"files": [
"lib"
],
"scripts": {
"build": "yarn clean && tsc --project tsconfig.build.json",
"clean": "tsc --build --clean",
"type-check": "tsc --pretty --noEmit",
"format": "prettier --write",
"format:all": "yarn format .",
"lint:all": "yarn lint:js:all && yarn lint:styles:all",
"lint:js": "eslint --fix",
"lint:js:all": "yarn lint:js .",
"lint:styles": "stylelint --allow-empty-input --fix",
"lint:styles:all": "yarn lint:styles ./**/*.{scss,css}",
"test": "jest",
"test:all": "yarn lint:all && yarn type-check && yarn test",
"prepare": "husky install",
"prepublishOnly": "yarn build",
"release": "semantic-release"
},
"dependencies": {},
"devDependencies": {
"@types/jest": "^27.0.3",
"@typescript-eslint/eslint-plugin": "^5.6.0",
"@typescript-eslint/parser": "^5.6.0",
"commitizen": "^4.2.4",
"cz-conventional-changelog": "3.3.0",
"eslint": "^8.4.1",
"eslint-config-prettier": "^8.3.0",
"eslint-config-typescript": "^3.0.0",
"eslint-plugin-jest": "^25.3.0",
"husky": "^7.0.4",
"jest": "^27.4.4",
"jest-watch-typeahead": "^1.0.0",
"lint-staged": "^12.1.2",
"prettier": "^2.5.1",
"semantic-release": "^18.0.1",
"stylelint": "^14.1.0",
"stylelint-config-prettier": "^9.0.3",
"stylelint-config-recommended-scss": "^5.0.2",
"stylelint-config-standard": "^24.0.0",
"stylelint-prettier": "^2.0.0",
"ts-jest": "^27.1.1",
"tslib": "^2.3.1",
"typescript": "^4.5.3"
},
"peerDependencies": {}
}
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
console.log('hello world!')

export {}
7 changes: 7 additions & 0 deletions stylelint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
extends: [
'stylelint-config-standard',
'stylelint-config-recommended-scss',
'stylelint-prettier/recommended'
]
}
4 changes: 4 additions & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["node_modules", "lib", "src/**/*.spec.ts", "src/testSetup.ts"]
}
Loading

0 comments on commit 5633730

Please sign in to comment.