Skip to content

Commit

Permalink
go back to using yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
shlokamin committed Feb 29, 2024
1 parent b3dac06 commit 91b3722
Show file tree
Hide file tree
Showing 26 changed files with 19,376 additions and 24,108 deletions.
34 changes: 17 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ endif

# run at usage (=), not on makefile parse (:=)
# todo(mm, 2021-03-17): Deduplicate with scripts/python.mk.
usb_host=$(shell pnpm -s discovery find -i 169.254)
usb_host=$(shell yarn -s discovery find -i 169.254)

# install all project dependencies
.PHONY: setup
setup: setup-js setup-py

# front-end dependecies handled by pnpm
# front-end dependecies handled by yarn
.PHONY: setup-js
setup-js:
pnpm i
yarn
$(MAKE) -C $(APP_SHELL_DIR) setup
$(MAKE) -C $(APP_SHELL_ODD_DIR) setup

Expand All @@ -80,7 +80,7 @@ teardown:

.PHONY: teardown-js
teardown-js: clean-js
pnpm shx rm -rf "**/node_modules"
yarn shx rm -rf "**/node_modules"

PYTHON_TEARDOWN_TARGETS := $(addsuffix -py-teardown, $(PYTHON_DIRS))

Expand Down Expand Up @@ -208,16 +208,16 @@ lint-py: $(PYTHON_LINT_TARGETS)

.PHONY: lint-js
lint-js:
pnpm eslint --quiet=$(quiet) ".*.@(js|ts|tsx)" "**/*.@(js|ts|tsx)"
pnpm prettier --ignore-path .eslintignore --check $(FORMAT_FILE_GLOB)
yarn eslint --quiet=$(quiet) ".*.@(js|ts|tsx)" "**/*.@(js|ts|tsx)"
yarn prettier --ignore-path .eslintignore --check $(FORMAT_FILE_GLOB)

.PHONY: lint-json
lint-json:
pnpm eslint --max-warnings 0 --ext .json .
yarn eslint --max-warnings 0 --ext .json .

.PHONY: lint-css
lint-css:
pnpm stylelint "**/*.css" "**/*.js"
yarn stylelint "**/*.css" "**/*.js"

.PHONY: format
format: format-js format-py
Expand All @@ -232,31 +232,31 @@ format-py: $(PYTHON_FORMAT_TARGETS)

.PHONY: format-js
format-js:
pnpm prettier --ignore-path .eslintignore --write $(FORMAT_FILE_GLOB)
yarn prettier --ignore-path .eslintignore --write $(FORMAT_FILE_GLOB)

.PHONY: check-js
check-js: build-ts

.PHONY: build-ts
build-ts:
pnpm tsc --build
yarn tsc --build

.PHONY: clean-ts
clean-ts:
pnpm tsc --build --clean
yarn tsc --build --clean

# TODO: Ian 2019-12-17 gradually add components and shared-data
.PHONY: circular-dependencies-js
circular-dependencies-js:
pnpm madge $(and $(CI),--no-spinner --no-color) --circular protocol-designer/src/index.tsx
pnpm madge $(and $(CI),--no-spinner --no-color) --circular step-generation/src/index.ts
pnpm madge $(and $(CI),--no-spinner --no-color) --circular labware-library/src/index.tsx
pnpm madge $(and $(CI),--no-spinner --no-color) --circular app/src/index.tsx
pnpm madge $(and $(CI),--no-spinner --no-color) --circular components/src/index.ts
yarn madge $(and $(CI),--no-spinner --no-color) --circular protocol-designer/src/index.tsx
yarn madge $(and $(CI),--no-spinner --no-color) --circular step-generation/src/index.ts
yarn madge $(and $(CI),--no-spinner --no-color) --circular labware-library/src/index.tsx
yarn madge $(and $(CI),--no-spinner --no-color) --circular app/src/index.tsx
yarn madge $(and $(CI),--no-spinner --no-color) --circular components/src/index.ts

.PHONY: test-js-internal
test-js-internal:
pnpm jest $(tests) $(test_opts) $(cov_opts)
yarn jest $(tests) $(test_opts) $(cov_opts)

.PHONY: test-js-%
test-js-%:
Expand Down
4 changes: 2 additions & 2 deletions api-client/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# opentrons api-client makefile

# using bash instead of /bin/bash in SHELL prevents macOS optimizing away our PATH update
# TODO(mc, 2021-02-12): this may be unnecessary by using `pnpm run` instead
# TODO(mc, 2021-02-12): this may be unnecessary by using `yarn run` instead
SHELL := bash

# standard targets
Expand All @@ -12,7 +12,7 @@ all: clean build

.PHONY: clean
clean:
tsc --build --clean && pnpm shx rm -rf \"dist\"
tsc --build --clean && yarn shx rm -rf \"dist\"

.PHONY: build
build:
Expand Down
10 changes: 5 additions & 5 deletions app-shell-odd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include ../scripts/push.mk
SHELL := bash

# add node_modules/.bin to PATH
PATH := $(shell cd .. && pnpm bin):$(PATH)
PATH := $(shell cd .. && yarn bin):$(PATH)

# dev server port
PORT ?= 5173
Expand All @@ -21,11 +21,11 @@ noop := cd .
# Other SSH args for robots
ssh_opts ?= $(default_ssh_opts)

builder := pnpm electron-builder \
builder := yarn electron-builder \
--config electron-builder.config.js \
--publish never

electron := pnpm electron . \
electron := yarn electron . \
--devtools \
--log.level.console="debug" \
--disable_ui.webPreferences.webSecurity \
Expand All @@ -41,10 +41,10 @@ OPENTRONS_PROJECT ?= robot-stack
all: package

.PHONY: setup
# must be wrapped in pnpm run otherwise `prebuild-install` will fail silently
# must be wrapped in yarn run otherwise `prebuild-install` will fail silently
# due to how `electron-rebuild` calls `prebuild-install`
setup:
pnpm rebuild
yarn rebuild

.PHONY: clean
clean:
Expand Down
14 changes: 7 additions & 7 deletions app-shell/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include ../scripts/push.mk
SHELL := bash

# add node_modules/.bin to PATH
PATH := $(shell cd .. && pnpm bin):$(PATH)
PATH := $(shell cd .. && yarn bin):$(PATH)

# dev server port
PORT ?= 3000
Expand Down Expand Up @@ -57,13 +57,13 @@ OPENTRONS_PROJECT ?= $(if $(filter ot3@%,$(publish_update)),ot3,robot-stack)
# make dist no_python_bundle=true or =1 or whatever
no_python_bundle ?=

builder := pnpm electron-builder \
builder := yarn electron-builder \
--config electron-builder.config.js \
--config.electronVersion=23.3.13 \
--config.electronVersion=27.0.0 \
--publish never


electron := pnpm electron . \
electron := yarn electron . \
--devtools \
--log.level.console="debug" \
--disable_ui.webPreferences.webSecurity \
Expand All @@ -82,14 +82,14 @@ branch-suffix:
all: package

.PHONY: setup
# must be wrapped in pnpm run otherwise `prebuild-install` will fail silently
# must be wrapped in yarn run otherwise `prebuild-install` will fail silently
# due to how `electron-rebuild` calls `prebuild-install`
setup:
pnpm i
yarn rebuild

.PHONY: clean
clean:
shx rm -rf lib dist python
yarn shx rm -rf lib dist python

# artifacts
#####################################################################
Expand Down
2 changes: 1 addition & 1 deletion app-shell/electron-builder.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const publishConfig =
module.exports = async () => ({
appId:
project === 'robot-stack' ? 'com.opentrons.app' : 'com.opentrons.appot3',
electronVersion: '23.3.13',
electronVersion: '27.0.0',
npmRebuild: false,
releaseInfo: {
releaseNotesFile:
Expand Down
2 changes: 1 addition & 1 deletion app-testing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ teardown:

.PHONY: format-readme
format-readme:
pnpm prettier --ignore-path .eslintignore --write app-testing/**/*.md
yarn prettier --ignore-path .eslintignore --write app-testing/**/*.md

.PHONY: print-protocols
print-protocols:
Expand Down
4 changes: 2 additions & 2 deletions app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
SHELL := bash

# add node_modules/.bin to PATH
PATH := $(shell cd .. && pnpm bin):$(PATH)
PATH := $(shell cd .. && yarn bin):$(PATH)

# dev server port
PORT ?= 5173
Expand Down Expand Up @@ -35,7 +35,7 @@ all: clean dist

.PHONY: setup
setup:
pnpm i
yarn

.PHONY: clean
clean:
Expand Down
8 changes: 4 additions & 4 deletions components/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,26 @@ all: clean dist

.PHONY: clean
clean:
cd .. && pnpm shx rm -rf storybook-static
cd .. && yarn shx rm -rf storybook-static

# artifacts
#####################################################################

.PHONY: dist
dist:
cd .. && pnpm sb build
cd .. && yarn sb build

.PHONY: lib
lib: export NODE_ENV := production
lib:
pnpm vite build
yarn vite build

# development
#####################################################################

.PHONY: dev
dev:
cd .. && pnpm sb dev --port $(port)
cd .. && yarn sb dev --port $(port)

.PHONY: test
test:
Expand Down
6 changes: 3 additions & 3 deletions discovery-client/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# opentrons discovery-client makefile

# using bash instead of /bin/bash in SHELL prevents macOS optimizing away our PATH update
# TODO(mc, 2021-02-12): this may be unnecessary by using `pnpm run` instead
# TODO(mc, 2021-02-12): this may be unnecessary by using `yarn run` instead
SHELL := bash

# outputs
Expand All @@ -16,7 +16,7 @@ all: clean lib

.PHONY: clean
clean:
pnpm shx rm -rf $(main_out) $(cli_out)
yarn shx rm -rf $(main_out) $(cli_out)

# artifacts
#####################################################################
Expand All @@ -26,7 +26,7 @@ lib: export NODE_ENV := production
lib: $(main_out) $(cli_out)

$(main_out) $(cli_out):
pnpm vite build
yarn vite build

.PHONY: test
test:
Expand Down
4 changes: 2 additions & 2 deletions g-code-testing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ FORMAT_FILE_GLOB = "g-code-testing/**/*.@(json|md|yml|yaml)"
.PHONY: format-other
format-other:
cd ..
pnpm prettier --ignore-path .eslintignore --write $(FORMAT_FILE_GLOB)
yarn prettier --ignore-path .eslintignore --write $(FORMAT_FILE_GLOB)

.PHONY: lint-other
lint-other:
cd ..
pnpm prettier --check --ignore-path .eslintignore $(FORMAT_FILE_GLOB)
yarn prettier --check --ignore-path .eslintignore $(FORMAT_FILE_GLOB)
4 changes: 2 additions & 2 deletions labware-designer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
SHELL := bash

# add node_modules/.bin to PATH
PATH := $(shell cd .. && pnpm bin):$(PATH)
PATH := $(shell cd .. && yarn bin):$(PATH)

# standard targets
#####################################################################
Expand All @@ -14,7 +14,7 @@ all: clean dist

.PHONY: setup
setup:
pnpm
yarn

.PHONY: clean
clean:
Expand Down
2 changes: 1 addition & 1 deletion labware-library/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
SHELL := bash

# add node_modules/.bin to PATH
PATH := $(shell cd .. && pnpm bin):$(PATH)
PATH := $(shell cd .. && yarn bin):$(PATH)

# These variables can be overriden when make is invoked to customize the
# behavior of jest
Expand Down
18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
{
"name": "opentrons",
"private": true,
"workspaces": {
"packages": [
"app",
"app-shell",
"app-shell-odd",
"components",
"discovery-client",
"labware-designer",
"labware-library",
"protocol-designer",
"shared-data",
"step-generation",
"webpack-config",
"api-client",
"react-api-client",
"usb-bridge/node-client"
]
},
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
Expand Down
Loading

0 comments on commit 91b3722

Please sign in to comment.