generated from IgnacioNMiranda/vite-component-library-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit aba7ef2
Showing
33 changed files
with
11,734 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
}, | ||
extends: ['plugin:react/recommended', 'standard-with-typescript', 'prettier', 'plugin:storybook/recommended'], | ||
overrides: [], | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
}, | ||
plugins: ['react'], | ||
rules: { | ||
'react/jsx-key': 'off', | ||
'react/react-in-jsx-scope': 'off', | ||
'no-unused-vars': 'off', | ||
'@typescript-eslint/no-unused-vars': 'warn', | ||
'no-console': 'warn', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
pull-requests: write | ||
|
||
name: release-please | ||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Release | ||
id: release | ||
if: ${{ github.ref_name == 'main' }} | ||
uses: google-github-actions/release-please-action@v3 | ||
with: | ||
release-type: node | ||
default-branch: main | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
if: ${{ steps.release.outputs.releases_created }} | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
if: ${{ steps.release.outputs.releases_created }} | ||
with: | ||
version: 8 | ||
|
||
# Setup .npmrc file to publish to npm | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.x' | ||
registry-url: 'https://npm.pkg.github.com' | ||
cache: 'pnpm' | ||
if: ${{ steps.release.outputs.releases_created }} | ||
|
||
- name: CI | ||
run: pnpm install --frozen-lockfile | ||
if: ${{ steps.release.outputs.releases_created }} | ||
|
||
- name: Build | ||
run: pnpm build:lib | ||
if: ${{ steps.release.outputs.releases_created }} | ||
|
||
- name: Publish | ||
run: pnpm publish | ||
if: ${{ steps.release.outputs.releases_created }} | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
name: release-please | ||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Release | ||
id: release | ||
if: ${{ github.ref_name == 'main' }} | ||
uses: google-github-actions/release-please-action@v3 | ||
with: | ||
release-type: node | ||
default-branch: main | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
if: ${{ steps.release.outputs.releases_created }} | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
if: ${{ steps.release.outputs.releases_created }} | ||
with: | ||
version: 8 | ||
|
||
# Setup .npmrc file to publish to npm | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
cache: 'pnpm' | ||
if: ${{ steps.release.outputs.releases_created }} | ||
|
||
- name: CI | ||
run: pnpm install --frozen-lockfile | ||
if: ${{ steps.release.outputs.releases_created }} | ||
|
||
- name: Build | ||
run: pnpm build:lib | ||
if: ${{ steps.release.outputs.releases_created }} | ||
|
||
- name: Publish | ||
run: pnpm publish | ||
if: ${{ steps.release.outputs.releases_created }} | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
# Storybook | ||
storybook-static | ||
|
||
# Testing | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm run lint && npx lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v16.18.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"semi": false, | ||
"trailingComma": "all", | ||
"singleQuote": true, | ||
"printWidth": 120, | ||
"endOfLine": "auto" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import type { StorybookConfig } from '@storybook/react-vite' | ||
const config: StorybookConfig = { | ||
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'], | ||
addons: [ | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@storybook/addon-interactions', | ||
'@storybook/addon-styling', | ||
], | ||
framework: { | ||
name: '@storybook/react-vite', | ||
options: { | ||
builder: { | ||
viteConfigPath: '.storybook/vite.config.ts', | ||
}, | ||
}, | ||
}, | ||
docs: { | ||
autodocs: 'tag', | ||
}, | ||
} | ||
export default config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { Preview } from '@storybook/react' | ||
import '../src/lib/tailwind/theme.css' | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
actions: { argTypesRegex: '^on[A-Z].*' }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
export default preview |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import react from '@vitejs/plugin-react' | ||
import { defineConfig } from 'vitest/config' | ||
import tailwindcss from 'tailwindcss' | ||
import { UserConfigExport } from 'vite' | ||
|
||
const app = async (): Promise<UserConfigExport> => { | ||
return defineConfig({ | ||
plugins: [react()], | ||
css: { | ||
postcss: { | ||
plugins: [tailwindcss], | ||
}, | ||
}, | ||
}) | ||
} | ||
// https://vitejs.dev/config/ | ||
export default app |
Oops, something went wrong.