Skip to content

Commit

Permalink
Merge pull request #3952 from weaveworks/3943-yarn
Browse files Browse the repository at this point in the history
Convert to yarn for package management
  • Loading branch information
jpellizzari authored Aug 25, 2023
2 parents 059050d + edc87f5 commit 2888e24
Show file tree
Hide file tree
Showing 17 changed files with 7,213 additions and 26,530 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:
- uses: actions/checkout@v3
- name: Node modules cache
uses: actions/cache@v2
id: yarn-cache
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: ~/.cache/yarn
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
Expand All @@ -41,7 +41,7 @@ jobs:
- name: Check that package.json & package-lock.json were updated in commit
run: |
echo "Using node.js "$(node --version)
echo "Using NPM "$(npm --version)
echo "Using Yarn "$(yarn --version)
git diff --no-ext-diff --exit-code
- run: make ui-audit
- run: make ui
Expand Down Expand Up @@ -229,7 +229,7 @@ jobs:
node-version: "16.X"
registry-url: "https://npm.pkg.github.com"
scope: "@weaveworks"
- run: npm install
- run: yarn
- run: make ui-lib
- name: Update package version
id: package-version
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/prepare-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ jobs:
run: |
jq '.version = "'$GITOPS_VERSION'"' < package.json > package-new.json
mv package-new.json package.json
npm install
npm run test -- -u
yarn
yarn test -- -u
git commit -am "Update javascript library version to $GITOPS_VERSION"
- name: Update Chart
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
node-version: "16.X"
registry-url: "https://npm.pkg.github.com"
scope: "@weaveworks"
- run: npm install
- run: yarn
- run: make ui-lib && cd dist && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
22 changes: 13 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -162,26 +162,30 @@ docker-gitops-bucket-server: _docker ## Build a Docker image of the Gitops UI Se
##@ UI
# Build the UI for embedding
ui: node_modules $(shell find ui -type f) ## Build the UI
npm run build
yarn build

node_modules: ## Install node modules
rm -rf .parcel-cache
npm install-clean
yarn --pure-lockfile

ui-lint: ## Run linter against the UI
npm run lint
yarn lint
yarn typecheck

ui-prettify-check: ## Check format of the UI code with Prettier
npm run prettify:check
yarn prettify:check

ui-prettify-format: ## Format the UI code with Prettier
npm run prettify:format
yarn prettify:format

ui-test: ## Run UI tests
npm run test
yarn test

ui-audit: ## Run audit against the UI
npm audit --production
yarn audit --production

ui-audit-fix: ## Run audit against the UI
yarn yarn-audit-fix

# Build the UI as an NPM package (hosted on github)
ui-lib: node_modules dist/index.js dist/index.d.ts ## Build UI libraries
Expand All @@ -190,10 +194,10 @@ ui-lib: node_modules dist/index.js dist/index.d.ts ## Build UI libraries
@find dist -type f -iname \*.woff -delete

dist/index.js: ui/index.ts
npm run build:lib && cp package.json dist
yarn build:lib && cp package.json dist

dist/index.d.ts: ui/index.ts
npm run typedefs
yarn typedefs

# Runs a test to raise errors if the integration between Gitops Core and EE is
# in danger of breaking due to package API changes.
Expand Down
2 changes: 1 addition & 1 deletion doc/development-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Then we make our node_modules, this will take a little while.

Then we fire up our frontend server.

`$ npm start`
`$ yarn start`

Goto login with username: dev, password:dev at http://localhost:4567/sign_in

Expand Down
Loading

0 comments on commit 2888e24

Please sign in to comment.