mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
1 parent
76f8263baf
commit
57d6f8f933
10 files changed
+25
-35
No files matched your search
+2
-2
@@ -1,11 +1,11 @@
|
||||
dist/
|
||||
out/
|
||||
node_modules/
|
||||
.DS_Store
|
||||
yarn-error.log
|
||||
coverage/
|
||||
tmp/
|
||||
static/build/**
|
||||
static/build
|
||||
static/types
|
||||
binaries/client/
|
||||
binaries/server/
|
||||
src/extensions/*/*.js
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
"compile:main": "webpack --config webpack.main.ts",
|
||||
"compile:renderer": "webpack --config webpack.renderer.ts",
|
||||
"compile:i18n": "lingui compile",
|
||||
"compile:extension-api.d.ts": "tsc --project src/extensions",
|
||||
"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",
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import { LensExtension, LensRendererRuntimeEnv } from "@lens/extensions";
|
||||
import { LensExtension, LensRendererRuntimeEnv } from "@lens/extensions"; // fixme: map to generated types from "extension-api.d.ts"
|
||||
|
||||
export default class ExampleExtension extends LensExtension {
|
||||
todo(){
|
||||
console.log(this.runtime.apiManager); // fixme: incorrect types import, "runtime" doesn't exists
|
||||
}
|
||||
|
||||
async activate(runtime: LensRendererRuntimeEnv): Promise<any> {
|
||||
await super.activate(runtime);
|
||||
console.log('Example extension: activate');
|
||||
|
||||
@@ -1,21 +1,11 @@
|
||||
{
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"jsx": "react",
|
||||
"target": "ES2017",
|
||||
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
||||
"module": "CommonJS",
|
||||
"moduleResolution": "Node",
|
||||
"noImplicitAny": true,
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"allowJs": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"resolveJsonModule": true,
|
||||
"skipLibCheck": true
|
||||
"sourceMap": false,
|
||||
"declaration": false
|
||||
},
|
||||
"include": [
|
||||
"../extension-api.mock.d.ts",
|
||||
"./example-extension.ts"
|
||||
]
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
declare module "@lens/extensions" {
|
||||
export = LensExtensions
|
||||
}
|
||||
|
||||
declare namespace LensExtensions {
|
||||
export {
|
||||
LensExtension, ExtensionManifest, ExtensionVersion, ExtensionId, LensRendererRuntimeEnv
|
||||
} from "./extension-api"
|
||||
}
|
||||
@@ -5,7 +5,7 @@ export interface LensRendererRuntimeEnv {
|
||||
apiManager: ApiManager;
|
||||
}
|
||||
|
||||
// todo: expose more renderer runtime variables, stores, etc.
|
||||
// todo: expose more public runtime apis: stores, managers, etc.
|
||||
export function getExtensionRuntime(): LensRendererRuntimeEnv {
|
||||
return {
|
||||
apiManager,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// Lens-extensions.api.js developer kit
|
||||
// todo: generate types instead of extension-api.mock.d.ts
|
||||
// Lens-extensions api developer's kit
|
||||
|
||||
export { LensRendererRuntimeEnv } from "./extension-api.runtime";
|
||||
export type { LensRendererRuntimeEnv } from "./extension-api.runtime";
|
||||
export * from "./extension"
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "AMD",
|
||||
"declaration": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"outFile": "./../../static/types/extension-api.d.ts"
|
||||
},
|
||||
"include": [
|
||||
"../../types",
|
||||
"./extension-api.ts"
|
||||
]
|
||||
}
|
||||
+1
-2
@@ -73,10 +73,9 @@ export function buildMenu(windowManager: WindowManager) {
|
||||
navigate(preferencesURL())
|
||||
}
|
||||
},
|
||||
{ type: 'separator' },
|
||||
{
|
||||
label: 'Extensions',
|
||||
accelerator: 'CmdOrCtrl+Shift+E',
|
||||
accelerator: 'CmdOrCtrl+E',
|
||||
click() {
|
||||
navigate(extensionsURL())
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -3,6 +3,7 @@ declare module "mac-ca"
|
||||
declare module "win-ca"
|
||||
declare module "@hapi/call"
|
||||
declare module "@hapi/subtext"
|
||||
declare module "@lens/extensions" // fixme: provide generated types from "extension-api.ts"
|
||||
|
||||
// Global path to static assets
|
||||
declare const __static: string;
|
||||
|
||||
Reference in new issue
Block a user