From 325b515c979811272866040166deebc0d8a18bee Mon Sep 17 00:00:00 2001 From: Sami HAMINE Date: Sun, 10 Sep 2023 16:55:16 +0200 Subject: [PATCH] Upgrade node version CI workflow --- Makefile | 81 +++++++++++++++++++++----------------------------------- 1 file changed, 30 insertions(+), 51 deletions(-) diff --git a/Makefile b/Makefile index ca8b70a..04e07a0 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ BIN := ./node_modules/.bin +yarn_run := yarn run help: ## Lists all available make tasks and some short documentation about them @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-24s\033[0m %s\n", $$1, $$2}' @@ -8,23 +9,27 @@ help: ## Lists all available make tasks and some short documentation about them ## Basic repo maintenance # Installs npm dependencies -node_modules: package.json yarn.lock - yarn install +# node_modules: +# yarn set version self +# yarn install --immutable +# @touch $@ +node_modules: + yarn install --immutable @touch $@ -build: ## Builds typescript files and UMD library - yarn clean && yarn build-prep && yarn concurrently "yarn umd" "yarn pkg" -.PHONY: build - -build-browser: - @rm -rf dist/umd - @yarn umd --no-stats +build-browser: build # build dependencies + $(yarn_run) umd --no-stats .PHONY: build-browser -build-prod: ## Builds libraries in prod mode - NODE_ENV=production yarn clean && yarn build-prep && yarn concurrently "NODE_ENV=production yarn umd" "NODE_ENV=production yarn pkg" "NODE_ENV=production yarn cjs" +# build: ## Builds libraries in prod mode, and all dependencies +# yarn run -T browser+deps build +# .PHONY: build + +build: ## Builds libraries in prod mode, and all dependencies + yarn run build .PHONY: build + clean: ## Clean the build directory rm -rf dist generated .PHONY: clean @@ -32,63 +37,41 @@ clean: ## Clean the build directory ## Test Commands tdd: node_modules ## Runs unit tests in watch mode - $(BIN)/jest --watch + $(yarn_run) test --watch .PHONY: tdd test-unit: node_modules ## Runs unit tests - $(BIN)/jest + $(yarn_run) test .PHONY: test-unit -test-unit-update-snapshots: node_modules ## Runs unit tests and updates snapshots - $(BIN)/jest --updateSnapshot -.PHONY: test-unit-update-snapshots - test-coverage: node_modules ## Runs unit tests with coverage - $(BIN)/jest --coverage --forceExit + $(yarn_run) test --coverage --forceExit .PHONY: test-coverage test-qa: build-browser ## Runs all QA tests in a single command - $(BIN)/jest --runTestsByPath qa/__tests__/*.test.ts --testPathIgnorePatterns qa/__tests__/destinations.test.ts --reporters="default" --reporters="/qa/lib/jest-reporter.js" ${args} + $(yarn_run) test --runTestsByPath qa/__tests__/*.test.ts --testPathIgnorePatterns qa/__tests__/destinations.test.ts --reporters="default" --reporters="/qa/lib/jest-reporter.js" ${args} .PHONY: test-coverage test-qa-destinations: build-browser ## Runs Destination QA tests. options. DESTINATION=amplitude DEBUG=true - $(BIN)/jest --forceExit --runTestsByPath qa/__tests__/destinations.test.ts --reporters="default" --reporters="/qa/lib/jest-reporter.js" ${args} + $(yarn_run) test --forceExit --runTestsByPath qa/__tests__/destinations.test.ts --reporters="default" --reporters="/qa/lib/jest-reporter.js" ${args} .PHONY: test-coverage -test-integration: build-browser ## Runs all integration tests in a single command - $(BIN)/jest --runTestsByPath e2e-tests/**/*.test.ts ${args} +test-integration: build ## Runs all integration tests in a single command + $(yarn_run) test --forceExit --runTestsByPath e2e-tests/**/*.test.ts ${args} .PHONY: test-coverage -test-perf: build-browser ## Runs all integration tests in a single command - $(BIN)/jest --runTestsByPath e2e-tests/performance/*.test.ts ${args} +test-perf: build ## Runs all integration tests in a single command + $(yarn_run) test --forceExit --runTestsByPath e2e-tests/performance/*.test.ts ${args} .PHONY: test-coverage lint: node_modules ## Lints the source code - $(BIN)/eslint '**/*.{js,jsx,ts,tsx}' + $(yarn_run) lint .PHONY: lint ci: bash ./scripts/ci.sh .PHONY: ci -actions-ci: - bash ./scripts/actions-ci.sh -.PHONY: ci - -size: ## Verify the final size of Analytics-Next - NODE_ENV=production yarn umd > /dev/null && yarn size-limit -.PHONY: size - -release: ## Releases Analytics Next to stage - yarn np --yolo --no-publish --no-release-draft -.PHONY: release - -release-manual: ## Releases Analytics Next to production - make build-prod - NODE_ENV=production aws-okta exec plat-write -- ./scripts/release.js - npm publish -.PHONY: release-prod-manual - handshake: @echo "📡 Establishing Remote connection" @robo --config ~/dev/src/github.com/segmentio/robofiles/development/robo.yml prod.ssh echo "✅ Connected" @@ -102,14 +85,10 @@ rebuild-sources-stage: # Rebuilds all sources that are using ajs-next in stage @robo --config ~/dev/src/github.com/segmentio/robofiles/development/robo.yml rebuild-all-stage .PHONY: rebuild-sources-stage -analyze: +analyze: NODE_ENV=production $(BIN)/webpack --profile --json > stats.json && $(BIN)/webpack-bundle-analyzer --port 4200 stats.json .PHONY: analyze -dev: build ## Starts a dev server that is ready for development - yarn concurrently "yarn run-example" "yarn pkg -w" -.PHONY: build - -standalone-example: ## Runs a server with standalone ajs examples - yarn concurrently "yarn webpack -w" "yarn serve" -.PHONY: standalone-example \ No newline at end of file +dev: ## Starts a dev server that is ready for development + yarn workspace @example/with-next-js run dev +.PHONY: dev