-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from myshell-ai/dev-comfyui
Dev Improvements
- Loading branch information
Showing
85 changed files
with
18,460 additions
and
8,927 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 |
---|---|---|
|
@@ -18,8 +18,6 @@ jobs: | |
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: main | ||
|
||
- uses: pnpm/action-setup@v2 | ||
with: | ||
|
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,51 @@ | ||
name: "Storybook Tests" | ||
|
||
on: | ||
push: | ||
paths: | ||
- "web/apps/web/**" | ||
- "web/packages/**" | ||
- ".github/**" | ||
pull_request: | ||
paths: | ||
- "web/apps/web/**" | ||
- "web/packages/**" | ||
- ".github/**" | ||
|
||
jobs: | ||
test: | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-latest | ||
env: | ||
CYPRESS_INSTALL_BINARY: "0" | ||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 9 | ||
run_install: false | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
cache: "pnpm" | ||
cache-dependency-path: "web/pnpm-lock.yaml" | ||
|
||
- run: npm install concurrently http-server wait-on -g | ||
|
||
- working-directory: ./web | ||
run: pnpm install | ||
|
||
- working-directory: ./web | ||
run: | | ||
pnpm turbo run build-storybook --filter=storybook | ||
- working-directory: ./web/apps/storybook | ||
run: ./node_modules/.bin/playwright install --with-deps chromium | ||
|
||
- working-directory: ./web/apps/storybook | ||
run: | | ||
concurrently -k -s first -n "SB,TEST" -c "magenta,blue" "http-server storybook-static --port 6006 --silent" "wait-on tcp:6006 && ./node_modules/.bin/test-storybook" |
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,40 @@ | ||
name: Sync open-source | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- "web/apps/web/**" | ||
- "web/packages/**" | ||
- ".github/**" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get last commit author email | ||
id: get_email | ||
run: echo "COMMIT_AUTHOR_EMAIL=$(git log -n 1 --pretty=format:%ae)" >> $GITHUB_ENV | ||
|
||
- name: Test author email | ||
run: echo "The commit author email is $COMMIT_AUTHOR_EMAIL" | ||
|
||
- uses: cpina/github-action-push-to-another-repository@main | ||
env: | ||
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} | ||
with: | ||
source-directory: web | ||
target-directory: web | ||
destination-github-username: "myshell-ai" | ||
destination-repository-name: "open-source" | ||
target-branch: ${{ github.head_ref }} | ||
create-target-branch-if-needed: true | ||
user-name: ${{ github.event.pull_request.user.login }} | ||
user-email: ${{ env.COMMIT_AUTHOR_EMAIL }} | ||
# https://github.com/orgs/community/discussions/25191 | ||
commit-message: See ${{github.repository}}@${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Test get variable exported by push-to-another-repository | ||
run: echo $DESTINATION_CLONED_DIRECTORY |
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
# . "$(dirname "$0")/_/husky.sh" | ||
|
||
npx lint-staged | ||
cd web && 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,19 @@ | ||
#!/bin/sh | ||
# . "$(dirname "$0")/_/husky.sh" | ||
|
||
|
||
echo "===\n>> Pre-push Hook: Checking branch name..." | ||
|
||
cd web | ||
|
||
BRANCH=`git rev-parse --abbrev-ref HEAD` | ||
PROTECTED_BRANCHES="^(main|test)" | ||
|
||
if [[ "$BRANCH" =~ $PROTECTED_BRANCHES ]] | ||
then | ||
echo "\n🚫 Cannot push to remote $BRANCH branch, please create your own branch and use PR." | ||
fi | ||
|
||
echo ">> Finish checking branch name.\n===" | ||
|
||
exit 0 |
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 @@ | ||
{ | ||
"extends": [ | ||
"next/core-web-vitals", | ||
"next/typescript", | ||
"plugin:storybook/recommended" | ||
] | ||
} |
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,38 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
.yarn/install-state.gz | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
*storybook.log |
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,27 @@ | ||
import type { StorybookConfig } from '@storybook/nextjs'; | ||
|
||
import { join, dirname } from 'path'; | ||
|
||
/** | ||
* This function is used to resolve the absolute path of a package. | ||
* It is needed in projects that use Yarn PnP or are set up within a monorepo. | ||
*/ | ||
function getAbsolutePath(value: string): any { | ||
return dirname(require.resolve(join(value, 'package.json'))); | ||
} | ||
const config: StorybookConfig = { | ||
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], | ||
addons: [ | ||
getAbsolutePath('@storybook/addon-onboarding'), | ||
getAbsolutePath('@storybook/addon-links'), | ||
getAbsolutePath('@storybook/addon-essentials'), | ||
getAbsolutePath('@chromatic-com/storybook'), | ||
getAbsolutePath('@storybook/addon-interactions'), | ||
], | ||
framework: { | ||
name: getAbsolutePath('@storybook/nextjs'), | ||
options: {}, | ||
}, | ||
staticDirs: ['../public'], | ||
}; | ||
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,14 @@ | ||
import type { Preview } from '@storybook/react'; | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
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,40 @@ | ||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). | ||
|
||
## Getting Started | ||
|
||
First, run the development server: | ||
|
||
```bash | ||
npm run dev | ||
# or | ||
yarn dev | ||
# or | ||
pnpm dev | ||
# or | ||
bun dev | ||
``` | ||
|
||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. | ||
|
||
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. | ||
|
||
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`. | ||
|
||
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. | ||
|
||
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. | ||
|
||
## Learn More | ||
|
||
To learn more about Next.js, take a look at the following resources: | ||
|
||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. | ||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. | ||
|
||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! | ||
|
||
## Deploy on Vercel | ||
|
||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. | ||
|
||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. |
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,6 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
reactStrictMode: true, | ||
}; | ||
|
||
export default nextConfig; |
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,41 @@ | ||
{ | ||
"name": "storybook", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "next build", | ||
"start": "next start", | ||
"lint": "next lint", | ||
"storybook": "storybook dev -p 6006", | ||
"build-storybook": "storybook build" | ||
}, | ||
"dependencies": { | ||
"next": "14.2.12", | ||
"react": "^18", | ||
"react-dom": "^18" | ||
}, | ||
"devDependencies": { | ||
"@chromatic-com/storybook": "^1.9.0", | ||
"@storybook/addon-essentials": "^8.3.1", | ||
"@storybook/addon-interactions": "^8.3.1", | ||
"@storybook/addon-links": "^8.3.1", | ||
"@storybook/addon-onboarding": "^8.3.1", | ||
"@storybook/blocks": "^8.3.1", | ||
"@storybook/nextjs": "^8.3.1", | ||
"@storybook/react": "^8.3.1", | ||
"@storybook/test": "^8.3.1", | ||
"@storybook/test-runner": "^0.19.1", | ||
"@types/node": "^20", | ||
"@types/react": "^18", | ||
"@types/react-dom": "^18", | ||
"eslint": "^8", | ||
"eslint-config-next": "14.2.12", | ||
"eslint-plugin-storybook": "^0.8.0", | ||
"playwright": "^1.47.1", | ||
"postcss": "^8", | ||
"storybook": "^8.3.1", | ||
"tailwindcss": "^3.4.1", | ||
"typescript": "^5" | ||
} | ||
} |
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,8 @@ | ||
/** @type {import('postcss-load-config').Config} */ | ||
const config = { | ||
plugins: { | ||
tailwindcss: {}, | ||
}, | ||
}; | ||
|
||
export default config; |
Binary file not shown.
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,6 @@ | ||
// import '@/styles/globals.css'; | ||
import type { AppProps } from 'next/app'; | ||
|
||
export default function App({ Component, pageProps }: AppProps) { | ||
return <Component {...pageProps} />; | ||
} |
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,13 @@ | ||
import { Html, Head, Main, NextScript } from 'next/document'; | ||
|
||
export default function Document() { | ||
return ( | ||
<Html lang="en"> | ||
<Head /> | ||
<body className="antialiased"> | ||
<Main /> | ||
<NextScript /> | ||
</body> | ||
</Html> | ||
); | ||
} |
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,13 @@ | ||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction | ||
import type { NextApiRequest, NextApiResponse } from 'next'; | ||
|
||
type Data = { | ||
name: string; | ||
}; | ||
|
||
export default function handler( | ||
req: NextApiRequest, | ||
res: NextApiResponse<Data>, | ||
) { | ||
res.status(200).json({ name: 'John Doe' }); | ||
} |
Binary file not shown.
Binary file not shown.
Oops, something went wrong.