Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web: add HTMLTagNameElementMaps to everything to activate lit analyzer #10217

Merged
Merged
Show file tree
Hide file tree
Changes from 58 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
3146e5a
web: fix esbuild issue with style sheets
kensternberg-authentik Mar 8, 2024
fe52f44
Merge branch 'main' into dev
kensternberg-authentik Mar 11, 2024
e505f27
Merge branch 'main' into dev
kensternberg-authentik Mar 11, 2024
5090621
Merge branch 'main' into dev
kensternberg-authentik Mar 11, 2024
035bda4
Merge branch 'main' into dev
kensternberg-authentik Mar 12, 2024
2d0117d
Merge branch 'main' into dev
kensternberg-authentik Mar 13, 2024
22cb5b7
Merge branch 'main' into dev
kensternberg-authentik Mar 14, 2024
8b4e036
Merge branch 'main' into dev
kensternberg-authentik Mar 14, 2024
db96e1a
Merge branch 'main' into dev
kensternberg-authentik Mar 18, 2024
8946b81
Merge branch 'main' into dev
kensternberg-authentik Mar 19, 2024
30beca9
Merge branch 'main' into dev
kensternberg-authentik Mar 19, 2024
5d84082
Merge branch 'main' into dev
kensternberg-authentik Mar 20, 2024
a7e3dca
Merge branch 'main' into dev
kensternberg-authentik Mar 21, 2024
2d254d6
Merge branch 'main' into dev
kensternberg-authentik Mar 25, 2024
3f95020
Merge branch 'main' into dev
kensternberg-authentik Mar 26, 2024
a056703
Merge branch 'main' into dev
kensternberg-authentik Mar 27, 2024
fc00bde
Merge branch 'main' into dev
kensternberg-authentik Mar 29, 2024
7123b2c
Merge branch 'main' into dev
kensternberg-authentik Mar 29, 2024
5d4c380
Merge branch 'main' into dev
kensternberg-authentik Apr 1, 2024
66cefcc
Merge branch 'main' into dev
kensternberg-authentik Apr 2, 2024
875fc5c
Merge branch 'main' into dev
kensternberg-authentik Apr 4, 2024
c84be1d
Merge branch 'main' into dev
kensternberg-authentik Apr 8, 2024
b08dcc2
Merge branch 'main' into dev
kensternberg-authentik Apr 9, 2024
272fdc5
Merge branch 'main' into dev
kensternberg-authentik Apr 10, 2024
23665d1
Merge branch 'main' into dev
kensternberg-authentik Apr 10, 2024
cacdf64
Merge branch 'main' into dev
kensternberg-authentik Apr 11, 2024
085debf
Merge branch 'main' into dev
kensternberg-authentik Apr 12, 2024
f19ed14
Merge branch 'main' into dev
kensternberg-authentik Apr 16, 2024
ac4ba5d
Merge branch 'main' into dev
kensternberg-authentik Apr 17, 2024
98503f6
Merge branch 'main' into dev
kensternberg-authentik Apr 18, 2024
2d94b16
Merge branch 'main' into dev
kensternberg-authentik Apr 22, 2024
34de6bf
Merge branch 'main' into dev
kensternberg-authentik Apr 24, 2024
ca42506
Merge branch 'main' into dev
kensternberg-authentik Apr 25, 2024
2a96900
Merge branch 'main' into dev
kensternberg-authentik May 2, 2024
9acebec
Merge branch 'main' into dev
kensternberg-authentik May 3, 2024
8248163
Merge branch 'main' into dev
kensternberg-authentik May 3, 2024
ee37e92
Merge branch 'main' into dev
kensternberg-authentik May 7, 2024
e1d565d
Merge branch 'main' into dev
kensternberg-authentik May 8, 2024
3d532d4
Merge branch 'main' into dev
kensternberg-authentik May 9, 2024
fffc8c7
Merge branch 'main' into dev
kensternberg-authentik May 10, 2024
3fae9e5
Merge branch 'main' into dev
kensternberg-authentik May 13, 2024
09803fe
Merge branch 'main' into dev
kensternberg-authentik May 14, 2024
5752497
Merge branch 'main' into dev
kensternberg-authentik May 17, 2024
61eb9fa
Merge branch 'main' into dev
kensternberg-authentik May 22, 2024
3ff20ca
Merge branch 'main' into dev
kensternberg-authentik May 24, 2024
5b132c8
Merge branch 'main' into dev
kensternberg-authentik May 28, 2024
2488eb9
Merge branch 'main' into dev
kensternberg-authentik Jun 3, 2024
312f364
Merge branch 'main' into dev
kensternberg-authentik Jun 4, 2024
fcab990
Merge branch 'main' into dev
kensternberg-authentik Jun 11, 2024
10bfc4e
erge branch 'main' into dev
kensternberg-authentik Jun 13, 2024
c49185d
Merge branch 'main' into dev
kensternberg-authentik Jun 14, 2024
7b208d9
Merge branch 'main' into dev
kensternberg-authentik Jun 18, 2024
75b605f
Merge branch 'main' into dev
kensternberg-authentik Jun 19, 2024
10a4db6
web: add more linting
kensternberg-authentik Jun 19, 2024
e1248b3
A reliable test for the extra code needed in analyzer, passing shellc…
kensternberg-authentik Jun 19, 2024
c2a277a
web: re-enable custom-element-manifest and enable component checking …
kensternberg-authentik Jun 19, 2024
e537d89
Added building the manifest to the build process, rather than storing…
kensternberg-authentik Jun 24, 2024
2226c8c
web: the most boring PR in the universe: Add HTMLTagNameElementMap to…
kensternberg-authentik Jun 25, 2024
4dd7905
Merge branch 'main' into web/add-more-linting
kensternberg-authentik Jul 15, 2024
dd625d5
Merge branch 'main' into web/add-htmltagmaps-to-activate-lit-analyzer
kensternberg-authentik Jul 15, 2024
e4861f6
Merge branch 'web/add-more-linting' into web/add-htmltagmaps-to-activ…
kensternberg-authentik Jul 15, 2024
d002b35
Merge branch 'main' into web/add-htmltagmaps-to-activate-lit-analyzer
kensternberg-authentik Jul 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions web/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,4 @@ temp/
# End of https://www.gitignore.io/api/node
api/**
storybook-static/
custom-elements.json
2,794 changes: 2,534 additions & 260 deletions web/package-lock.json

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@
"build-locales": "node scripts/build-locales.mjs",
"build-locales:build": "lit-localize build",
"build-locales:repair": "prettier --write ./src/locale-codes.ts",
"build:manifest": "custom-elements-manifest analyze --litelement --globs 'src/**/*.ts' --exclude 'src/**/*.stories.ts' --exclude 'src/**/*.tests.ts'",
"esbuild:build": "node build.mjs",
"esbuild:build-proxy": "node build.mjs --proxy",
"esbuild:watch": "node build.mjs --watch",
"build": "run-s build-locales esbuild:build",
"build": "run-s build-locales build:manifest esbuild:build",
"build-proxy": "run-s build-locales esbuild:build-proxy",
"watch": "run-s build-locales esbuild:watch",
"watch": "run-s build-locales build:manifest esbuild:watch",
"lint": "cross-env NODE_OPTIONS='--max_old_space_size=65536' eslint . --max-warnings 0 --fix",
"lint:precommit": "bun scripts/eslint-precommit.mjs",
"lint:precommit": "cross-env NODE_OPTIONS='--max_old_space_size=65536' node scripts/eslint-precommit.mjs",
"lint:spelling": "node scripts/check-spelling.mjs",
"lit-analyse": "lit-analyzer src",
"lit-analyse": "lit-analyzer src --strict",
"postinstall": "bash scripts/patch-analyser.sh",
"precommit": "npm-run-all --parallel tsc lit-analyse lint:spelling --sequential lint:precommit prettier",
"prequick": "run-s tsc:execute lit-analyse lint:precommit lint:spelling",
"prettier-check": "prettier --check .",
Expand Down Expand Up @@ -76,6 +78,9 @@
"@babel/plugin-transform-runtime": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@changesets/cli": "^2.27.5",
"@custom-elements-manifest/analyzer": "^0.10.2",
"@genesiscommunitysuccess/custom-elements-lsp": "^5.0.3",
"@hcaptcha/types": "^1.0.3",
"@jeysal/storybook-addon-css-user-preferences": "^0.2.0",
"@lit/localize-tools": "^0.7.2",
Expand Down
23 changes: 23 additions & 0 deletions web/scripts/patch-analyser.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

TARGET="./node_modules/@custom-elements-manifest/analyzer/src/features/analyse-phase/creators/handlers.js"

# If the second question mark is not there in this test, put it there. The flags to grep ensure it
# will behave correctly on both MacOS and Linux by requiring it to use only the POSIX "basic"
# regular expression behavior.
#

if ! grep -GL 'node\.name?\.text?\.startsWith' "$TARGET" > /dev/null 2>&1; then
patch --forward -V none --no-backup-if-mismatch -p0 $TARGET <<EOF
--- a/packages/analyzer/src/features/analyse-phase/creators/handlers.js
+++ b/packages/analyzer/src/features/analyse-phase/creators/handlers.js
@@ -34,7 +34,7 @@ export function handleModifiers(doc, node) {
}
});

- if (node.name?.text.startsWith('#')) {
+ if (node.name?.text?.startsWith('#')) {
doc.privacy = 'private';
}
EOF
fi
6 changes: 6 additions & 0 deletions web/src/admin/AdminInterface/AdminInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,9 @@ export class AdminInterface extends EnterpriseAwareInterface {
></ak-locale-context>`;
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning: Aside from the last two files in this PR, this one and the next 359 after it are all exactly this. If you want to see how this was done, scroll down and read those last two.

declare global {
interface HTMLElementTagNameMap {
"ak-interface-admin": AdminInterface;
}
}
6 changes: 6 additions & 0 deletions web/src/admin/AdminInterface/AdminSidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,9 @@ export class AkAdminSidebar extends WithCapabilitiesConfig(AKElement) {
: nothing;
}
}

declare global {
interface HTMLElementTagNameMap {
"ak-admin-sidebar": AkAdminSidebar;
}
}
6 changes: 6 additions & 0 deletions web/src/admin/DebugPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,9 @@ export class DebugPage extends AKElement {
`;
}
}

declare global {
interface HTMLElementTagNameMap {
"ak-admin-debug-page": DebugPage;
}
}
6 changes: 6 additions & 0 deletions web/src/admin/admin-overview/DashboardUserPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,9 @@ export class DashboardUserPage extends AKElement {
</section> `;
}
}

declare global {
interface HTMLElementTagNameMap {
"ak-admin-dashboard-users": DashboardUserPage;
}
}
6 changes: 6 additions & 0 deletions web/src/admin/admin-overview/TopApplicationsTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,9 @@ export class TopApplicationsTable extends AKElement {
</table>`;
}
}

declare global {
interface HTMLElementTagNameMap {
"ak-top-applications-table": TopApplicationsTable;
}
}
6 changes: 6 additions & 0 deletions web/src/admin/admin-overview/cards/RecentEventsCard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,9 @@ export class RecentEventsCard extends Table<Event> {
);
}
}

declare global {
interface HTMLElementTagNameMap {
"ak-recent-events": RecentEventsCard;
}
}
6 changes: 6 additions & 0 deletions web/src/admin/admin-overview/cards/SystemStatusCard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,9 @@ export class SystemStatusCard extends AdminStatusCard<SystemInfo> {
return html`${this.statusSummary}`;
}
}

declare global {
interface HTMLElementTagNameMap {
"ak-admin-status-system": SystemStatusCard;
}
}
6 changes: 6 additions & 0 deletions web/src/admin/admin-overview/cards/VersionStatusCard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,9 @@ export class VersionStatusCard extends AdminStatusCard<Version> {
return html`<a href=${link} target="_blank">${text}</a>`;
}
}

declare global {
interface HTMLElementTagNameMap {
"ak-admin-status-version": VersionStatusCard;
}
}
6 changes: 6 additions & 0 deletions web/src/admin/admin-overview/cards/WorkerStatusCard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@ export class WorkersStatusCard extends AdminStatusCard<number> {
}
}
}

declare global {
interface HTMLElementTagNameMap {
"ak-admin-status-card-workers": WorkersStatusCard;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,9 @@ export class AdminLoginAuthorizeChart extends AKChart<LoginMetrics> {
};
}
}

declare global {
interface HTMLElementTagNameMap {
"ak-charts-admin-login-authorization": AdminLoginAuthorizeChart;
}
}
6 changes: 6 additions & 0 deletions web/src/admin/admin-overview/charts/AdminModelPerDay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,9 @@ export class AdminModelPerDay extends AKChart<Coordinate[]> {
};
}
}

declare global {
interface HTMLElementTagNameMap {
"ak-charts-admin-model-per-day": AdminModelPerDay;
}
}
6 changes: 6 additions & 0 deletions web/src/admin/admin-overview/charts/OutpostStatusChart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,9 @@ export class OutpostStatusChart extends AKChart<SummarizedSyncStatus[]> {
};
}
}

declare global {
interface HTMLElementTagNameMap {
"ak-admin-status-chart-outpost": OutpostStatusChart;
}
}
6 changes: 6 additions & 0 deletions web/src/admin/admin-overview/charts/SyncStatusChart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,9 @@ export class SyncStatusChart extends AKChart<SummarizedSyncStatus[]> {
};
}
}

declare global {
interface HTMLElementTagNameMap {
"ak-admin-status-chart-sync": SyncStatusChart;
}
}
6 changes: 6 additions & 0 deletions web/src/admin/admin-settings/AdminSettingsForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,9 @@ export class AdminSettingsForm extends Form<SettingsRequest> {
`;
}
}

declare global {
interface HTMLElementTagNameMap {
"ak-admin-settings-form": AdminSettingsForm;
}
}
6 changes: 6 additions & 0 deletions web/src/admin/admin-settings/AdminSettingsPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,9 @@ export class AdminSettingsPage extends AKElement {
`;
}
}

declare global {
interface HTMLElementTagNameMap {
"ak-admin-settings": AdminSettingsPage;
}
}
6 changes: 6 additions & 0 deletions web/src/admin/applications/ApplicationAuthorizeChart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ export class ApplicationAuthorizeChart extends AKChart<Coordinate[]> {
};
}
}

declare global {
interface HTMLElementTagNameMap {
"ak-charts-application-authorize": ApplicationAuthorizeChart;
}
}
6 changes: 6 additions & 0 deletions web/src/admin/applications/ApplicationCheckAccessForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,9 @@ export class ApplicationCheckAccessForm extends Form<{ forUser: number }> {
${this.result ? this.renderResult() : html``}`;
}
}

declare global {
interface HTMLElementTagNameMap {
"ak-application-check-access-form": ApplicationCheckAccessForm;
}
}
6 changes: 6 additions & 0 deletions web/src/admin/applications/ApplicationForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,9 @@ export class ApplicationForm extends WithCapabilitiesConfig(ModelForm<Applicatio
</form>`;
}
}

declare global {
interface HTMLElementTagNameMap {
"ak-application-form": ApplicationForm;
}
}
6 changes: 6 additions & 0 deletions web/src/admin/applications/ApplicationListPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,9 @@ export class ApplicationListPage extends TablePage<Application> {
</ak-forms-modal>`;
}
}

declare global {
interface HTMLElementTagNameMap {
"ak-application-list": ApplicationListPage;
}
}
6 changes: 6 additions & 0 deletions web/src/admin/applications/ApplicationViewPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,3 +322,9 @@ export class ApplicationViewPage extends AKElement {
</ak-tabs>`;
}
}

declare global {
interface HTMLElementTagNameMap {
"ak-application-view": ApplicationViewPage;
}
}
6 changes: 6 additions & 0 deletions web/src/admin/applications/ApplicationWizardHint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,9 @@ export class AkApplicationWizardHint extends AKElement implements ShowHintContro
}

export default AkApplicationWizardHint;

declare global {
interface HTMLElementTagNameMap {
"ak-application-wizard-hint": AkApplicationWizardHint;
}
}
6 changes: 6 additions & 0 deletions web/src/admin/applications/ProviderSelectModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,9 @@ export class ProviderSelectModal extends TableModal<Provider> {
</footer>`;
}
}

declare global {
interface HTMLElementTagNameMap {
"ak-provider-select-table": ProviderSelectModal;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,9 @@ export class AkBackchannelProvidersInput extends AKElement {
`;
}
}

declare global {
interface HTMLElementTagNameMap {
"ak-backchannel-providers-input": AkBackchannelProvidersInput;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,9 @@ export class AkProviderInput extends AKElement {
</ak-form-element-horizontal>`;
}
}

declare global {
interface HTMLElementTagNameMap {
"ak-provider-search-input": AkProviderInput;
}
}
6 changes: 6 additions & 0 deletions web/src/admin/applications/wizard/ak-application-wizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,9 @@ export class ApplicationWizard extends CustomListenerElement(
this.requestUpdate();
}
}

declare global {
interface HTMLElementTagNameMap {
"ak-application-wizard": ApplicationWizard;
}
}
6 changes: 6 additions & 0 deletions web/src/admin/applications/wizard/ak-wizard-title.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ export class AkWizardTitle extends AKElement {
}

export default AkWizardTitle;

declare global {
interface HTMLElementTagNameMap {
"ak-wizard-title": AkWizardTitle;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,9 @@ export class ApplicationWizardApplicationDetails extends BasePanel {
}

export default ApplicationWizardApplicationDetails;

declare global {
interface HTMLElementTagNameMap {
"ak-application-wizard-application-details": ApplicationWizardApplicationDetails;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ export class ApplicationWizardAuthenticationMethodChoice extends WithLicenseSumm
}

export default ApplicationWizardAuthenticationMethodChoice;

declare global {
interface HTMLElementTagNameMap {
"ak-application-wizard-authentication-method-choice": ApplicationWizardAuthenticationMethodChoice;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,9 @@ export class ApplicationWizardCommitApplication extends BasePanel {
}

export default ApplicationWizardCommitApplication;

declare global {
interface HTMLElementTagNameMap {
"ak-application-wizard-commit-application": ApplicationWizardCommitApplication;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ export class ApplicationWizardApplicationDetails extends BasePanel {
}

export default ApplicationWizardApplicationDetails;

declare global {
interface HTMLElementTagNameMap {
"ak-application-wizard-authentication-method": ApplicationWizardApplicationDetails;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,9 @@ export class ApplicationWizardApplicationDetails extends WithBrandConfig(BasePro
}

export default ApplicationWizardApplicationDetails;

declare global {
interface HTMLElementTagNameMap {
"ak-application-wizard-authentication-by-ldap": ApplicationWizardApplicationDetails;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -321,3 +321,9 @@ export class ApplicationWizardAuthenticationByOauth extends BaseProviderPanel {
}

export default ApplicationWizardAuthenticationByOauth;

declare global {
interface HTMLElementTagNameMap {
"ak-application-wizard-authentication-by-oauth": ApplicationWizardAuthenticationByOauth;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,9 @@ export class AkForwardDomainProxyApplicationWizardPage extends AkTypeProxyApplic
}

export default AkForwardDomainProxyApplicationWizardPage;

declare global {
interface HTMLElementTagNameMap {
"ak-application-wizard-authentication-for-forward-proxy-domain": AkForwardDomainProxyApplicationWizardPage;
}
}
Loading