Skip to content

Commit

Permalink
refactor: use yarn workspaces, bundle service via esbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
Noah Negin-Ulster committed Mar 18, 2022
1 parent f4c8bea commit 26549a5
Show file tree
Hide file tree
Showing 36 changed files with 1,934 additions and 14,022 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ jobs:
- uses: actions/checkout@v2
- uses: ./.github/actions/detect-env
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3.0.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Restore node modules cache
id: node-modules-cache
uses: actions/cache@v2
with:
path: ./client/node_modules
key: ${{ env.NODE_VERSION }}-${{ hashFiles('./client/yarn.lock') }}
path: ./node_modules
key: ${{ env.NODE_VERSION }}-${{ hashFiles('yarn.lock') }}
- name: lint client
uses: ./.github/actions/lint
with:
Expand Down Expand Up @@ -55,15 +55,15 @@ jobs:
- uses: actions/checkout@v2
- uses: ./.github/actions/detect-env
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3.0.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Restore node modules cache
id: node-modules-cache
uses: actions/cache@v2
with:
path: ./service/node_modules
key: ${{ env.NODE_VERSION }}-${{ hashFiles('./service/yarn.lock') }}
path: ./node_modules
key: ${{ env.NODE_VERSION }}-${{ hashFiles('yarn.lock') }}
- name: lint service
uses: ./.github/actions/lint
with:
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
- name: Load Docker Container
run: docker load < service/artifacts/build/docker-cache/sanity-service-docker.tar
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3.0.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Restore node modules cache
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
- name: Load Docker Container
run: docker load < service/artifacts/build/docker-cache/sanity-service-docker.tar
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3.0.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Restore node modules cache
Expand Down Expand Up @@ -191,15 +191,15 @@ jobs:
persist-credentials: false
- uses: ./.github/actions/detect-env
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3.0.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Restore node modules cache
id: node-modules-cache
uses: actions/cache@v2
with:
path: ./website/node_modules
key: ${{ env.NODE_VERSION }}-${{ hashFiles('./website/yarn.lock') }}
path: ./node_modules
key: ${{ env.NODE_VERSION }}-${{ hashFiles('yarn.lock') }}
- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14.19.0
lts/gallium
28 changes: 28 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"

pnpEnableEsmLoader: false

yarnPath: .yarn/releases/yarn-3.2.0.cjs
9 changes: 1 addition & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SHELL := /bin/bash
export PATH := $(shell yarn bin):$(PATH)

.PHONY: install
install: check-versions
install:
yarn install

.PHONY: deploy-release-dry
Expand All @@ -25,10 +25,3 @@ create-release-package:
rm -rf release-archive
mkdir release-archive
mv client/bin/* release-archive/

# ----- Helpers -----
.PHONY: check-versions
check-versions:
@./infrastructure/scripts/check-versions.sh


Binary file removed client/.yarn/install-state.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:10.16.3-slim
FROM node:16.14-slim

RUN apt-get update && \
apt-get install -yq python-pip jq git unzip && \
Expand Down
7 changes: 2 additions & 5 deletions client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ endif
ESLINT_ARGS=--max-warnings 0 $(ESLINT_EXTRA_ARGS)

.PHONY: install
install: check-versions
install:
yarn install

.PHONY: build-docker
Expand All @@ -28,12 +28,9 @@ endif

.PHONY: package
package:
yarn pkg . --out-path bin/
yarn pkg . --out-path bin/ --targets "node16"

# ----- Helpers -----
.PHONY: check-versions
check-versions:
@../infrastructure/scripts/check-versions.sh

.PHONY: clean
clean:
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"fs-extra": "^8.0.0",
"glob": "^7.1.2",
"lodash": "^4.17.19",
"pkg": "^5.3.2",
"pkg": "^5.5.2",
"promise-retry": "^1.1.1",
"unique-string": "^2.0.0",
"xml2js": "^0.4.19"
Expand Down

0 comments on commit 26549a5

Please sign in to comment.