Просмотр исходного кода

replace packages/app -> apps/app

Yuki Takei 3 лет назад
Родитель
Сommit
90f964af47

+ 4 - 4
.github/workflows/ci-app-prod.yml

@@ -10,8 +10,8 @@ on:
       - .github/workflows/reusable-app-reg-suit.yml
       - tsconfig.base.json
       - yarn.lock
-      - packages/app/**
-      - '!packages/app/docker/**'
+      - apps/app/**
+      - '!apps/app/docker/**'
       - packages/codemirror-textlint/**
       - packages/core/**
       - packages/preset-themes/**
@@ -29,8 +29,8 @@ on:
       - .github/workflows/reusable-app-reg-suit.yml
       - tsconfig.base.json
       - yarn.lock
-      - packages/app/**
-      - '!packages/app/docker/**'
+      - apps/app/**
+      - '!apps/app/docker/**'
       - packages/codemirror-textlint/**
       - packages/core/**
       - packages/preset-themes/**

+ 26 - 19
.github/workflows/ci-app.yml

@@ -10,8 +10,8 @@ on:
       - .eslint*
       - tsconfig.base.json
       - yarn.lock
-      - packages/app/**
-      - '!packages/app/docker/**'
+      - apps/app/**
+      - '!apps/app/docker/**'
       - packages/codemirror-textlint/**
       - packages/core/**
       - packages/preset-themes/**
@@ -43,24 +43,34 @@ jobs:
           cache-dependency-path: '**/yarn.lock'
 
       - name: Cache/Restore node_modules
-        id: cache-dependencies
         uses: actions/cache@v3
         with:
           path: |
             **/node_modules
-          key: node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('packages/app/package.json') }}
+          key: node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('apps/app/package.json') }}
           restore-keys: |
             node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
             node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
 
+      - name: Cache/Restore dist and types
+        uses: actions/cache@v3
+        with:
+          path: |
+            **/dist
+            **/types
+          key: dist-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('apps/app/package.json') }}
+          restore-keys: |
+            dist-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
+            dist-${{ runner.OS }}-node${{ matrix.node-version }}-
+
       - name: Install dependencies
         run: |
+          yarn global add turbo
           yarn --frozen-lockfile
 
-      - name: lint
-        working-directory: ./apps/app
+      - name: Lint
         run: |
-          turbo run lint
+          turbo run lint --filter=!@growi/slackbot-proxy
 
       - name: Slack Notification
         uses: weseek/ghaction-slack-notification@master
@@ -100,23 +110,19 @@ jobs:
         with:
           path: |
             **/node_modules
-          key: node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('packages/app/package.json') }}
+          key: node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('apps/app/package.json') }}
           restore-keys: |
             node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
             node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
 
       - name: Install dependencies
         run: |
+          yarn global add turbo
           yarn --frozen-lockfile
 
-      - name: Test sub-packages
-        run: |
-          turbo run test --filter=@growi/remark-*
-
-      - name: Test app
-        working-directory: ./packages/app
+      - name: Test
         run: |
-          yarn test:ci --selectProjects unit server ; yarn test:ci --selectProjects server-v5
+          turbo run test --filter=!@growi/slackbot-proxy
         env:
           MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_test
 
@@ -125,7 +131,7 @@ jobs:
         with:
           name: Coverage Report
           path: |
-            packages/app/coverage
+            apps/app/coverage
             packages/remark-growi-directive/coverage
 
       - name: Slack Notification
@@ -166,21 +172,22 @@ jobs:
         with:
           path: |
             **/node_modules
-            ${{ github.workspace }}/packages/app/.next/cache
-          key: dev-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('packages/app/package.json') }}
+            ${{ github.workspace }}/apps/app/.next/cache
+          key: dev-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('apps/app/package.json') }}
           restore-keys: |
             dev-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
             dev-${{ runner.OS }}-node${{ matrix.node-version }}-
 
       - name: Install dependencies
         run: |
+          yarn global add turbo
           yarn --frozen-lockfile
 
       - name: yarn dev:ci
         working-directory: ./apps/app
         run: |
           cp config/ci/.env.local.for-ci .env.development.local
-          yarn dev:ci
+          turbo run dev:ci
         env:
           MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_dev
 

+ 1 - 0
.github/workflows/ci-slackbot-proxy.yml

@@ -50,6 +50,7 @@ jobs:
 
     - name: Install dependencies
       run: |
+        yarn global add turbo
         yarn --frozen-lockfile
 
     - name: yarn lint

+ 3 - 3
.github/workflows/release.yml

@@ -35,7 +35,7 @@ jobs:
     - name: Bump versions
       run: |
         yarn bump-versions:patch
-        sh ./packages/app/bin/github-actions/update-readme.sh
+        sh ./apps/app/bin/github-actions/update-readme.sh
 
     - name: Retrieve information from package.json
       uses: myrotvorets/info-from-package-json-action@1.2.0
@@ -48,7 +48,7 @@ jobs:
         release-notes: ${{ github.event.pull_request.body }}
 
     - name: Update README.md for docker image
-      working-directory: ./packages/app
+      working-directory: ./apps/app
       run: |
         sh ./bin/github-actions/update-readme.sh
       env:
@@ -213,7 +213,7 @@ jobs:
         username: wsmoogle
         password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
         repository: weseek/growi
-        readme-filepath: ./packages/app/docker/README.md
+        readme-filepath: ./apps/app/docker/README.md
 
     - name: Slack Notification
       uses: weseek/ghaction-release-slack-notification@master

+ 18 - 18
.github/workflows/reusable-app-prod.yml

@@ -40,7 +40,7 @@ jobs:
       with:
         path: |
           **/node_modules
-        key: node_modules-${{ runner.OS }}-node${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('packages/app/package.json') }}
+        key: node_modules-${{ runner.OS }}-node${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('apps/app/package.json') }}
         restore-keys: |
           node_modules-${{ runner.OS }}-node${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}-
           node_modules-${{ runner.OS }}-node${{ inputs.node-version }}-
@@ -65,12 +65,12 @@ jobs:
       run: |
         tar -zcf production.tar.gz \
           package.json \
-          packages/app/.next \
-          packages/app/config \
-          packages/app/public \
-          packages/app/resource \
-          packages/app/tmp \
-          packages/app/.env.production* \
+          apps/app/.next \
+          apps/app/config \
+          apps/app/public \
+          apps/app/resource \
+          apps/app/tmp \
+          apps/app/.env.production* \
           packages/*/package.json \
           packages/*/dist
         echo "file=production.tar.gz" >> $GITHUB_OUTPUT
@@ -86,8 +86,8 @@ jobs:
       with:
         name: Bundle Analyzing Report
         path: |
-          packages/app/.next/analyze/client.html
-          packages/app/.next/analyze/server.html
+          apps/app/.next/analyze/client.html
+          apps/app/.next/analyze/server.html
 
     - name: Slack Notification
       uses: weseek/ghaction-slack-notification@master
@@ -140,7 +140,7 @@ jobs:
           **/node_modules
         key: node_modules-build-prod-${{ runner.OS }}-node${{ inputs.node-version }}-${{ steps.get-date.outputs.dateYmdHM }}
         restore-keys: |
-          node_modules-${{ runner.OS }}-node${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('packages/app/package.json') }}
+          node_modules-${{ runner.OS }}-node${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('apps/app/package.json') }}
           node_modules-${{ runner.OS }}-node${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}
           node_modules-${{ runner.OS }}-node${{ inputs.node-version }}-
           node_modules-build-prod-${{ runner.OS }}-node${{ inputs.node-version }}-${{ steps.get-date.outputs.dateYm }}
@@ -165,7 +165,7 @@ jobs:
         tar -xf ${{ needs.build-prod.outputs.PROD_FILES }}
 
     - name: yarn server:ci
-      working-directory: ./packages/app
+      working-directory: ./apps/app
       run: |
         cp config/ci/.env.local.for-ci .env.production.local
         yarn server:ci
@@ -228,7 +228,7 @@ jobs:
         path: |
           **/node_modules
           ~/.cache/Cypress
-        key: deps-for-cypress-${{ runner.OS }}-node${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('packages/app/package.json') }}
+        key: deps-for-cypress-${{ runner.OS }}-node${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('apps/app/package.json') }}
         restore-keys: |
           deps-for-cypress-${{ runner.OS }}-node${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}-
           deps-for-cypress-${{ runner.OS }}-node${{ inputs.node-version }}
@@ -257,19 +257,19 @@ jobs:
         echo "value=$SPEC" >> $GITHUB_OUTPUT
 
     - name: Copy dotenv file for ci
-      working-directory: ./packages/app
+      working-directory: ./apps/app
       run: |
         cat config/ci/.env.local.for-ci >> .env.production.local
 
     - name: Copy dotenv file for automatic installation
       if: ${{ matrix.spec-group != '10' }}
-      working-directory: ./packages/app
+      working-directory: ./apps/app
       run: |
         cat config/ci/.env.local.for-auto-install >> .env.production.local
 
     - name: Copy dotenv file for automatic installation with allowing guest mode
       if: ${{ matrix.spec-group == '21' }}
-      working-directory: ./packages/app
+      working-directory: ./apps/app
       run: |
         cat config/ci/.env.local.for-auto-install-with-allowing-guest >> .env.production.local
 
@@ -277,7 +277,7 @@ jobs:
       uses: cypress-io/github-action@v3
       with:
         browser: chrome
-        working-directory: ./packages/app
+        working-directory: ./apps/app
         spec: '${{ steps.determine-spec-exp.outputs.value }}'
         start: yarn server
         wait-on: 'http://localhost:3000'
@@ -292,8 +292,8 @@ jobs:
       with:
         name: ${{ inputs.cypress-report-artifact-name }}
         path: |
-          packages/app/test/cypress/screenshots
-          packages/app/test/cypress/videos
+          apps/app/test/cypress/screenshots
+          apps/app/test/cypress/videos
 
     - name: Slack Notification
       uses: weseek/ghaction-slack-notification@master

+ 3 - 3
.github/workflows/reusable-app-reg-suit.yml

@@ -65,7 +65,7 @@ jobs:
       with:
         path: |
           **/node_modules
-        key: node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('packages/app/package.json') }}
+        key: node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('apps/app/package.json') }}
         restore-keys: |
           node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
           node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
@@ -78,10 +78,10 @@ jobs:
       uses: actions/download-artifact@v3
       with:
         name: ${{ inputs.cypress-report-artifact-name }}
-        path: packages/app/test/cypress
+        path: apps/app/test/cypress
 
     - name: Run reg-suit
-      working-directory: ./packages/app
+      working-directory: ./apps/app
       run: |
         yarn reg:run
 

+ 10 - 10
.vscode/launch.json

@@ -6,9 +6,9 @@
         "request": "attach",
         "name": "Debug: Attach Debugger to Server",
         "port": 9229,
-        "cwd": "${workspaceFolder}/packages/app",
+        "cwd": "${workspaceFolder}/apps/app",
         "sourceMapPathOverrides": {
-          "webpack://@growi/app/*": "${workspaceFolder}/packages/app/*"
+          "webpack://@growi/app/*": "${workspaceFolder}/apps/app/*"
         }
       },
       {
@@ -30,7 +30,7 @@
         "type": "pwa-node",
         "request": "launch",
         "name": "Debug: Server",
-        "cwd": "${workspaceFolder}/packages/app",
+        "cwd": "${workspaceFolder}/apps/app",
         "runtimeExecutable": "yarn",
         "runtimeArgs": [
           "dev"
@@ -42,7 +42,7 @@
         "console": "integratedTerminal",
         "internalConsoleOptions": "neverOpen",
         "sourceMapPathOverrides": {
-          "webpack://@growi/app/*": "${workspaceFolder}/packages/app/*"
+          "webpack://@growi/app/*": "${workspaceFolder}/apps/app/*"
         }
       },
       {
@@ -51,9 +51,9 @@
         "name": "Debug: Chrome",
         "sourceMaps": true,
         "sourceMapPathOverrides": {
-          "webpack://_N_E/*": "${workspaceFolder}/packages/app/*"
+          "webpack://_N_E/*": "${workspaceFolder}/apps/app/*"
         },
-        "webRoot": "${workspaceFolder}/packages/app/public",
+        "webRoot": "${workspaceFolder}/apps/app/public",
         "url": "http://localhost:3000"
       },
       {
@@ -61,12 +61,12 @@
         "request": "launch",
         "name": "Debug: Firefox",
         "reAttach": true,
-        "webRoot": "${workspaceFolder}/packages/app/public",
+        "webRoot": "${workspaceFolder}/apps/app/public",
         "url": "http://localhost:3000",
         "pathMappings": [
           {
             "url": "webpack://_n_e/src",
-            "path": "${workspaceFolder}/packages/app/src"
+            "path": "${workspaceFolder}/apps/app/src"
           },
           {
             "url": "webpack://_n_e/core",
@@ -78,7 +78,7 @@
           },
           {
             "url": "webpack://_n_e/slack",
-            "path": "${workspaceFolder}/packages/app/slack"
+            "path": "${workspaceFolder}/apps/app/slack"
           },
           {
             "url": "webpack://_n_e/ui",
@@ -86,7 +86,7 @@
           },
           {
             "url": "http://localhost:3000",
-            "path": "${workspaceFolder}/packages/app/public"
+            "path": "${workspaceFolder}/apps/app/public"
           }
         ]
       }

+ 10 - 10
apps/app/docker/Dockerfile

@@ -105,7 +105,7 @@ COPY packages/remark-growi-directive packages/remark-growi-directive
 COPY packages/remark-lsx packages/remark-lsx
 COPY packages/ui packages/ui
 COPY packages/core packages/core
-COPY packages/app packages/app
+COPY apps/app apps/app
 
 # build
 RUN yarn lerna run build
@@ -113,13 +113,13 @@ RUN yarn lerna run build
 # make artifacts
 RUN tar -cf packages.tar \
   package.json \
-  packages/app/.next \
-  packages/app/config \
-  packages/app/public \
-  packages/app/resource \
-  packages/app/tmp \
-  packages/app/.env.production* \
-  packages/app/next.config.js \
+  apps/app/.next \
+  apps/app/config \
+  apps/app/public \
+  apps/app/resource \
+  apps/app/tmp \
+  apps/app/.env.production* \
+  apps/app/next.config.js \
   packages/*/package.json \
   packages/*/dist
 
@@ -157,10 +157,10 @@ RUN tar -xf node_modules.tar
 RUN tar -xf packages.tar
 RUN rm node_modules.tar packages.tar
 
-COPY --chown=node:node --chmod=700 packages/app/docker/docker-entrypoint.sh /
+COPY --chown=node:node --chmod=700 apps/app/docker/docker-entrypoint.sh /
 
 USER root
-WORKDIR ${appDir}/packages/app
+WORKDIR ${appDir}/apps/app
 
 VOLUME /data
 EXPOSE 3000

+ 1 - 1
apps/app/docker/README.md

@@ -10,7 +10,7 @@ GROWI Official docker image
 Supported tags and respective Dockerfile links
 ------------------------------------------------
 
-* [`6.0.7`, `6.0`, `6`, `latest` (Dockerfile)](https://github.com/weseek/growi/blob/v6.0.7/packages/app/docker/Dockerfile)
+* [`6.0.7`, `6.0`, `6`, `latest` (Dockerfile)](https://github.com/weseek/growi/blob/v6.0.7/apps/app/docker/Dockerfile)
 * [`5.1.7`, `5.1`, `5`](https://github.com/weseek/growi/blob/v5.1.7/packages/app/docker/Dockerfile)
 * [`5.1.7-nocdn`, `5.1-nocdn`, `5-nocdn`](https://github.com/weseek/growi/blob/v5.1.7/packages/app/docker/Dockerfile)
 * [`4.5.23`, `4.5`, `4`, `latest` (Dockerfile)](https://github.com/weseek/growi/blob/v4.5.23/packages/app/docker/Dockerfile)

+ 1 - 1
apps/app/docker/codebuild/buildspec.yml

@@ -18,7 +18,7 @@ phases:
       - echo ${DOCKER_REGISTRY_ON_GITHUB_PAT} | docker login ghcr.io --username wsmoogle --password-stdin
   build:
     commands:
-      - docker build -t ${IMAGE_TAG} -f ./packages/app/docker/Dockerfile .
+      - docker build -t ${IMAGE_TAG} -f ./apps/app/docker/Dockerfile .
       - docker tag ${IMAGE_TAG} ${IMAGE_TAG_GHCR}
 
   post_build:

+ 1 - 1
apps/app/docker/codebuild/codebuild.tf

@@ -11,7 +11,7 @@ module "codebuild" {
   source_version      = "refs/heads/master"
   git_clone_depth     = 1
 
-  buildspec           = "packages/app/docker/codebuild/buildspec.yml"
+  buildspec           = "apps/app/docker/codebuild/buildspec.yml"
 
   # https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
   build_image         = "aws/codebuild/amazonlinux2-x86_64-standard:3.0"