web: cleanup

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-08-15 21:48:18 +02:00
parent c52afe5952
commit 14fb0c3d61
6 changed files with 11 additions and 64 deletions

View File

@ -17,6 +17,7 @@ jobs:
- run: make gen-web - run: make gen-web
- run: | - run: |
cd web/api/ cd web/api/
npm run build
npm publish npm publish
env: env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

33
web/package-lock.json generated
View File

@ -33,7 +33,6 @@
"@typescript-eslint/eslint-plugin": "^4.29.1", "@typescript-eslint/eslint-plugin": "^4.29.1",
"@typescript-eslint/parser": "^4.29.1", "@typescript-eslint/parser": "^4.29.1",
"@webcomponents/webcomponentsjs": "^2.6.0", "@webcomponents/webcomponentsjs": "^2.6.0",
"authentik-api": "file:api",
"babel-plugin-macros": "^3.1.0", "babel-plugin-macros": "^3.1.0",
"base64-js": "^1.5.1", "base64-js": "^1.5.1",
"chart.js": "^3.5.0", "chart.js": "^3.5.0",
@ -69,23 +68,11 @@
"api": { "api": {
"name": "authentik-api", "name": "authentik-api",
"version": "1.0.0", "version": "1.0.0",
"extraneous": true,
"devDependencies": { "devDependencies": {
"typescript": "^3.9.5" "typescript": "^3.9.5"
} }
}, },
"api/node_modules/typescript": {
"version": "3.9.9",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.9.tgz",
"integrity": "sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=4.2.0"
}
},
"node_modules/@apitools/openapi-parser": { "node_modules/@apitools/openapi-parser": {
"version": "0.0.7", "version": "0.0.7",
"resolved": "https://registry.npmjs.org/@apitools/openapi-parser/-/openapi-parser-0.0.7.tgz", "resolved": "https://registry.npmjs.org/@apitools/openapi-parser/-/openapi-parser-0.0.7.tgz",
@ -2994,10 +2981,6 @@
"node": ">= 4.5.0" "node": ">= 4.5.0"
} }
}, },
"node_modules/authentik-api": {
"resolved": "api",
"link": true
},
"node_modules/babel-plugin-dynamic-import-node": { "node_modules/babel-plugin-dynamic-import-node": {
"version": "2.3.3", "version": "2.3.3",
"resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz",
@ -10233,20 +10216,6 @@
"resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz",
"integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg=="
}, },
"authentik-api": {
"version": "file:api",
"requires": {
"typescript": "^3.9.5"
},
"dependencies": {
"typescript": {
"version": "3.9.9",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.9.tgz",
"integrity": "sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w==",
"dev": true
}
}
},
"babel-plugin-dynamic-import-node": { "babel-plugin-dynamic-import-node": {
"version": "2.3.3", "version": "2.3.3",
"resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz",

View File

@ -2,7 +2,6 @@ import resolve from "rollup-plugin-node-resolve";
import commonjs from "rollup-plugin-commonjs"; import commonjs from "rollup-plugin-commonjs";
import { terser } from "rollup-plugin-terser"; import { terser } from "rollup-plugin-terser";
import sourcemaps from "rollup-plugin-sourcemaps"; import sourcemaps from "rollup-plugin-sourcemaps";
import typescript from "@rollup/plugin-typescript";
import cssimport from "rollup-plugin-cssimport"; import cssimport from "rollup-plugin-cssimport";
import copy from "rollup-plugin-copy"; import copy from "rollup-plugin-copy";
import babel from "@rollup/plugin-babel"; import babel from "@rollup/plugin-babel";
@ -47,9 +46,6 @@ const resources = [
const isProdBuild = process.env.NODE_ENV === "production"; const isProdBuild = process.env.NODE_ENV === "production";
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
function manualChunks(id) { function manualChunks(id) {
if (id.endsWith("web/api/dist/index.js")) {
return "api";
}
if (id.includes("locales")) { if (id.includes("locales")) {
const parts = id.split("/"); const parts = id.split("/");
const file = parts[parts.length - 1]; const file = parts[parts.length - 1];
@ -64,31 +60,6 @@ function manualChunks(id) {
} }
export default [ export default [
// Autogenerated API Client
{
input: "./api/src/index.ts",
output: [
{
format: "es",
dir: "./api/dist/",
sourcemap: true,
},
],
plugins: [
typescript({
declaration: true,
outDir: "./api/dist/",
}),
isProdBuild && terser(),
copy({
targets: [...resources],
copyOnce: false,
}),
].filter((p) => p),
watch: {
clearScreen: false,
},
},
// Polyfills (imported first) // Polyfills (imported first)
{ {
input: "./poly.ts", input: "./poly.ts",

View File

@ -1,4 +1,4 @@
import { Config, Configuration, CoreApi, CurrentTenant, Middleware, ResponseContext, RootApi, Tenant } from "@goauthentik/api"; import { Config, Configuration, CoreApi, CurrentTenant, Middleware, ResponseContext, RootApi } from "@goauthentik/api";
import { getCookie } from "../utils"; import { getCookie } from "../utils";
import { APIMiddleware } from "../elements/notifications/APIDrawer"; import { APIMiddleware } from "../elements/notifications/APIDrawer";
import { MessageMiddleware } from "../elements/messages/Middleware"; import { MessageMiddleware } from "../elements/messages/Middleware";

View File

@ -19,7 +19,7 @@ import {
TITLE_DEFAULT, TITLE_DEFAULT,
} from "../constants"; } from "../constants";
import { DEFAULT_CONFIG, tenant } from "../api/Config"; import { DEFAULT_CONFIG, tenant } from "../api/Config";
import { EventsApi } from "../../api/dist"; import { EventsApi } from "@goauthentik/api";
@customElement("ak-page-header") @customElement("ak-page-header")
export class PageHeader extends LitElement { export class PageHeader extends LitElement {

View File

@ -1,4 +1,10 @@
import { CoreApi, PoliciesApi, Policy, PolicyTestRequest, PolicyTestResult } from "@goauthentik/api"; import {
CoreApi,
PoliciesApi,
Policy,
PolicyTestRequest,
PolicyTestResult,
} from "@goauthentik/api";
import { t } from "@lingui/macro"; import { t } from "@lingui/macro";
import { customElement, property } from "lit-element"; import { customElement, property } from "lit-element";
import { html, TemplateResult } from "lit-html"; import { html, TemplateResult } from "lit-html";