1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Remove Makefile from all intree extensions (#1312)

* Remove Makefile from all intree extensions

- Makefiles are not really common (rightly so) in JS projects and script
  entries in the package.json are good enough and what they're there
  for.

- Move to using yarn for installing dependencies and running scripts as
  that is what we mostly use for the rest of the project.

- Move from using make syntax to a dedicated script for building and
  testing extensions.

- add jest as extension devDep, go back to using makefile foreach syntax

- add correct exit code

- add yarn check call to install-deps

- add yarn invokation to find deps

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2020-11-13 12:32:15 -05:00 committed by GitHub
parent df0f080380
commit 648dbfee98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 61703 additions and 1061 deletions

2
.gitignore vendored
View File

@ -15,4 +15,4 @@ src/extensions/*/*.d.ts
types/extension-api.d.ts
types/extension-renderer-api.d.ts
extensions/*/dist
docs/extensions/api
docs/extensions/api

View File

@ -15,7 +15,8 @@ download-bins:
yarn download-bins
install-deps:
yarn install --frozen-lockfile
yarn install --frozen-lockfile --verbose
yarn check --verify-tree --integrity
compile-dev:
yarn compile:main --cache
@ -56,10 +57,10 @@ else
endif
build-extensions:
$(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), $(MAKE) -C $(dir) build || exit $?; )
$(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), (cd $(dir) && npm install && npm run build || exit $?);)
test-extensions:
$(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), $(MAKE) -C $(dir) test || exit $?; )
$(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), (cd $(dir) && npm install --dev && npm run test || exit $?);)
build-npm: build-extension-types
yarn npm:fix-package-version

View File

@ -1,8 +0,0 @@
install-deps:
yarn install
build: install-deps
yarn run build
test:
yarn run test

View File

@ -2,10 +2,10 @@ import { LensMainExtension } from "@k8slens/extensions";
export default class ExampleExtensionMain extends LensMainExtension {
onActivate() {
console.log('EXAMPLE EXTENSION MAIN: ACTIVATED');
console.log('EXAMPLE EXTENSION MAIN: ACTIVATED', this.name, this.id);
}
onDeactivate() {
console.log('EXAMPLE EXTENSION MAIN: DEACTIVATED');
console.log('EXAMPLE EXTENSION MAIN: DEACTIVATED', this.name, this.id);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -11,13 +11,14 @@
"scripts": {
"build": "webpack --config webpack.config.js",
"dev": "npm run build --watch",
"test": "echo NO TESTS"
"test": "jest --passWithNoTests --env=jsdom src $@"
},
"dependencies": {
"react-open-doodles": "^1.0.5"
},
"devDependencies": {
"@k8slens/extensions": "file:../../src/extensions/npm/extensions",
"jest": "^26.6.3",
"ts-loader": "^8.0.4",
"typescript": "^4.0.3",
"webpack": "^4.44.2"

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +0,0 @@
install-deps:
yarn install
build: install-deps
yarn run build
test:
yarn run test

File diff suppressed because it is too large Load Diff

View File

@ -6,12 +6,13 @@
"scripts": {
"build": "webpack -p",
"dev": "webpack --watch",
"test": "echo NO TESTS"
"test": "jest --passWithNoTests --env=jsdom src $@"
},
"dependencies": {},
"devDependencies": {
"@types/webpack": "^4.41.17",
"@k8slens/extensions": "file:../../src/extensions/npm/extensions",
"@types/webpack": "^4.41.17",
"jest": "^26.6.3",
"mobx": "^5.15.5",
"react": "^16.13.1",
"ts-loader": "^8.0.4",

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +0,0 @@
install-deps:
yarn install
build: install-deps
yarn run build
test:
yarn run test

File diff suppressed because it is too large Load Diff

View File

@ -10,17 +10,18 @@
"scripts": {
"build": "webpack --config webpack.config.js",
"dev": "npm run build --watch",
"test": "echo NO TESTS"
"test": "jest --passWithNoTests --env=jsdom src $@"
},
"dependencies": {
"semver": "^7.3.2"
},
"devDependencies": {
"@k8slens/extensions": "file:../../src/extensions/npm/extensions",
"jest": "^26.6.3",
"mobx": "^5.15.5",
"react": "^16.13.1",
"ts-loader": "^8.0.4",
"typescript": "^4.0.3",
"webpack": "^4.44.2",
"mobx": "^5.15.5",
"react": "^16.13.1"
"webpack": "^4.44.2"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +0,0 @@
install-deps:
yarn install
build: install-deps
yarn run build
test:
yarn run test

File diff suppressed because it is too large Load Diff

View File

@ -10,15 +10,16 @@
"scripts": {
"build": "webpack --config webpack.config.js",
"dev": "npm run build --watch",
"test": "echo NO TESTS"
"test": "jest --passWithNoTests --env=jsdom src $@"
},
"dependencies": {},
"devDependencies": {
"@k8slens/extensions": "file:../../src/extensions/npm/extensions",
"jest": "^26.6.3",
"mobx": "^5.15.5",
"react": "^16.13.1",
"ts-loader": "^8.0.4",
"typescript": "^4.0.3",
"webpack": "^4.44.2",
"mobx": "^5.15.5",
"react": "^16.13.1"
"webpack": "^4.44.2"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +0,0 @@
install-deps:
yarn install
build: install-deps
yarn run build
test:
yarn run test

File diff suppressed because it is too large Load Diff

View File

@ -10,15 +10,16 @@
"scripts": {
"build": "webpack --config webpack.config.js",
"dev": "npm run build --watch",
"test": "echo NO TESTS"
"test": "jest --passWithNoTests --env=jsdom src $@"
},
"dependencies": {},
"devDependencies": {
"ts-loader": "^8.0.4",
"typescript": "^4.0.3",
"webpack": "^4.44.2",
"@k8slens/extensions": "file:../../src/extensions/npm/extensions",
"jest": "^26.6.3",
"mobx": "^5.15.5",
"react": "^16.13.1",
"@k8slens/extensions": "file:../../src/extensions/npm/extensions"
"ts-loader": "^8.0.4",
"typescript": "^4.0.3",
"webpack": "^4.44.2"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +0,0 @@
install-deps:
yarn install
build: install-deps
yarn run build
test:
yarn run test

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@
"scripts": {
"build": "webpack -p",
"dev": "webpack --watch",
"test": "echo NO TESTS"
"test": "jest --passWithNoTests --env=jsdom src $@"
},
"dependencies": {},
"devDependencies": {
@ -16,6 +16,7 @@
"@types/react-router": "^5.1.8",
"@types/webpack": "^4.41.17",
"css-loader": "^5.0.0",
"jest": "^26.6.3",
"mobx": "^5.15.5",
"react": "^16.13.1",
"sass-loader": "^10.0.4",

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +0,0 @@
install-deps:
yarn install
build: install-deps
yarn run build
test:
yarn run test

File diff suppressed because it is too large Load Diff

View File

@ -11,19 +11,20 @@
"scripts": {
"build": "webpack -p",
"dev": "webpack --watch",
"test": "echo NO TESTS"
"test": "jest --passWithNoTests --env=jsdom src $@"
},
"dependencies": {},
"devDependencies": {
"@k8slens/extensions": "file:../../src/extensions/npm/extensions",
"@types/analytics-node": "^3.1.3",
"analytics-node": "^3.4.0-beta.3",
"jest": "^26.6.3",
"mobx": "^5.15.5",
"node-machine-id": "^1.1.12",
"react": "^16.13.1",
"ts-loader": "^8.0.4",
"typescript": "^4.0.3",
"webpack": "^4.44.2",
"mobx": "^5.15.5",
"react": "^16.13.1",
"node-machine-id": "^1.1.12",
"universal-analytics": "^0.4.23",
"analytics-node": "^3.4.0-beta.3"
"webpack": "^4.44.2"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -18,11 +18,11 @@
"dev:renderer": "yarn webpack-dev-server --config webpack.renderer.ts",
"dev:extension-types": "yarn compile:extension-types --watch",
"compile": "env NODE_ENV=production concurrently yarn:compile:*",
"compile:main": "webpack --config webpack.main.ts",
"compile:renderer": "webpack --config webpack.renderer.ts",
"compile:i18n": "lingui compile",
"compile:extension-types": "rollup --config src/extensions/rollup.config.js",
"npm:fix-package-version": "ts-node build/set_npm_version.ts",
"compile:main": "yarn webpack --config webpack.main.ts",
"compile:renderer": "yarn webpack --config webpack.renderer.ts",
"compile:i18n": "yarn lingui compile",
"compile:extension-types": "yarn rollup --config src/extensions/rollup.config.js",
"npm:fix-package-version": "yarn ts-node build/set_npm_version.ts",
"build:linux": "yarn compile && electron-builder --linux --dir -c.productName=Lens",
"build:mac": "yarn compile && electron-builder --mac --dir -c.productName=Lens",
"build:win": "yarn compile && electron-builder --win --dir -c.productName=Lens",
@ -32,12 +32,12 @@
"dist:win": "yarn compile && electron-builder --publish onTag --x64 --ia32",
"dist:dir": "yarn dist --dir -c.compression=store -c.mac.identity=null",
"postinstall": "patch-package",
"i18n:extract": "lingui extract",
"i18n:extract": "yarn lingui extract",
"download-bins": "concurrently yarn:download:*",
"download:kubectl": "yarn run ts-node build/download_kubectl.ts",
"download:helm": "yarn run ts-node build/download_helm.ts",
"build:tray-icons": "yarn run ts-node build/build_tray_icon.ts",
"lint": "eslint $@ --ext js,ts,tsx --max-warnings=0 src/",
"lint": "yarn eslint $@ --ext js,ts,tsx --max-warnings=0 src/",
"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",
"typedocs-extensions-api": "yarn typedoc --ignoreCompilerErrors --readme docs/extensions/typedoc-readme.md.tpl --name @k8slens/extensions --out docs/extensions/api --mode library --excludePrivate --hideBreadcrumbs --includes src/ src/extensions/extension-api.ts"
},