diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 13cc6661..93f99da1 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -43,12 +43,12 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' run: yarn install --frozen-lockfile --ignore-scripts - name: Build - run: yarn webpack + run: yarn run build env: NODE_ENV: production GITHUB_SHA: ${{ github.sha }} - name: Verify bucket exists - run: if [ "$(yarn --silent deploy-utils bucketExists)" = "false" ]; then exit 1; fi + run: if [ "$(yarn run --silent deploy-utils bucketExists)" = "false" ]; then exit 1; fi - name: Upload dist to bucket run: | aws s3 sync dist s3://${{ steps.config.outputs.ProjectFQDomain }} \ @@ -59,7 +59,7 @@ jobs: name: dist path: ./dist - name: Invalidate CloudFront - run: yarn deploy-utils invalidate "/index.html" + run: yarn run deploy-utils invalidate "/index.html" sentry: name: 'Track Deploy In Sentry' runs-on: ubuntu-latest diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 4cc7a50a..c7974601 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -26,15 +26,15 @@ jobs: - name: Validate peer dependencies run: yarn check-peer-dependencies --runOnlyOnRootDependencies - name: Lint - run: yarn lint + run: yarn run lint - name: Test - run: yarn test --coverage + run: yarn run test --coverage - uses: actions/upload-artifact@v4 with: name: coverage path: ./coverage - name: Build - run: yarn webpack + run: yarn run build env: NODE_ENV: production codecov: diff --git a/jest.config.js b/app/jest.config.js similarity index 100% rename from jest.config.js rename to app/jest.config.js diff --git a/jest.setup.js b/app/jest.setup.js similarity index 65% rename from jest.setup.js rename to app/jest.setup.js index bbab96b9..1375cfaf 100644 --- a/jest.setup.js +++ b/app/jest.setup.js @@ -1,5 +1,5 @@ import '@testing-library/jest-dom'; -import * as config from './config'; +import * as config from '../config'; global.projectConfig = config; diff --git a/postcss.config.js b/app/postcss.config.js similarity index 100% rename from postcss.config.js rename to app/postcss.config.js diff --git a/app/src/globals.d.ts b/app/src/globals.d.ts index 4d17f065..8c174a5b 100644 --- a/app/src/globals.d.ts +++ b/app/src/globals.d.ts @@ -1,4 +1,4 @@ -import { ProjectConfig } from '../config'; +import { ProjectConfig } from '../../config'; declare global { const projectConfig: ProjectConfig; diff --git a/stylelint.config.js b/app/stylelint.config.js similarity index 100% rename from stylelint.config.js rename to app/stylelint.config.js diff --git a/webpack.config.ts b/app/webpack.config.ts similarity index 95% rename from webpack.config.ts rename to app/webpack.config.ts index c45bb44d..924048e8 100644 --- a/webpack.config.ts +++ b/app/webpack.config.ts @@ -6,7 +6,7 @@ import TerserPlugin from 'terser-webpack-plugin'; import CssMinimizerPlugin from 'css-minimizer-webpack-plugin'; import { GenerateSW } from 'workbox-webpack-plugin'; -import config from './config'; +import config from '../config'; const HASH_DIGEST_LENGTH = 20; @@ -21,7 +21,7 @@ export default (env: Record = {}, { mode }: { mode?: string } = return { entry: { - main: './src/index.tsx', + main: path.join(__dirname, './src/index.tsx'), }, mode: isProd ? 'production' : 'development', output: { @@ -113,8 +113,8 @@ export default (env: Record = {}, { mode }: { mode?: string } = projectConfig: JSON.stringify(config), }), new HtmlWebpackPlugin({ - template: './src/index.html.tsx', - favicon: './src/assets/images/favicon.ico', + template: path.join(__dirname, './src/index.html.tsx'), + favicon: path.join(__dirname, './src/assets/images/favicon.ico'), title: config.ProjectName, inject: true, }), diff --git a/package.json b/package.json index cdbbdffb..73007e63 100644 --- a/package.json +++ b/package.json @@ -95,10 +95,13 @@ }, "scripts": { "deploy-utils": "ts-node deploy/utils", - "style": "prettier -l --ignore-path .eslintignore . && eslint . && stylelint 'src/**/*.{js,ts,tsx}'", + "stylelint": "stylelint --config app/stylelint.config.js 'app/src/**/*.{js,ts,tsx}'", + "prettier": "prettier -l --ignore-path .eslintignore . ", + "style": "yarn run --silent prettier && eslint . && yarn run --silent stylelint", "validate": "tsc --noEmit", - "lint": "yarn --silent style && yarn --silent validate", - "start": "webpack-dev-server", + "lint": "yarn run --silent style && yarn run --silent validate", + "build": "webpack -c app/webpack.config.ts", + "start": "webpack-dev-server -c app/webpack.config.ts", "test": "jest --coverage && ./install-test.sh", "prepublish": "webpack -c install/src/webpack.config.ts" }, diff --git a/tsconfig.json b/tsconfig.json index 6348d6d3..60b52a05 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,5 +16,5 @@ "module": "CommonJS" } }, - "include": ["./src/*", "./jest-setup.ts"] + "include": ["./app/src/*", "./app/jest-setup.ts"] }