diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 85072b8..69a258e 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -7,7 +7,7 @@ module.exports = { "plugin:react-hooks/recommended", "plugin:@tanstack/eslint-plugin-query/recommended", ], - ignorePatterns: ["dist", ".eslintrc.cjs"], + ignorePatterns: ["dist", "build", ".eslintrc.cjs"], parser: "@typescript-eslint/parser", plugins: ["react-refresh"], rules: { diff --git a/.github/workflows/deploy-to-gh-pages.yml b/.github/workflows/deploy-to-gh-pages.yml index a30cd0e..92e5e86 100644 --- a/.github/workflows/deploy-to-gh-pages.yml +++ b/.github/workflows/deploy-to-gh-pages.yml @@ -44,7 +44,7 @@ jobs: - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: - path: './dist' + path: './build' - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a3666e2..1f8c4d5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,8 @@ name: Release Main on: - push: + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: branches: [main] jobs: @@ -24,8 +25,21 @@ jobs: env: CI: true + - run: zip -r artifact.zip build + - name: Create Release id: create_release run: npx semantic-release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload Release Asset for deployment scripts + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./artifact.zip + asset_name: artifact.zip + asset_content_type: application/zip diff --git a/.gitignore b/.gitignore index 9fd7e18..1faabbe 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ /.pnp .pnp.js dist/ +build/ # testing /coverage diff --git a/README.md b/README.md index b0c0a97..ece245d 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ See [Vitest](https://vitest.dev/guide/) for more information. ### `npm run build` -Builds the app for production to the `dist` folder.
+Builds the app for production to the `build` folder.
It correctly bundles React in production mode and optimizes the build for the best performance. The build is minified and the filenames include the hashes.
diff --git a/tsconfig.json b/tsconfig.json index de3bc50..d7a70ad 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,11 +1,15 @@ { "compilerOptions": { + "outDir": "build", "target": "ES2020", "useDefineForClassFields": true, - "lib": ["ES2020", "DOM", "DOM.Iterable"], + "lib": [ + "ES2020", + "DOM", + "DOM.Iterable" + ], "module": "ESNext", "skipLibCheck": true, - /* Bundler mode */ "moduleResolution": "bundler", "allowImportingTsExtensions": true, @@ -13,13 +17,18 @@ "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", - /* Linting */ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, }, - "include": ["src"], - "references": [{ "path": "./tsconfig.node.json" }], + "include": [ + "src" + ], + "references": [ + { + "path": "./tsconfig.node.json" + } + ], } diff --git a/vite.config.js b/vite.config.js index b0058ed..f5e714b 100644 --- a/vite.config.js +++ b/vite.config.js @@ -2,6 +2,9 @@ import svgr from "vite-plugin-svgr"; /** @type {import('vite').UserConfig} */ export default { + build: { + outDir: './build' + }, base: './', plugins: [svgr()], };