diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54092b3e..386997ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Lint, Build and Test +name: Lint & Build on: pull_request: @@ -9,56 +9,49 @@ on: env: APP_TITLE: ${{ vars.APP_TITLE }} APP_MAPBOX_ACCESS_TOKEN: ${{ vars.APP_MAPBOX_ACCESS_TOKEN }} + APP_GRAPHQL_CODEGEN_ENDPOINT: ${{ vars.APP_GRAPHQL_CODEGEN_ENDPOINT }} GITHUB_WORKFLOW: true jobs: - test: - name: Run tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: 'yarn' - - - name: Install dependencies - run: yarn install - - - name: Run test - run: yarn test unimported: name: Find unimported files + environment: 'test' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + submodules: true - uses: actions/setup-node@v4 with: node-version: 20 cache: 'yarn' - name: Install dependencies - run: yarn install + run: yarn install --frozen-lockfile - name: Run unimported - run: yarn unimported + run: yarn generate && yarn unimported lint-js: name: Lint JS + environment: 'test' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + submodules: true - uses: actions/setup-node@v4 with: node-version: 20 cache: 'yarn' - name: Install dependencies - run: yarn install + run: yarn install --frozen-lockfile - - name: Lint - run: yarn lint:js + - name: Lint Javascript + run: yarn generate && yarn lint:js css-lint: name: Lint CSS + environment: 'test' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -68,28 +61,32 @@ jobs: cache: 'yarn' - name: Install dependencies - run: yarn install + run: yarn install --frozen-lockfile - name: Css Lint run: yarn lint:css typecheck: name: Typecheck + environment: 'test' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + submodules: true - uses: actions/setup-node@v4 with: node-version: 20 cache: 'yarn' - name: Install dependencies - run: yarn install + run: yarn install --frozen-lockfile - name: Typecheck - run: yarn typecheck + run: yarn generate && yarn typecheck build: name: Build - needs: [lint-js, css-lint, typecheck, test] + environment: 'test' + needs: [lint-js, css-lint, typecheck] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -99,7 +96,7 @@ jobs: cache: 'yarn' - name: Install dependencies - run: yarn install + run: yarn install --frozen-lockfile - name: Build - run: yarn build + run: yarn generate && yarn build diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..d65725b9 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "backend"] + path = backend + url = git@github.com:IFRCGo/alert-hub-backend.git diff --git a/.unimportedrc.json b/.unimportedrc.json index 2baf1ef6..97d5b2d0 100644 --- a/.unimportedrc.json +++ b/.unimportedrc.json @@ -1,7 +1,7 @@ { "entry": ["./src/index.tsx"], "ignorePatterns": ["**/node_modules/**", "build/**"], - "ignoreUnimported": ["**/*.d.ts", "**/*.test.*"], + "ignoreUnimported": ["**/*.d.ts", "**/*.test.*", "**/generated/**"], "ignoreUnused": [ "@apollo/client", "@graphql-codegen/introspection", @@ -12,6 +12,9 @@ "extensions": [".ts", ".js", ".tsx", ".jsx"], "aliases": { "#utils/*": ["./src/utils/*"], - "#views/*": ["./src/views/*"] + "#views/*": ["./src/views/*"], + "#generated/*": ["./generated/*"], + "#components/*": ["./src/components/*"], + "#hooks/*": ["./src/hooks/*"] } } diff --git a/backend b/backend new file mode 160000 index 00000000..8f8391b0 --- /dev/null +++ b/backend @@ -0,0 +1 @@ +Subproject commit 8f8391b0d6b02e37c34fe079441da12033981220 diff --git a/src/hooks/domain/useCurrentLanguage.ts b/src/hooks/domain/useCurrentLanguage.ts deleted file mode 100644 index 7aca9307..00000000 --- a/src/hooks/domain/useCurrentLanguage.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { useContext } from 'react'; -import { LanguageContext } from '@ifrc-go/ui/contexts'; - -function useCurrentLanguage() { - const { currentLanguage } = useContext(LanguageContext); - - return currentLanguage; -} - -export default useCurrentLanguage;