Skip to content

Commit

Permalink
chore: migrate to addon kit
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeiscontent committed Apr 20, 2024
1 parent 4ed2275 commit 6563cd8
Show file tree
Hide file tree
Showing 47 changed files with 16,053 additions and 2,833 deletions.
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

21 changes: 0 additions & 21 deletions .eslintrc

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/cd.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/ci.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release

on: [push]

jobs:
release:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci') }}
steps:
- uses: actions/checkout@v4

- name: Prepare repository
run: git fetch --unshallow --tags

- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x

- name: Install dependencies
run: npm install --ignore-scripts

- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm run release
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.DS_Store
*.log
lib/
dist/
node_modules/
storybook-static/
build-storybook.log
.DS_Store
.env
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
10 changes: 1 addition & 9 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
{
"bracketSpacing": true,
"printWidth": 80,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false
}
{}
15 changes: 15 additions & 0 deletions .storybook/local-preset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* to load the built addon in this test Storybook
*/
function previewAnnotations(entry = []) {
return [...entry, require.resolve("../dist/preview.js")];
}

function managerEntries(entry = []) {
return [...entry, require.resolve("../dist/manager.js")];
}

module.exports = {
managerEntries,
previewAnnotations,
};
18 changes: 18 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { StorybookConfig } from "@storybook/react-vite";
const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"./local-preset.js",
],
framework: {
name: "@storybook/react-vite",
options: {},
},
docs: {
autodocs: "tag",
},
};
export default config;
3 changes: 3 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<script>
window.global = window;
</script>
23 changes: 23 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { Preview } from "@storybook/react";
import { loadErrorMessages, loadDevMessages } from "@apollo/client/dev";

// Adds messages only in a dev environment
loadDevMessages();
loadErrorMessages();

const preview: Preview = {
parameters: {
backgrounds: {
default: "light",
},
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
},
};

export default preview;
1 change: 0 additions & 1 deletion .tool-versions

This file was deleted.

4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Aaron Reisman
Copyright (c) 2023 Storybook contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
Loading

0 comments on commit 6563cd8

Please sign in to comment.