Skip to content

Commit

Permalink
Npm to Yarn (#103)
Browse files Browse the repository at this point in the history
* Build Tool Npm to Yarn

* Build Tool Npm to Yarn

* Build Tool Npm to Yarn
  • Loading branch information
seungh0 authored Aug 5, 2024
1 parent 4079eac commit d32eb41
Show file tree
Hide file tree
Showing 4 changed files with 11,056 additions and 35,185 deletions.
28 changes: 18 additions & 10 deletions .github/workflows/ci-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,30 @@ jobs:
with:
node-version: ${{ matrix.node }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache yarn cache
id: cache-yarn
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
${{ runner.os }}-node_modules-
- name: Install and Build
run: |
npm install
npm run build
yarn install --frozen-lockfile
yarn run build
working-directory: cassdio-web/src/main/webapp
13 changes: 8 additions & 5 deletions cassdio-web/frontend.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,32 @@ if (frontend.toBoolean()) {

node {
version = '20.15.1'
npmVersion = '9.8.0'
yarnVersion = '1.22.22'
download = true

nodeProjectDir.set(projectDir)
}

task npmInstall2(type: NpmTask) {
tasks.register('yarnInstall2', YarnTask) {
args = ['install']
}

task npmBuild(type: NpmTask, dependsOn: npmInstall2) {
tasks.register('yarnBuild', YarnTask) {
dependsOn yarnInstall2
args = ['run', 'build']
}

task copyDist(type: Copy, dependsOn: npmBuild) {
tasks.register('copyDist', Copy) {
dependsOn yarnBuild
from("${projectDir}/build") {
include '**/*'
}
into "${project.rootDir}/cassdio-web/src/main/resources/static"
includeEmptyDirs = true
}

task deleteDist(type: Delete, dependsOn: copyDist) {
tasks.register('deleteDist', Delete) {
dependsOn copyDist
delete "${projectDir}/build"
}

Expand Down
Loading

0 comments on commit d32eb41

Please sign in to comment.