rename extensions -> extension-api

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen committed 2023-01-09 11:01:33 +02:00
1 parent f9244ef035
commit 7c42df2474
6 files changed

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
dist/
__mocks__/
node_modules/
+33
View File
@@ -0,0 +1,33 @@
{
"name": "@k8slens/extensions",
"productName": "OpenLens extensions",
"description": "OpenLens - Open Source Kubernetes IDE: extensions",
"version": "6.0.0",
"copyright": "© 2022 OpenLens Authors",
"license": "MIT",
"main": "dist/src/extension-api.js",
"types": "dist/src/extension-api.d.ts",
"files": [
"dist/**/*.ts",
"__mocks__/*.ts",
"dist/**/*.js"
],
"author": {
"name": "OpenLens Authors"
},
"scripts": {
"build": "yarn run webpack --config webpack/extensions.ts",
"build-docs": "yarn run typedoc",
"clean": "rm -rf dist/"
},
"dependencies": {
"@k8slens/open-lens": "^6.4.0-alpha.0"
},
"devDependencies": {
"typedoc": "0.23.23",
"typedoc-plugin-markdown": "^3.13.6",
"typescript": "^4.9.4",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1"
}
}
@@ -0,0 +1,18 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { extensionApi as main } from "@k8slens/open-lens/main";
import { extensionApi as renderer } from "@k8slens/open-lens/renderer";
import { extensionApi as common } from "@k8slens/open-lens/common";
const Main = { ... main } as typeof main;
const Renderer = { ...renderer } as typeof renderer;
const Common = { ... common } as typeof common;
export {
Main,
Renderer,
Common,
};
+32
View File
@@ -0,0 +1,32 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"paths": {
"*": [
"node_modules/*",
"types/*"
]
},
"plugins": [
{
"name": "typescript-plugin-css-modules",
"options": {
"namedExports": false
}
}
]
},
"include": [
"src/**/*",
"../core/types/*.d.ts",
],
"exclude": [
"node_modules",
"../core/src/"
],
"references": [
{
"path": "../core"
}
]
}
+15
View File
@@ -0,0 +1,15 @@
{
"readme": "../../docs/extensions/typedoc-readme.md.tpl",
"name": "@k8slens/extensions",
"out": "../../docs/extensions/api",
"excludePrivate": true,
"entryPointStrategy": "expand",
"entryPoints": [
"src/extension-api.ts",
"../core/src/common/library.ts",
"../core/src/main/library.ts",
"../core/src/renderer/library.ts"
],
"hideBreadcrumbs": true,
"disableSources": true,
}
@@ -0,0 +1,69 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import path from "path";
import type webpack from "webpack";
const isDevelopment = process.env.NODE_ENV !== "production";
export default function generateExtensionTypes(): webpack.Configuration {
return {
// Compile for Electron for renderer process
// see <https://webpack.js.org/configuration/target/>
target: "electron-renderer",
entry: "./src/extension-api.ts",
// this is the default mode, so we should make it explicit to silence the warning
mode: isDevelopment ? "development" : "production",
output: {
filename: "extension-api.js",
// need to be an absolute path
path: path.resolve("./dist/"),
// can be use in commonjs environments
// e.g. require('@k8slens/extensions')
libraryTarget: "commonjs",
},
cache: isDevelopment,
optimization: {
minimize: false, // speed up types compilation
},
ignoreWarnings: [
/Critical dependency: the request of a dependency is an expression/, // see who is using request: "npm ls request"
/require.extensions is not supported by webpack./, // handlebars
],
stats: "errors-warnings",
externals: [
"@k8slens/open-lens/common",
"@k8slens/open-lens/main",
"@k8slens/open-lens/renderer",
],
module: {
rules: [
{
test: /\.node$/,
loader: "ignore-loader",
},
{
test: /\.tsx?$/,
loader: "ts-loader",
options: {
// !! ts-loader will use tsconfig.json at folder root
// !! changes in tsconfig.json may have side effects
// !! on '@k8slens/extensions' module
compilerOptions: {
declaration: true, // output .d.ts
sourceMap: false, // to override sourceMap: true in tsconfig.json
outDir: path.resolve("./dist/"), // where the .d.ts should be located
},
},
},
],
},
resolve: {
extensions: [".ts", ".tsx", ".js"],
},
plugins: [],
};
}