From 39e5519a03995fb8b198edc8e9804cf7a1af07c3 Mon Sep 17 00:00:00 2001 From: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> Date: Thu, 27 Apr 2023 11:14:22 -0700 Subject: [PATCH 1/3] fix: Ensure top level commands work correctly --- package.json | 5 ++--- packages/shared/common/tsconfig.json | 2 +- packages/shared/sdk-server/tsconfig.json | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 5bee76a6f..363cc986b 100644 --- a/package.json +++ b/package.json @@ -11,13 +11,12 @@ ], "private": true, "scripts": { - "clean": "npx tsc --build --clean", - "build": "npx tsc --build", + "clean": "yarn workspaces foreach -pt run clean", + "build": "yarn workspaces foreach -pt run build", "//": "When using build:doc you need to specify the workspace. 'yarn run build:doc packages/shared/common' for example.", "build:doc": "./scripts/build-doc.sh $1", "lint": "npx eslint . --ext .ts", "lint:fix": "yarn run lint -- --fix", - "test": "npx jest", "coverage": "npm run test -- --coverage", "contract-test-service": "npm --prefix contract-tests install && npm --prefix contract-tests start", "contract-test-harness": "curl -s https://raw.githubusercontent.com/launchdarkly/sdk-test-harness/master/downloader/run.sh \\ | VERSION=v2 PARAMS=\"-url http://localhost:8000 -debug -stop-service-at-end $TEST_HARNESS_PARAMS\" sh", diff --git a/packages/shared/common/tsconfig.json b/packages/shared/common/tsconfig.json index 960ca914a..19e8b1e59 100644 --- a/packages/shared/common/tsconfig.json +++ b/packages/shared/common/tsconfig.json @@ -14,5 +14,5 @@ "declarationMap": true, // enables importers to jump to source "stripInternal": true }, - "exclude": ["**/*.test.ts", "__tests__"] + "exclude": ["**/*.test.ts", "dist", "node_modules", "__tests__"] } diff --git a/packages/shared/sdk-server/tsconfig.json b/packages/shared/sdk-server/tsconfig.json index 960ca914a..19e8b1e59 100644 --- a/packages/shared/sdk-server/tsconfig.json +++ b/packages/shared/sdk-server/tsconfig.json @@ -14,5 +14,5 @@ "declarationMap": true, // enables importers to jump to source "stripInternal": true }, - "exclude": ["**/*.test.ts", "__tests__"] + "exclude": ["**/*.test.ts", "dist", "node_modules", "__tests__"] } From e5bd1b6674b65520096db9942ddfdb98324aa9b1 Mon Sep 17 00:00:00 2001 From: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> Date: Thu, 27 Apr 2023 11:14:47 -0700 Subject: [PATCH 2/3] Warn on tests. --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 363cc986b..fda3549e3 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "build:doc": "./scripts/build-doc.sh $1", "lint": "npx eslint . --ext .ts", "lint:fix": "yarn run lint -- --fix", + "test": "echo Please run tests for individual packages.", "coverage": "npm run test -- --coverage", "contract-test-service": "npm --prefix contract-tests install && npm --prefix contract-tests start", "contract-test-harness": "curl -s https://raw.githubusercontent.com/launchdarkly/sdk-test-harness/master/downloader/run.sh \\ | VERSION=v2 PARAMS=\"-url http://localhost:8000 -debug -stop-service-at-end $TEST_HARNESS_PARAMS\" sh", From 58f84b7233369ba7ecba6648a34d4a90b89ef638 Mon Sep 17 00:00:00 2001 From: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> Date: Thu, 27 Apr 2023 11:24:30 -0700 Subject: [PATCH 3/3] Clean properly --- packages/sdk/cloudflare/package.json | 1 + packages/sdk/server-node/package.json | 1 + packages/shared/common/package.json | 1 + packages/shared/sdk-server-edge/package.json | 1 + packages/shared/sdk-server/package.json | 1 + 5 files changed, 5 insertions(+) diff --git a/packages/sdk/cloudflare/package.json b/packages/sdk/cloudflare/package.json index 9b847fdc8..f463b37ba 100644 --- a/packages/sdk/cloudflare/package.json +++ b/packages/sdk/cloudflare/package.json @@ -28,6 +28,7 @@ "scripts": { "doc": "../../../scripts/build-doc.sh .", "build": "../../../scripts/build-package.sh", + "clean": "rimraf dist", "tsw": "yarn tsc --watch", "start": "rimraf dist && yarn tsw", "lint": "eslint . --ext .ts", diff --git a/packages/sdk/server-node/package.json b/packages/sdk/server-node/package.json index 8d3ab80cc..f06391279 100644 --- a/packages/sdk/server-node/package.json +++ b/packages/sdk/server-node/package.json @@ -19,6 +19,7 @@ "client" ], "scripts": { + "clean": "npx tsc --build --clean", "//": "We run the tests in-band because the FS tests work best sequential.", "test": "npx jest --ci --runInBand", "build": "npx tsc", diff --git a/packages/shared/common/package.json b/packages/shared/common/package.json index 43ec1f0d1..f5400e4de 100644 --- a/packages/shared/common/package.json +++ b/packages/shared/common/package.json @@ -21,6 +21,7 @@ "scripts": { "test": "npx jest --ci", "build": "npx tsc", + "clean": "npx tsc --build --clean", "lint": "npx eslint . --ext .ts", "lint:fix": "yarn run lint -- --fix" }, diff --git a/packages/shared/sdk-server-edge/package.json b/packages/shared/sdk-server-edge/package.json index f732bbbc7..2855b7f82 100644 --- a/packages/shared/sdk-server-edge/package.json +++ b/packages/shared/sdk-server-edge/package.json @@ -28,6 +28,7 @@ "doc": "../../../scripts/build-doc.sh .", "build": "../../../scripts/build-package.sh", "tsw": "yarn tsc --watch", + "clean": "rimraf dist", "start": "rimraf dist && yarn tsw", "lint": "eslint . --ext .ts", "prettier": "prettier --write '**/*.@(js|ts|tsx|json|css)' --ignore-path ../../../.prettierignore", diff --git a/packages/shared/sdk-server/package.json b/packages/shared/sdk-server/package.json index 4eda259f3..47e58646e 100644 --- a/packages/shared/sdk-server/package.json +++ b/packages/shared/sdk-server/package.json @@ -21,6 +21,7 @@ "scripts": { "test": "npx jest --ci", "build": "npx tsc", + "clean": "npx tsc --build --clean", "lint": "npx eslint . --ext .ts", "lint:fix": "yarn run lint -- --fix" },