Skip to content

Commit

Permalink
chore: initial commit
Browse files Browse the repository at this point in the history
Co-authored-by: pnlybubbles <[email protected]>
Co-authored-by: jessidhia <[email protected]>
Co-authored-by: ayatk <[email protected]>
Co-authored-by: tosuke <[email protected]>
Co-authored-by: saitolume <[email protected]>
Co-authored-by: kvvzr <[email protected]>
Co-authored-by: yto60 <[email protected]>
Co-authored-by: zenmaibane <[email protected]>
Co-authored-by: abcang <[email protected]>
Co-authored-by: calmery <[email protected]>
Co-authored-by: momoogles <[email protected]>
Co-authored-by: SIY1121 <[email protected]>
  • Loading branch information
13 people committed Feb 17, 2022
0 parents commit b97695b
Show file tree
Hide file tree
Showing 475 changed files with 46,122 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
dist/
node_modules/
__snapshots__/
.yarn/
/docs/
/public/
/storybook-static/
/coverage/

/packages/tailwind-diff-cli/bin/tailwind-diff.js
39 changes: 39 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/** @type { import('eslint').Linter.Config } */
const config = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:storybook/recommended',
'prettier',
],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', ignoreRestSiblings: true },
],
'@typescript-eslint/no-unnecessary-condition': 'error',
'@typescript-eslint/strict-boolean-expressions': 'error',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'react/prop-types': 'off',
'no-console': 'warn',
},
parserOptions: {
project: ['./tsconfig.json', './packages/**/tsconfig.json'],
},
env: {
node: true,
},
settings: {
react: {
version: 'detect',
},
},
overrides: [{ files: ['*.cjs', '*.mjs'] }],
}

module.exports = config
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
dist/
node_modules/
/docs/
/public/
/storybook-static/
/coverage/

# yarn
.yarn/*
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*

# artifacts
.DS_Store
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.npmrc

# editor
.vscode
23 changes: 23 additions & 0 deletions .gitlab/merge_request_templates/Template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## やったこと

- aaa

## 動作確認環境

## バージョニング

<!-- yarn lerna version --conventional-commits --no-git-tag-version --no-push -->

```
```

{+ 破壊的変更なし +} / {- 破壊的変更あり -}

- [ ] 破壊的変更がある場合には、対象のパッケージのメジャーバージョンが上がっていることを確認した

## チェックリスト

不要なチェック項目は消して構いません

- [ ] 追加したコンポーネントが index.ts から再 export されている
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.5.0
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
dist/
node_modules/
__snapshots__/
.yarn/
/docs/
/public/
/storybook-static/
/coverage/
1 change: 1 addition & 0 deletions .storybook/badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
const path = require('path')
const { promisify } = require('util')
const glob = promisify(require('glob'))

module.exports = {
stories: ['../packages/**/*.story.@(tsx|mdx)'],
addons: [
'@storybook/addon-essentials',
'@storybook/addon-a11y',
'@storybook/addon-links',
'@storybook/addon-storysource',
// '@storybook/addon-knobs',
'storybook-dark-mode',
],
framework: '@storybook/react',
async webpackFinal(config, { configType }) {
if (configType === 'PRODUCTION') {
return config
}
// 事前ビルドが不要になるようにマッピング
config.resolve.alias = { ...config.resolve.alias, ...(await alias()) }
return config
},
async viteFinal(config, { configType }) {
if (configType === 'PRODUCTION') {
return config
}
// 事前ビルドが不要になるようにマッピング
config.resolve.alias = { ...config.resolve.alias, ...(await alias()) }
// proxyが噛んでいる場合にクライアント側のwssポート番号を変更する
if (typeof process.env.CLIENT_PORT !== 'undefined') {
config.server.hmr.port = process.env.CLIENT_PORT
}
return config
},
// 実験的にviteをpreviewビルドでviteを利用する
// CLIENT_PORT=443 yarn storybook:experimental-vite -p 6007 --no-manager-cache
...(process.env.USE_VITE === '1'
? {
core: {
builder: 'storybook-builder-vite',
},
}
: {}),
}

const packagesDir = path.resolve(__dirname, '../packages')
const alias = async () =>
Object.fromEntries(
(await glob(path.resolve(packagesDir, '*'))).map((absolute) => {
const relative = path.relative(packagesDir, absolute)
const from = path.join('@pixiv-elements', relative)
const to = path.resolve(absolute, 'src')
return [from, to]
})
)
13 changes: 13 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import themeDecorator from './theme-decorator'

export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
}

export const decorators = [themeDecorator]
16 changes: 16 additions & 0 deletions .storybook/theme-decorator.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react'
import { ThemeProvider } from 'styled-components'
import { useDarkMode } from 'storybook-dark-mode'
import createTheme from '@pixiv-elements/styled'

const { light, dark } = createTheme

const Theme = ({ children }) => (
<ThemeProvider theme={useDarkMode() ? dark : light}>{children}</ThemeProvider>
)

export default (Story) => (
<Theme>
<Story />
</Theme>
)
8 changes: 8 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
dist/
node_modules/
__snapshots__/
.yarn/
/docs/
/public/
/storybook-static/
/coverage/
Loading

0 comments on commit b97695b

Please sign in to comment.