Skip to content

Commit

Permalink
migrate from lerna to nx completely
Browse files Browse the repository at this point in the history
Signed-off-by: Kaden Emley <[email protected]>
  • Loading branch information
kemley76 committed Jul 30, 2024
1 parent cdabb7d commit 826dd13
Show file tree
Hide file tree
Showing 8 changed files with 2,561 additions and 141 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ WORKDIR /src
# python3/make/compiler is a requirement for node-gyp
RUN curl -sL https://dl.yarnpkg.com/rpm/yarn.repo -o /etc/yum.repos.d/yarn.repo && microdnf install -y python3 make gcc-c++ yarn && microdnf clean all && rm -rf /mnt/rootfs/var/cache/* /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.*

COPY package.json yarn.lock lerna.json tsconfig.json postcss.config.js ./
COPY package.json yarn.lock nx.json tsconfig.json ./
COPY apps/backend/package.json apps/backend/tsconfig.* ./apps/backend/
COPY apps/frontend/package.json apps/frontend/tsconfig.* ./apps/frontend/
COPY libs/hdf-converters/package.json libs/hdf-converters/tsconfig.* ./libs/hdf-converters/
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.lite
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ WORKDIR /src
# python3/make/compiler is a requirement for node-gyp
RUN curl -sL https://dl.yarnpkg.com/rpm/yarn.repo -o /etc/yum.repos.d/yarn.repo && microdnf install -y python3 make gcc-c++ yarn && microdnf clean all && rm -rf /mnt/rootfs/var/cache/* /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.*

COPY package.json yarn.lock lerna.json tsconfig.json postcss.config.js ./
COPY package.json yarn.lock nx.json tsconfig.json ./
COPY apps/frontend/package.json apps/frontend/tsconfig.json ./apps/frontend/
COPY libs/hdf-converters/package.json libs/hdf-converters/tsconfig.* ./libs/hdf-converters/
COPY libs/inspecjs/package.json libs/inspecjs/tsconfig.* ./libs/inspecjs/
Expand Down
15 changes: 12 additions & 3 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"src/server.js"
],
"scripts": {
"build": "nx run build",
"prebuild": "rimraf ../../dist/frontend",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"lint:ci": "vue-cli-service lint --no-fix --maxWarnings 0",
"make:component": "vue-cli-service make:component",
Expand All @@ -24,7 +25,7 @@
"prepack": "vue-cli-service build --dest dist && cp ../../README.md README.md && cp package.json package.json.orig && cat package.json.orig | jq '.dependencies = (.dependencies | with_entries(select(.key | contains(\"express\"))))' > package.json",
"postpack": "mv package.json.orig package.json && rm README.md",
"start:dev": "yarn workspace @mitre/hdf-converters build && vue-cli-service serve",
"test": "nx run test"
"test": "jest"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.425.0",
Expand Down Expand Up @@ -131,5 +132,13 @@
"branch": "/blob/master/",
"changelog": "/releases",
"issues": "/issues/new/choose",
"readme": "README.md"
"readme": "README.md",
"nx": {
"implicitDependencies": ["@mitre/hdf-converters"],
"targets": {
"test": {
"dependsOn": ["^build"]
}
}
}
}
28 changes: 0 additions & 28 deletions apps/frontend/project.json

This file was deleted.

5 changes: 0 additions & 5 deletions lerna.json

This file was deleted.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
"test"
],
"scripts": {
"backend": "yarn workspace heimdall-server",
"backend": "yarn workspace heimdall-server nx",
"build": "nx run-many --target=build --all",
"cypress-test": "yarn workspace @heimdall/cypress-tests",
"frontend": "yarn workspace @mitre/heimdall-lite",
"hdf-converters": "yarn workspace @mitre/hdf-converters",
"inspecjs": "yarn workspace inspecjs",
"lint": "lerna run lint",
"lint:ci": "lerna run lint:ci",
"pack:all": "lerna exec yarn pack --scope inspecjs --scope @mitre/heimdall-lite --scope @mitre/hdf-converters --parallel",
"cypress-test": "yarn workspace @heimdall/cypress-tests nx",
"frontend": "yarn workspace @mitre/heimdall-lite nx",
"hdf-converters": "yarn workspace @mitre/hdf-converters nx",
"inspecjs": "yarn workspace inspecjs nx",
"lint": "nx run-many --target=lint --all",
"lint:ci": "nx run-many --target=lint:ci --all",
"pack:all": "nx exec --parallel -p inspecjs @mitre/hdf-converters @mitre/heimdall-lite -- yarn pack",
"start": "yarn backend start",
"start:dev": "./node_modules/.bin/dotenv -e apps/backend/.env -- lerna exec yarn run start:dev --ignore @heimdall/interfaces --ignore @mitre/hdf-converters --ignore @heimdall/password-complexity --ignore @heimdall/cypress-tests --ignore inspecjs",
"start:dev": "./node_modules/.bin/dotenv -- nx run-many -p heimdall-server @mitre/heimdall-lite --target=start:dev --output-style=stream",
"test:ui": "cypress run",
"test:ui:open": "cypress open"
},
Expand All @@ -27,7 +27,7 @@
"eslint": "^8.9.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"lerna": "^8.1.2",
"nx": "^19.5.3",
"prettier": "^3.2.4",
"prettier-plugin-organize-imports": "^4.0.0",
"typescript": "^4.9.3",
Expand Down
5 changes: 0 additions & 5 deletions postcss.config.js

This file was deleted.

Loading

0 comments on commit 826dd13

Please sign in to comment.