mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
some work
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
8d1c29ae4c
commit
89a9ed4086
1
.gitignore
vendored
1
.gitignore
vendored
@ -15,3 +15,4 @@ src/extensions/*/*.d.ts
|
|||||||
types/extension-api.d.ts
|
types/extension-api.d.ts
|
||||||
types/extension-renderer-api.d.ts
|
types/extension-renderer-api.d.ts
|
||||||
extensions/*/dist
|
extensions/*/dist
|
||||||
|
extensions/*/yarn.lock
|
||||||
|
|||||||
10
extensions/example-extension/jest.config.js
Normal file
10
extensions/example-extension/jest.config.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
module.exports = {
|
||||||
|
// Jest transformations -- this adds support for TypeScript
|
||||||
|
// using ts-jest
|
||||||
|
transform: {
|
||||||
|
"^.+\\.tsx?$": "ts-jest"
|
||||||
|
},
|
||||||
|
|
||||||
|
// Module file extensions for importing
|
||||||
|
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"]
|
||||||
|
};
|
||||||
4718
extensions/example-extension/package-lock.json
generated
4718
extensions/example-extension/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -11,15 +11,18 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack --config webpack.config.js",
|
"build": "webpack --config webpack.config.js",
|
||||||
"dev": "npm run build --watch",
|
"dev": "npm run build --watch",
|
||||||
"test": "echo NO TESTS"
|
"test": "jest --env=jsdom src $@"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"react-open-doodles": "^1.0.5"
|
"@types/jest": "^26.0.15",
|
||||||
|
"react-open-doodles": "^1.0.5",
|
||||||
|
"ts-jest": "^26.4.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@k8slens/extensions": "file:../../src/extensions/npm/extensions",
|
"@k8slens/extensions": "file:../../src/extensions/npm/extensions",
|
||||||
"ts-loader": "^8.0.4",
|
"ts-loader": "^8.0.4",
|
||||||
"typescript": "^4.0.3",
|
"typescript": "^4.0.3",
|
||||||
"webpack": "^4.44.2"
|
"webpack": "^4.44.2",
|
||||||
|
"jest": "^26.6.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
10
extensions/example-extension/src/__test__/page.test.tsx
Normal file
10
extensions/example-extension/src/__test__/page.test.tsx
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { render } from '@testing-library/react';
|
||||||
|
import '@testing-library/jest-dom/extend-expect'
|
||||||
|
|
||||||
|
import { ExamplePage } from "../page";
|
||||||
|
|
||||||
|
test('two plus two is four', () => {
|
||||||
|
const { container } = render(<ExamplePage extension={this} />);
|
||||||
|
expect(container).toBeInstanceOf(HTMLElement);
|
||||||
|
});
|
||||||
@ -2,10 +2,10 @@ import { LensMainExtension } from "@k8slens/extensions";
|
|||||||
|
|
||||||
export default class ExampleExtensionMain extends LensMainExtension {
|
export default class ExampleExtensionMain extends LensMainExtension {
|
||||||
onActivate() {
|
onActivate() {
|
||||||
console.log('EXAMPLE EXTENSION MAIN: ACTIVATED', this.getMeta());
|
console.log('EXAMPLE EXTENSION MAIN: ACTIVATED', this.name, this.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
onDeactivate() {
|
onDeactivate() {
|
||||||
console.log('EXAMPLE EXTENSION MAIN: DEACTIVATED', this.getMeta());
|
console.log('EXAMPLE EXTENSION MAIN: DEACTIVATED', this.name, this.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3,7 +3,11 @@
|
|||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
"module": "CommonJS",
|
"module": "CommonJS",
|
||||||
"target": "ES2017",
|
"target": "ES2017",
|
||||||
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
"lib": [
|
||||||
|
"ESNext",
|
||||||
|
"DOM",
|
||||||
|
"DOM.Iterable"
|
||||||
|
],
|
||||||
"moduleResolution": "Node",
|
"moduleResolution": "Node",
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"declaration": false,
|
"declaration": false,
|
||||||
@ -17,7 +21,10 @@
|
|||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"./*.ts",
|
"./*.ts",
|
||||||
"./*.tsx"
|
"./*.tsx",
|
||||||
|
"src/renderer.tsx",
|
||||||
|
"src/page.tsx",
|
||||||
|
"src/main.ts"
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
|
|||||||
@ -2,7 +2,7 @@ const path = require('path');
|
|||||||
|
|
||||||
module.exports = [
|
module.exports = [
|
||||||
{
|
{
|
||||||
entry: './main.ts',
|
entry: './src/main.ts',
|
||||||
context: __dirname,
|
context: __dirname,
|
||||||
target: "electron-main",
|
target: "electron-main",
|
||||||
mode: "production",
|
mode: "production",
|
||||||
@ -32,7 +32,7 @@ module.exports = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
entry: './renderer.tsx',
|
entry: './src/renderer.tsx',
|
||||||
context: __dirname,
|
context: __dirname,
|
||||||
target: "electron-renderer",
|
target: "electron-renderer",
|
||||||
mode: "production",
|
mode: "production",
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack -p",
|
"build": "webpack -p",
|
||||||
"dev": "webpack --watch",
|
"dev": "webpack --watch",
|
||||||
"test": "echo NO TESTS"
|
"test": "jest --env=jsdom --passWithNoTests src $@"
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack --config webpack.config.js",
|
"build": "webpack --config webpack.config.js",
|
||||||
"dev": "npm run build --watch",
|
"dev": "npm run build --watch",
|
||||||
"test": "echo NO TESTS"
|
"test": "jest --env=jsdom --passWithNoTests src $@"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"semver": "^7.3.2"
|
"semver": "^7.3.2"
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack --config webpack.config.js",
|
"build": "webpack --config webpack.config.js",
|
||||||
"dev": "npm run build --watch",
|
"dev": "npm run build --watch",
|
||||||
"test": "echo NO TESTS"
|
"test": "jest --env=jsdom --passWithNoTests src $@"
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack --config webpack.config.js",
|
"build": "webpack --config webpack.config.js",
|
||||||
"dev": "npm run build --watch",
|
"dev": "npm run build --watch",
|
||||||
"test": "echo NO TESTS"
|
"test": "jest --env=jsdom --passWithNoTests src $@"
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack -p",
|
"build": "webpack -p",
|
||||||
"dev": "webpack --watch",
|
"dev": "webpack --watch",
|
||||||
"test": "echo NO TESTS"
|
"test": "jest --env=jsdom --passWithNoTests src $@"
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack -p",
|
"build": "webpack -p",
|
||||||
"dev": "webpack --watch",
|
"dev": "webpack --watch",
|
||||||
"test": "echo NO TESTS"
|
"test": "jest --env=jsdom --passWithNoTests src $@"
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@ -369,7 +369,7 @@
|
|||||||
"react-router-dom": "^5.2.0",
|
"react-router-dom": "^5.2.0",
|
||||||
"react-select": "^3.1.0",
|
"react-select": "^3.1.0",
|
||||||
"react-window": "^1.8.5",
|
"react-window": "^1.8.5",
|
||||||
"rollup": "^2.28.2",
|
"rollup": "^2.33.1",
|
||||||
"rollup-plugin-dts": "^1.4.13",
|
"rollup-plugin-dts": "^1.4.13",
|
||||||
"rollup-plugin-ignore-import": "^1.3.2",
|
"rollup-plugin-ignore-import": "^1.3.2",
|
||||||
"rollup-pluginutils": "^2.8.2",
|
"rollup-pluginutils": "^2.8.2",
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import ignoreImport from 'rollup-plugin-ignore-import'
|
|||||||
const config: RollupOptions = {
|
const config: RollupOptions = {
|
||||||
input: "src/extensions/extension-api.ts",
|
input: "src/extensions/extension-api.ts",
|
||||||
output: [
|
output: [
|
||||||
{ file: "src/extensions/npm/extensions/api.d.ts", format: "es", }
|
{ file: "src/extensions/npm/extensions/api.d.ts", format: "module", }
|
||||||
],
|
],
|
||||||
plugins: [
|
plugins: [
|
||||||
dts(),
|
dts(),
|
||||||
|
|||||||
@ -12545,10 +12545,10 @@ rollup-pluginutils@^2.8.2:
|
|||||||
dependencies:
|
dependencies:
|
||||||
estree-walker "^0.6.1"
|
estree-walker "^0.6.1"
|
||||||
|
|
||||||
rollup@^2.28.2:
|
rollup@^2.33.1:
|
||||||
version "2.28.2"
|
version "2.33.1"
|
||||||
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.28.2.tgz#599ec4978144a82d8a8ec3d37670a8440cb04e4b"
|
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.33.1.tgz#802795164164ee63cd47769d8879c33ec8ae0c40"
|
||||||
integrity sha512-8txbsFBFLmm9Xdt4ByTOGa9Muonmc8MfNjnGAR8U8scJlF1ZW7AgNZa7aqBXaKtlvnYP/ab++fQIq9dB9NWUbg==
|
integrity sha512-uY4O/IoL9oNW8MMcbA5hcOaz6tZTMIh7qJHx/tzIJm+n1wLoY38BLn6fuy7DhR57oNFLMbDQtDeJoFURt5933w==
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
fsevents "~2.1.2"
|
fsevents "~2.1.2"
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user