diff --git a/.nxignore b/.nxignore new file mode 100644 index 0000000000..885f2fc229 --- /dev/null +++ b/.nxignore @@ -0,0 +1,4 @@ +packages/**/dist +packages/**/static/build +packages/**/build/webpack +packages/**/binaries diff --git a/package-lock.json b/package-lock.json index d398f4aef3..1232778a9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37600,7 +37600,8 @@ "@swc/core": "^1.3.44", "@types/node": "^16.18.11", "@types/semver": "^7.3.13", - "rimraf": "^4.4.1" + "rimraf": "^4.4.1", + "run-script-os": "^1.1.6" } }, "packages/bump-version-for-cron/node_modules/@swc/core": { @@ -39514,7 +39515,8 @@ "@types/node": "^16.18.11", "@types/semver": "^7.3.13", "@types/tar-stream": "^2.2.2", - "rimraf": "^4.4.1" + "rimraf": "^4.4.1", + "run-script-os": "^1.1.6" } }, "packages/ensure-binaries/node_modules/@swc/core": { @@ -40043,7 +40045,8 @@ "@types/jsdom": "^20.0.1", "@types/node": "^18.11.18", "@types/sharp": "^0.31.1", - "rimraf": "^4.4.1" + "rimraf": "^4.4.1", + "run-script-os": "^1.1.6" } }, "packages/generate-tray-icons/node_modules/@swc/core": { @@ -43704,7 +43707,8 @@ "@types/inquirer": "^9.0.3", "@types/node": "^16.18.11", "@types/semver": "^7.3.13", - "rimraf": "^4.4.1" + "rimraf": "^4.4.1", + "run-script-os": "^1.1.6" } }, "packages/release-tool/node_modules/@swc/core": { diff --git a/package.json b/package.json index 00b7c62388..016cb3464c 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,10 @@ "build:docs": "lerna run --stream build:docs", "clean": "lerna run clean --stream", "clean:node_modules": "lerna clean -y && rimraf node_modules", - "dev": "lerna run dev --stream --skip-nx-cache", + "dev": "cross-env NODE_ENV=development lerna run build --stream --skip-nx-cache", + "postdev": "lerna watch -- lerna run build --stream --scope \\$LERNA_PACKAGE_NAME", + "prestart-dev": "cd packages/open-lens && rimraf static/build/ && npm run build:tray-icons && npm run download:binaries", + "start-dev": "lerna run start", "lint": "lerna run lint --stream", "lint:fix": "lerna run lint:fix --stream", "mkdocs:serve-local": "docker build -t mkdocs-serve-local:latest mkdocs/ && docker run --rm -it -p 8000:8000 -v ${PWD}:/docs mkdocs-serve-local:latest", diff --git a/packages/bump-version-for-cron/package.json b/packages/bump-version-for-cron/package.json index efb3a3f786..c5a0ad681c 100644 --- a/packages/bump-version-for-cron/package.json +++ b/packages/bump-version-for-cron/package.json @@ -5,7 +5,10 @@ "license": "MIT", "scripts": { "clean": "rimraf dist/", - "build": "swc ./src/index.ts -d ./dist" + "build": "swc ./src/index.ts -d ./dist", + "postbuild": "run-script-os", + "postbuild:windows": "", + "postbuild:nix": "chmod u+x ./dist/index.js" }, "type": "module", "bin": "./dist/index.js", @@ -26,6 +29,7 @@ "@swc/core": "^1.3.44", "@types/node": "^16.18.11", "@types/semver": "^7.3.13", - "rimraf": "^4.4.1" + "rimraf": "^4.4.1", + "run-script-os": "^1.1.6" } } diff --git a/packages/core/package.json b/packages/core/package.json index be81f74f14..2d06f347d9 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -48,8 +48,6 @@ "scripts": { "build": "cross-env NODE_ENV=production webpack --config webpack/library-bundle.ts --progress", "clean": "rimraf dist static/build", - "prepare:dev": "cross-env NODE_ENV=development webpack --config webpack/library-bundle.ts --progress", - "dev": "cross-env NODE_ENV=development webpack --config webpack/library-bundle.ts --watch", "test:unit": "jest --testPathIgnorePatterns integration", "test:watch": "func() { jest ${1} --watch --testPathIgnorePatterns integration; }; func", "lint": "PROD=true eslint --ext js,ts,tsx --max-warnings=0 .", @@ -98,7 +96,6 @@ ], "runtime": "@side/jest-runtime" }, - "build": {}, "nx": { "targets": { "build": { @@ -108,11 +105,6 @@ "outputs": [ "{workspaceRoot}/static/build/" ] - }, - "dev": { - "outputs": [ - "{workspaceRoot}/static/build/" - ] } } }, diff --git a/packages/ensure-binaries/package.json b/packages/ensure-binaries/package.json index e12d4a0432..c7d7cb5256 100644 --- a/packages/ensure-binaries/package.json +++ b/packages/ensure-binaries/package.json @@ -7,6 +7,9 @@ "scripts": { "clean": "rimraf dist/", "build": "swc ./src/index.ts -d ./dist/", + "postbuild": "run-script-os", + "postbuild:windows": "", + "postbuild:nix": "chmod u+x ./dist/index.js", "prepare:dev": "npm run build", "prepare": "npm run build" }, @@ -38,6 +41,7 @@ "@types/node": "^16.18.11", "@types/semver": "^7.3.13", "@types/tar-stream": "^2.2.2", - "rimraf": "^4.4.1" + "rimraf": "^4.4.1", + "run-script-os": "^1.1.6" } } diff --git a/packages/generate-tray-icons/package.json b/packages/generate-tray-icons/package.json index ce85daf62f..04d58cc449 100644 --- a/packages/generate-tray-icons/package.json +++ b/packages/generate-tray-icons/package.json @@ -6,6 +6,9 @@ "scripts": { "clean": "rimraf dist/", "build": "swc ./src/index.ts -d ./dist/", + "postbuild": "run-script-os", + "postbuild:windows": "", + "postbuild:nix": "chmod u+x ./dist/index.js", "prepare:dev": "npm run build", "prepare": "npm run build" }, @@ -27,7 +30,8 @@ "@types/jsdom": "^20.0.1", "@types/node": "^18.11.18", "@types/sharp": "^0.31.1", - "rimraf": "^4.4.1" + "rimraf": "^4.4.1", + "run-script-os": "^1.1.6" }, "dependencies": { "arg": "^5.0.2", diff --git a/packages/legacy-extension-example/package.json b/packages/legacy-extension-example/package.json index e2fdde25e2..d37249fdfe 100644 --- a/packages/legacy-extension-example/package.json +++ b/packages/legacy-extension-example/package.json @@ -32,7 +32,6 @@ "scripts": { "clean": "rimraf dist/", "build": "webpack --config webpack.ts", - "dev": "webpack --mode=development --watch --config webpack.ts", "lint": "lens-lint", "lint:fix": "lens-lint --fix" }, diff --git a/packages/open-lens/package.json b/packages/open-lens/package.json index 950b0d2648..7fa19eeb23 100644 --- a/packages/open-lens/package.json +++ b/packages/open-lens/package.json @@ -28,8 +28,7 @@ "build:dir": "npm run compile && electron-builder --dir", "compile": "cross-env NODE_ENV=production webpack --config webpack/webpack.ts --progress", "postcompile": "npm run build:tray-icons && npm run download:binaries", - "predev": "rimraf static/build/ && npm run build:tray-icons && npm run download:binaries", - "dev": "concurrently -i -k \"npm run dev-run -C\" npm:dev:*", + "start": "concurrently -i -k \"npm run dev-run -C\" npm:dev:*", "dev-run": "nodemon --watch ./static/build/main.js --exec \"electron --remote-debugging-port=9223 --inspect .\"", "dev:main": "cross-env NODE_ENV=development webpack --config webpack/main.ts --progress --watch", "dev:renderer": "cross-env NODE_ENV=development ts-node ./webpack/dev-server.ts", @@ -70,15 +69,6 @@ "{workspaceRoot}/static/build/" ] }, - "dev": { - "dependsOn": [ - "^prepare:dev" - ], - "outputs": [ - "{workspaceRoot}/binaries/", - "{workspaceRoot}/static/build/" - ] - }, "build:app": { "dependsOn": [ "build" diff --git a/packages/release-tool/package.json b/packages/release-tool/package.json index b1c475aed2..22b3180c3d 100644 --- a/packages/release-tool/package.json +++ b/packages/release-tool/package.json @@ -7,7 +7,10 @@ "private": true, "scripts": { "clean": "rimraf dist/", - "build": "swc ./src/index.ts -d ./dist" + "build": "swc ./src/index.ts -d ./dist", + "postbuild": "run-script-os", + "postbuild:windows": "", + "postbuild:nix": "chmod u+x ./dist/index.js" }, "bin": { "create-release-pr": "./dist/index.js" @@ -19,7 +22,8 @@ "@types/inquirer": "^9.0.3", "@types/node": "^16.18.11", "@types/semver": "^7.3.13", - "rimraf": "^4.4.1" + "rimraf": "^4.4.1", + "run-script-os": "^1.1.6" }, "dependencies": { "chalk": "^5.2.0", diff --git a/packages/technical-features/application/agnostic/package.json b/packages/technical-features/application/agnostic/package.json index ab869a87c0..9874443c4f 100644 --- a/packages/technical-features/application/agnostic/package.json +++ b/packages/technical-features/application/agnostic/package.json @@ -24,8 +24,8 @@ "license": "MIT", "homepage": "https://github.com/lensapp/lens", "scripts": { + "clean": "rimraf dist/", "build": "webpack", - "dev": "webpack --mode=development --watch", "test:unit": "jest --coverage --runInBand", "lint": "lens-lint", "lint:fix": "lens-lint --fix" diff --git a/packages/technical-features/application/electron-main/package.json b/packages/technical-features/application/electron-main/package.json index 96d649a362..92817dc407 100644 --- a/packages/technical-features/application/electron-main/package.json +++ b/packages/technical-features/application/electron-main/package.json @@ -24,8 +24,8 @@ "license": "MIT", "homepage": "https://github.com/lensapp/lens", "scripts": { + "clean": "rimraf dist/", "build": "webpack", - "dev": "webpack --mode=development --watch", "test:unit": "jest --coverage --runInBand", "lint": "lens-lint", "lint:fix": "lens-lint --fix" diff --git a/packages/technical-features/application/legacy-extensions/package.json b/packages/technical-features/application/legacy-extensions/package.json index 6e92ca7c02..ee170be546 100644 --- a/packages/technical-features/application/legacy-extensions/package.json +++ b/packages/technical-features/application/legacy-extensions/package.json @@ -24,8 +24,8 @@ "license": "MIT", "homepage": "https://github.com/lensapp/lens", "scripts": { + "clean": "rimraf dist/", "build": "webpack", - "dev": "webpack --mode=development --watch", "lint": "lens-lint", "lint:fix": "lens-lint --fix" }, diff --git a/packages/technical-features/feature-core/package.json b/packages/technical-features/feature-core/package.json index cabb6e17a0..8d989c720c 100644 --- a/packages/technical-features/feature-core/package.json +++ b/packages/technical-features/feature-core/package.json @@ -24,8 +24,8 @@ "license": "MIT", "homepage": "https://github.com/lensapp/lens", "scripts": { + "clean": "rimraf dist/", "build": "webpack", - "dev": "webpack --mode=development --watch", "test:unit": "jest --coverage --runInBand", "lint": "lens-lint", "lint:fix": "lens-lint --fix" diff --git a/packages/technical-features/messaging/agnostic/package.json b/packages/technical-features/messaging/agnostic/package.json index 085304d4e0..ac4383c37a 100644 --- a/packages/technical-features/messaging/agnostic/package.json +++ b/packages/technical-features/messaging/agnostic/package.json @@ -26,8 +26,8 @@ "license": "MIT", "homepage": "https://github.com/lensapp/lens", "scripts": { + "clean": "rimraf dist/", "build": "webpack", - "dev": "webpack --mode=development --watch", "test:unit": "jest --coverage --runInBand", "lint:fix": "lens-lint --fix", "lint": "lens-lint" diff --git a/packages/technical-features/messaging/computed-channel/package.json b/packages/technical-features/messaging/computed-channel/package.json index 81c4f80013..05763dba08 100644 --- a/packages/technical-features/messaging/computed-channel/package.json +++ b/packages/technical-features/messaging/computed-channel/package.json @@ -26,8 +26,8 @@ "license": "MIT", "homepage": "https://github.com/lensapp/lens", "scripts": { + "clean": "rimraf dist/", "build": "webpack", - "dev": "webpack --mode=development --watch", "test:unit": "jest --coverage --runInBand", "lint": "lens-lint", "lint:fix": "lens-lint --fix" diff --git a/packages/technical-features/messaging/electron/main/package.json b/packages/technical-features/messaging/electron/main/package.json index ff1a76a7d3..b1e17ef979 100644 --- a/packages/technical-features/messaging/electron/main/package.json +++ b/packages/technical-features/messaging/electron/main/package.json @@ -26,8 +26,8 @@ "license": "MIT", "homepage": "https://github.com/lensapp/lens", "scripts": { + "clean": "rimraf dist/", "build": "webpack", - "dev": "webpack --mode=development --watch", "test:unit": "jest --coverage --runInBand", "lint": "lens-lint", "lint:fix": "lens-lint --fix" diff --git a/packages/technical-features/messaging/electron/renderer/package.json b/packages/technical-features/messaging/electron/renderer/package.json index 75fcb8e38f..f3864f7e4d 100644 --- a/packages/technical-features/messaging/electron/renderer/package.json +++ b/packages/technical-features/messaging/electron/renderer/package.json @@ -26,8 +26,8 @@ "license": "MIT", "homepage": "https://github.com/lensapp/lens", "scripts": { + "clean": "rimraf dist/", "build": "webpack", - "dev": "webpack --mode=development --watch", "test:unit": "jest --coverage --runInBand", "lint": "lens-lint", "lint:fix": "lens-lint --fix" diff --git a/packages/technical-features/messaging/message-bridge-fake/package.json b/packages/technical-features/messaging/message-bridge-fake/package.json index 6837504a0e..a48b2b5a33 100644 --- a/packages/technical-features/messaging/message-bridge-fake/package.json +++ b/packages/technical-features/messaging/message-bridge-fake/package.json @@ -26,8 +26,8 @@ "license": "MIT", "homepage": "https://github.com/lensapp/lens", "scripts": { + "clean": "rimraf dist/", "build": "webpack", - "dev": "webpack --mode=development --watch", "test:unit": "jest --coverage --runInBand", "lint:fix": "lens-lint --fix", "lint": "lens-lint" diff --git a/packages/technical-features/react-application/package.json b/packages/technical-features/react-application/package.json index e3ca7956a8..45a2b3e1f5 100644 --- a/packages/technical-features/react-application/package.json +++ b/packages/technical-features/react-application/package.json @@ -24,8 +24,8 @@ "license": "MIT", "homepage": "https://github.com/lensapp/lens", "scripts": { + "clean": "rimraf dist/", "build": "webpack", - "dev": "webpack --mode=development --watch", "test:unit": "jest --coverage --runInBand", "lint": "lens-lint", "lint:fix": "lens-lint --fix" diff --git a/packages/utility-features/react-testing-library-discovery/package.json b/packages/utility-features/react-testing-library-discovery/package.json index 489549a187..3f49c82588 100644 --- a/packages/utility-features/react-testing-library-discovery/package.json +++ b/packages/utility-features/react-testing-library-discovery/package.json @@ -20,8 +20,8 @@ "license": "MIT", "homepage": "https://github.com/lensapp/lens", "scripts": { + "clean": "rimraf dist/", "build": "webpack", - "dev": "webpack --mode=development --watch", "lint": "lens-lint", "lint:fix": "lens-lint --fix" }, diff --git a/packages/utility-features/run-many/package.json b/packages/utility-features/run-many/package.json index 1fa8af2ba1..0b3484794d 100644 --- a/packages/utility-features/run-many/package.json +++ b/packages/utility-features/run-many/package.json @@ -20,8 +20,8 @@ "license": "MIT", "homepage": "https://github.com/lensapp/lens", "scripts": { + "clean": "rimraf dist/", "build": "webpack", - "dev": "webpack --mode=development --watch", "test:unit": "jest --coverage --runInBand" }, "peerDependencies": { diff --git a/packages/utility-features/startable-stoppable/package.json b/packages/utility-features/startable-stoppable/package.json index 940e1e91b2..92b434294c 100644 --- a/packages/utility-features/startable-stoppable/package.json +++ b/packages/utility-features/startable-stoppable/package.json @@ -4,15 +4,10 @@ "version": "1.0.0-alpha.1", "description": "TBD", "type": "commonjs", - "publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" }, - - "files": [ - "build" - ], "repository": { "type": "git", "url": "git+https://github.com/lensapp/lens.git" @@ -26,8 +21,8 @@ "license": "MIT", "homepage": "https://github.com/lensapp/lens", "scripts": { + "clean": "rimraf dist/", "build": "webpack", - "dev": "webpack --mode=development --watch", "test:unit": "jest --coverage --runInBand", "lint": "lens-lint", "lint:fix": "lens-lint --fix" diff --git a/packages/utility-features/test-utils/package.json b/packages/utility-features/test-utils/package.json index 4336c0682b..746dbcfe99 100644 --- a/packages/utility-features/test-utils/package.json +++ b/packages/utility-features/test-utils/package.json @@ -20,8 +20,8 @@ "license": "MIT", "homepage": "https://github.com/lensapp/lens", "scripts": { - "build": "webpack", - "dev": "webpack --mode=development --watch" + "clean": "rimraf dist/", + "build": "webpack" }, "peerDependencies": { "@ogre-tools/injectable": "^15.1.2", diff --git a/packages/utility-features/utilities/package.json b/packages/utility-features/utilities/package.json index 777907d851..d7bafbe16e 100644 --- a/packages/utility-features/utilities/package.json +++ b/packages/utility-features/utilities/package.json @@ -20,8 +20,8 @@ "license": "MIT", "homepage": "https://github.com/lensapp/lens", "scripts": { + "clean": "rimraf dist/", "build": "webpack", - "dev": "webpack --mode=development --watch", "test:unit": "jest --coverage --runInBand" }, "peerDependencies": {