Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API定義からの自動生成周りを一括で修正 #304

Merged
merged 2 commits into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
node_modules

.DS_Store
/dist
dist
scripts
13 changes: 2 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
node-version-file: .node-version
cache: npm
- run: npm ci
env:
SKIP_GENAPI: 1
genApi:
name: Generate APIs
runs-on: ubuntu-latest
Expand All @@ -29,6 +27,7 @@ jobs:
node-version-file: .node-version
cache: npm
- run: npm ci
- run: npm run gen-api
- uses: actions/upload-artifact@v4
with:
name: apis
Expand All @@ -46,8 +45,6 @@ jobs:
node-version-file: .node-version
cache: npm
- run: npm ci
env:
SKIP_GENAPI: 1
- uses: actions/download-artifact@v4
with:
name: apis
Expand All @@ -68,8 +65,6 @@ jobs:
node-version-file: .node-version
cache: npm
- run: npm ci
env:
SKIP_GENAPI: 1
- uses: actions/download-artifact@v4
with:
name: apis
Expand All @@ -88,8 +83,6 @@ jobs:
node-version-file: .node-version
cache: npm
- run: npm ci
env:
SKIP_GENAPI: 1
- uses: actions/download-artifact@v4
with:
name: apis
Expand All @@ -108,8 +101,6 @@ jobs:
node-version-file: .node-version
cache: npm
- run: npm ci
env:
SKIP_GENAPI: 1
- uses: actions/download-artifact@v4
with:
name: apis
Expand All @@ -127,7 +118,7 @@ jobs:
with:
node-version-file: .node-version
cache: npm
- run: SKIP_GENAPI=1 npm ci
- run: npm ci
- uses: actions/download-artifact@v4
with:
name: apis
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
node-version-file: .node-version
cache: npm
- run: npm ci
- run: npm run gen-api
- uses: actions/upload-artifact@v4
with:
name: apis
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
node-version-file: .node-version
cache: npm
- run: npm ci
- run: npm run gen-api
- uses: actions/upload-artifact@v4
with:
name: apis
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ WORKDIR /app

RUN apk update

ENV NODE_ENV=production SKIP_GENAPI=1
ENV NODE_ENV=production

COPY package.json package-lock.json ./
COPY scripts/ ./scripts/
RUN npm ci
COPY . .
RUN npm run build
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"type-check": "vue-tsc --noEmit",
"test": "vitest --passWithNoTests",
"gen-api": "node scripts/generateApi.js",
"start-mock": "prism mock -p 4010 -d https://raw.githubusercontent.com/traPtitech/traPortfolio/main/docs/swagger/traPortfolio.v1.yaml",
"postinstall": "npm run gen-api"
"start-mock": "prism mock -p 4010 -d https://raw.githubusercontent.com/traPtitech/traPortfolio/main/docs/swagger/traPortfolio.v1.yaml"
},
"dependencies": {
"@iconify/iconify": "^3.1.1",
Expand Down
5 changes: 0 additions & 5 deletions scripts/generateApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ const generateCmd = [
`/local/${GENERATED_DIR}`
]

if (process.env.SKIP_GENAPI) {
// eslint-disable-next-line no-console
console.log('Skipped generating apis.')
}

;(async () => {
await fs.mkdir(path.resolve(__dirname, '../', GENERATED_DIR), {
recursive: true
Expand Down
Loading