From f8b57abc930122d45a29f3a9457321a40cfe8205 Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Fri, 15 Mar 2024 17:17:07 +0100 Subject: [PATCH 01/35] docs: add basic version dialog --- packages/documentation/docusaurus.config.ts | 26 +++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/packages/documentation/docusaurus.config.ts b/packages/documentation/docusaurus.config.ts index ddbacb3e52..b8cb05d65d 100644 --- a/packages/documentation/docusaurus.config.ts +++ b/packages/documentation/docusaurus.config.ts @@ -94,6 +94,11 @@ const config: Config = { rimraf: true, }), ], + versions: { + current: { + label: 'v2.1', + }, + }, }, theme: { customCss, @@ -105,6 +110,12 @@ const config: Config = { withBrandTheme, }, themeConfig: { + announcementBar: { + content: + 'This is the documentation for Siemens Industrial Experience v2, which is no longer actively maintained. Visit https://ix.siemens.io for the latest version.', + isCloseable: false, + backgroundColor: 'var(--theme-color-warning)', + }, metadata: [ { name: 'keywords', @@ -128,10 +139,17 @@ const config: Config = { }, items: [ // Remove docs version until library needs to publish an major release - // { - // type: 'docsVersionDropdown', - // position: 'right', - // }, + { + type: 'docsVersionDropdown', + position: 'right', + dropdownActiveClassDisabled: true, + dropdownItemsBefore: [ + { + href: 'https://ix-dev.siemens.io', + label: 'Dev', + }, + ], + }, ], }, footer: { From 25ab08ad5b657a875b727d654c4537715b3d93da Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Fri, 15 Mar 2024 17:29:59 +0100 Subject: [PATCH 02/35] feat: show announcementbar --- packages/documentation/docusaurus.config.ts | 35 +++++++++++++++++---- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/packages/documentation/docusaurus.config.ts b/packages/documentation/docusaurus.config.ts index b8cb05d65d..b08fc2fd0a 100644 --- a/packages/documentation/docusaurus.config.ts +++ b/packages/documentation/docusaurus.config.ts @@ -8,6 +8,7 @@ */ import type * as Preset from '@docusaurus/preset-classic'; import type { Config } from '@docusaurus/types'; +import type { ThemeConfig } from '@docusaurus/theme-common'; import { themes as prismThemes } from 'prism-react-renderer'; import figmaPlugin from 'figma-plugin'; import path from 'path'; @@ -21,6 +22,33 @@ const libCss = [ require.resolve('@siemens/ix/dist/siemens-ix/theme/legacy-classic-light.css'), ]; +const isDeployPreview = process.env.CONTEXT === 'deploy-preview'; +const isDevPreview = process.env.CONTEXT === 'dev'; + +function getAnnouncementBarConfig() { + if (isDevPreview) { + return { + announcementBar: { + content: + 'This is the development documentation for Siemens Industrial Experience. Visit https://ix.siemens.io for the latest version.', + isCloseable: false, + backgroundColor: 'var(--theme-color-warning)', + }, + }; + } + + if (isDeployPreview) { + return { + announcementBar: { + content: + 'This is the preview documentation for Siemens Industrial Experience. Visit https://ix.siemens.io for the latest version.', + isCloseable: false, + backgroundColor: 'var(--theme-color-warning)', + }, + }; + } +} + if (!process.env.CI) { try { // Check if theme is existing inside node_modes @@ -110,12 +138,7 @@ const config: Config = { withBrandTheme, }, themeConfig: { - announcementBar: { - content: - 'This is the documentation for Siemens Industrial Experience v2, which is no longer actively maintained. Visit https://ix.siemens.io for the latest version.', - isCloseable: false, - backgroundColor: 'var(--theme-color-warning)', - }, + ...getAnnouncementBarConfig(), metadata: [ { name: 'keywords', From 18b4a3cf26a5b9d1efb51a1f7af92e50966413a8 Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Fri, 15 Mar 2024 22:27:08 +0100 Subject: [PATCH 03/35] fix: tweak some eslint settings --- packages/core/.eslintrc.json | 5 +- .../docs/controls/_panes_styleguide.md | 2 +- packages/documentation/docusaurus.config.ts | 71 ++++++++++++------- packages/documentation/src/css/custom.scss | 3 + .../documentation/version-deployment.json | 14 ++++ packages/eslint-config-ix/index.js | 2 +- 6 files changed, 67 insertions(+), 30 deletions(-) create mode 100644 packages/documentation/version-deployment.json diff --git a/packages/core/.eslintrc.json b/packages/core/.eslintrc.json index 58c1c41089..2745fefbb5 100644 --- a/packages/core/.eslintrc.json +++ b/packages/core/.eslintrc.json @@ -3,7 +3,7 @@ "parserOptions": { "project": "./tsconfig.json" }, - "extends": ["plugin:@stencil-community/recommended", "ix"], + "extends": ["plugin:@typescript-eslint/recommended", "plugin:@stencil-community/recommended", "ix"], "rules": { "@stencil-community/async-methods": 0, "@stencil-community/own-props-must-be-private": 0, @@ -12,6 +12,7 @@ "@stencil-community/ban-default-true": ["warn"], "react/jsx-no-bind": 0, "react/jsx-uses-react": 0, - "react/react-in-jsx-scope": 0 + "react/react-in-jsx-scope": 0, + "@typescript-eslint/no-confusing-non-null-assertion": "error" } } diff --git a/packages/documentation/docs/controls/_panes_styleguide.md b/packages/documentation/docs/controls/_panes_styleguide.md index e6ce9084f2..8f2ae39a36 100644 --- a/packages/documentation/docs/controls/_panes_styleguide.md +++ b/packages/documentation/docs/controls/_panes_styleguide.md @@ -53,6 +53,6 @@ Panes have two states: collapsed and expanded. The appearance of the states vari ## Related patterns -[Drawers](./drawers.md) +[Drawers](./drawer.md) [Header](../controls/application-frame/application-header.md) [Menu](../controls/application-frame/application-menu.md) diff --git a/packages/documentation/docusaurus.config.ts b/packages/documentation/docusaurus.config.ts index b08fc2fd0a..295ef26e9f 100644 --- a/packages/documentation/docusaurus.config.ts +++ b/packages/documentation/docusaurus.config.ts @@ -7,12 +7,12 @@ * LICENSE file in the root directory of this source tree. */ import type * as Preset from '@docusaurus/preset-classic'; -import type { Config } from '@docusaurus/types'; -import type { ThemeConfig } from '@docusaurus/theme-common'; +import type { Config, PluginConfig } from '@docusaurus/types'; import { themes as prismThemes } from 'prism-react-renderer'; import figmaPlugin from 'figma-plugin'; import path from 'path'; import fs from 'fs'; +import versions from './version-deployment.json' with { type: 'json '}; let withBrandTheme = false; @@ -22,10 +22,47 @@ const libCss = [ require.resolve('@siemens/ix/dist/siemens-ix/theme/legacy-classic-light.css'), ]; +const useFastStart = !!process.env.FAST_START; + const isDeployPreview = process.env.CONTEXT === 'deploy-preview'; const isDevPreview = process.env.CONTEXT === 'dev'; +const plugins: PluginConfig[] = [ + 'docusaurus-plugin-sass', +] + +if (useFastStart) { + console.warn('🚧 🚧 🚧 🚧 🚧 🚧'); + console.warn('🚧 🚧 🚧 🚧 🚧 🚧'); + console.warn('Fast start enabled'); + console.warn('No figma plugin enabled'); + console.warn('No search plugin enabled'); + console.warn('🚧 🚧 🚧 🚧 🚧 🚧'); + console.warn('🚧 🚧 🚧 🚧 🚧 🚧'); +} + +if (!useFastStart) { + plugins.push([ + require.resolve('docusaurus-lunr-search'), + { + languages: ['en'], + excludeRoutes: ['**/installation/CHANGELOG', '**/auto-generated/**/*'], + }, + ],) +} + function getAnnouncementBarConfig() { + if (versions.currentVersion !== versions.latestVersion) { + return { + announcementBar: { + content: + 'OLD VERSION!!!!. Visit https://ix.siemens.io for the latest version.', + isCloseable: false, + backgroundColor: 'var(--theme-color-warning)', + }, + }; + } + if (isDevPreview) { return { announcementBar: { @@ -98,7 +135,7 @@ const config: Config = { url: 'https://ix.siemens.io', baseUrl: baseUrl, onBrokenLinks: 'throw', - onBrokenMarkdownLinks: 'warn', + onBrokenMarkdownLinks: 'throw', favicon: 'img/favicon.ico', organizationName: 'Siemens AG', projectName: 'ix', @@ -113,7 +150,7 @@ const config: Config = { // Please change this to your repo. editUrl: 'https://www.github.com/siemens/ix/edit/main/packages/documentation/', - remarkPlugins: [ + remarkPlugins: useFastStart ? [] : [ figmaPlugin({ baseUrl: `${baseUrl}figma`, figmaFolder: `${path.join(__dirname, 'static', 'figma')}`, @@ -122,11 +159,6 @@ const config: Config = { rimraf: true, }), ], - versions: { - current: { - label: 'v2.1', - }, - }, }, theme: { customCss, @@ -163,15 +195,11 @@ const config: Config = { items: [ // Remove docs version until library needs to publish an major release { - type: 'docsVersionDropdown', + type: 'dropdown', position: 'right', dropdownActiveClassDisabled: true, - dropdownItemsBefore: [ - { - href: 'https://ix-dev.siemens.io', - label: 'Dev', - }, - ], + label: versions.currentVersion, + items: versions.versions.filter(version => version.label !== versions.currentVersion) }, ], }, @@ -242,16 +270,7 @@ const config: Config = { darkTheme: prismThemes.dracula, }, } satisfies Preset.ThemeConfig, - plugins: [ - 'docusaurus-plugin-sass', - [ - require.resolve('docusaurus-lunr-search'), - { - languages: ['en'], - excludeRoutes: ['**/installation/CHANGELOG', '**/auto-generated/**/*'], - }, - ], - ], + plugins: plugins, }; module.exports = config; diff --git a/packages/documentation/src/css/custom.scss b/packages/documentation/src/css/custom.scss index dc3d498d43..78132bc0f0 100644 --- a/packages/documentation/src/css/custom.scss +++ b/packages/documentation/src/css/custom.scss @@ -170,7 +170,10 @@ aside { } .dropdown__link { + display: inline-flex; + align-items: center; text-decoration: auto; + width: 100%; } .menu__link { diff --git a/packages/documentation/version-deployment.json b/packages/documentation/version-deployment.json new file mode 100644 index 0000000000..54a772c738 --- /dev/null +++ b/packages/documentation/version-deployment.json @@ -0,0 +1,14 @@ +{ + "latestVersion": "v2", + "currentVersion": "v2", + "versions": [ + { + "href": "https://ix.siemens.io", + "label": "v3 (Active)" + }, + { + "href": "https://v2.ix.siemens.io", + "label": "v2 (LTS)" + } + ] +} diff --git a/packages/eslint-config-ix/index.js b/packages/eslint-config-ix/index.js index 45486f7c6a..c74e2259ca 100644 --- a/packages/eslint-config-ix/index.js +++ b/packages/eslint-config-ix/index.js @@ -11,7 +11,7 @@ /** @type {import('eslint').Linter.Config} */ module.exports = { extends: ['turbo', 'prettier'], - plugins: ['prettier'], + plugins: ['prettier', '@typescript-eslint'], rules: { 'prettier/prettier': 'error', quotes: [ From 3ab65a94cfb2d5a219274b1095fb47e38005f112 Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Mon, 18 Mar 2024 16:16:33 +0100 Subject: [PATCH 04/35] feat: add version --- packages/documentation/docs/introduction.md | 6 +-- packages/documentation/docusaurus.config.ts | 14 ++----- .../src/components/SwitchTheme.tsx | 13 +++++- .../src/components/VersionRedirect/index.tsx | 41 +++++++++++++++++++ .../src/theme/Navbar/Content/index.tsx | 16 ++++---- .../documentation/version-deployment.json | 12 +++--- 6 files changed, 73 insertions(+), 29 deletions(-) create mode 100644 packages/documentation/src/components/VersionRedirect/index.tsx diff --git a/packages/documentation/docs/introduction.md b/packages/documentation/docs/introduction.md index 4cdfc3eace..2f3aed253f 100644 --- a/packages/documentation/docs/introduction.md +++ b/packages/documentation/docs/introduction.md @@ -15,9 +15,9 @@ import BlazorIcon from '@site/static/img/blazor.svg'; # Welcome to Siemens Industrial Experience -

+ Siemens Industrial Experience is an open-source design system for designers and developers to consistently create the perfect digital experience for partners and customers within industrial contexts. Siemens Industrial Experience gives you access to a broad range of UI patterns, web-based code implementations, design tools, resources and content guidelines to accelerate collaboration between designers, developers and writers, helping to build efficient and consistent products. -

+ ## Guiding principles @@ -39,7 +39,7 @@ Siemens Industrial Experience provides and maintains a Figma design kit containi React Web Components Vue (experimental) - Blazor (experimental) + Blazor (experimental) ## Contribute diff --git a/packages/documentation/docusaurus.config.ts b/packages/documentation/docusaurus.config.ts index 295ef26e9f..424207b513 100644 --- a/packages/documentation/docusaurus.config.ts +++ b/packages/documentation/docusaurus.config.ts @@ -56,7 +56,7 @@ function getAnnouncementBarConfig() { return { announcementBar: { content: - 'OLD VERSION!!!!. Visit https://ix.siemens.io for the latest version.', + `You are looking at an different version ${versions.currentVersion} then the latest supported version. Visit https://ix.siemens.io for the latest version.`, isCloseable: false, backgroundColor: 'var(--theme-color-warning)', }, @@ -168,6 +168,7 @@ const config: Config = { ], customFields: { withBrandTheme, + versions }, themeConfig: { ...getAnnouncementBarConfig(), @@ -192,16 +193,7 @@ const config: Config = { alt: 'Siemens AG', src: 'img/logo.svg', }, - items: [ - // Remove docs version until library needs to publish an major release - { - type: 'dropdown', - position: 'right', - dropdownActiveClassDisabled: true, - label: versions.currentVersion, - items: versions.versions.filter(version => version.label !== versions.currentVersion) - }, - ], + items: [], }, footer: { copyright: `© Siemens 1996 - ${new Date().getFullYear()}`, diff --git a/packages/documentation/src/components/SwitchTheme.tsx b/packages/documentation/src/components/SwitchTheme.tsx index 9e6611d9cf..0568f71eb1 100644 --- a/packages/documentation/src/components/SwitchTheme.tsx +++ b/packages/documentation/src/components/SwitchTheme.tsx @@ -33,7 +33,12 @@ function ThemeEntry(props: { ); } -export function SwitchTheme(props: { icon: string; label: string }) { + +export function SwitchTheme(props: { + icon: string; + label: string; + isMobile: boolean; +}) { const context = useDocusaurusContext(); const [open, setOpen] = useState(false); @@ -104,7 +109,11 @@ export function SwitchTheme(props: { icon: string; label: string }) { } return ( - + {registeredThemes.map(({ id, label, color }) => { return ( diff --git a/packages/documentation/src/components/VersionRedirect/index.tsx b/packages/documentation/src/components/VersionRedirect/index.tsx new file mode 100644 index 0000000000..3378378858 --- /dev/null +++ b/packages/documentation/src/components/VersionRedirect/index.tsx @@ -0,0 +1,41 @@ +/* + * SPDX-FileCopyrightText: 2024 Siemens AG + * + * SPDX-License-Identifier: MIT + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; +import { IxDropdownButton, IxDropdownItem } from '@siemens/ix-react'; + +export default function VersionRedirect() { + const context = useDocusaurusContext(); + const versionMeta = context.siteConfig.customFields.versions as any; + + console.log(versionMeta); + + const { currentVersion } = versionMeta; + const selected = versionMeta.versions.find( + (version) => version.id === currentVersion + ); + + function routeToVersion(link: string) { + if (typeof window !== 'undefined') { + window.location.href = link; + } + } + + return ( + + {versionMeta.versions.map((version) => ( + routeToVersion(version.href)} + > + ))} + + ); +} diff --git a/packages/documentation/src/theme/Navbar/Content/index.tsx b/packages/documentation/src/theme/Navbar/Content/index.tsx index ae212d074f..eceae8bd2c 100644 --- a/packages/documentation/src/theme/Navbar/Content/index.tsx +++ b/packages/documentation/src/theme/Navbar/Content/index.tsx @@ -13,6 +13,7 @@ import NavbarSearch from '@theme/Navbar/Search'; import { SwitchTheme } from '@site/src/components/SwitchTheme'; import styles from './styles.module.css'; +import VersionRedirect from '@site/src/components/VersionRedirect'; function useNavbarItems() { // TODO temporary casting until ThemeConfig type is improved @@ -90,16 +91,15 @@ export default function NavbarContent(): JSX.Element { // Ask the user to add the respective navbar items => more flexible <> - - {isDocs() ? null : ( <> - {!searchBarItem && ( - - - - )} - + + + )} diff --git a/packages/documentation/version-deployment.json b/packages/documentation/version-deployment.json index 54a772c738..55d820f424 100644 --- a/packages/documentation/version-deployment.json +++ b/packages/documentation/version-deployment.json @@ -1,14 +1,16 @@ { "latestVersion": "v2", - "currentVersion": "v2", + "currentVersion": "v3-preview", "versions": [ { - "href": "https://ix.siemens.io", - "label": "v3 (Active)" + "id": "v3-preview", + "href": "https://v3-preview.ix.siemens.io", + "label": "V3 (Preview)" }, { - "href": "https://v2.ix.siemens.io", - "label": "v2 (LTS)" + "id": "v2", + "href": "https://ix.siemens.io", + "label": "V2 (Active)" } ] } From e93c84934d8e090327f5159e420021b8c4568685 Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Mon, 18 Mar 2024 16:24:15 +0100 Subject: [PATCH 05/35] fix: renaming of version file --- packages/documentation/docusaurus.config.ts | 11 +++++++---- .../src/components/VersionRedirect/index.tsx | 11 +++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/documentation/docusaurus.config.ts b/packages/documentation/docusaurus.config.ts index 424207b513..46aab5c310 100644 --- a/packages/documentation/docusaurus.config.ts +++ b/packages/documentation/docusaurus.config.ts @@ -12,7 +12,7 @@ import { themes as prismThemes } from 'prism-react-renderer'; import figmaPlugin from 'figma-plugin'; import path from 'path'; import fs from 'fs'; -import versions from './version-deployment.json' with { type: 'json '}; +import versionDeployment from './version-deployment.json' with { type: 'json '}; let withBrandTheme = false; @@ -52,11 +52,14 @@ if (!useFastStart) { } function getAnnouncementBarConfig() { - if (versions.currentVersion !== versions.latestVersion) { + + const latestVersion = versionDeployment.versions.find(version => version.id === versionDeployment.currentVersion); + + if (versionDeployment.currentVersion !== versionDeployment.latestVersion) { return { announcementBar: { content: - `You are looking at an different version ${versions.currentVersion} then the latest supported version. Visit https://ix.siemens.io for the latest version.`, + `You are looking at an different version ${latestVersion?.label} then the latest supported version. Visit https://ix.siemens.io for the latest version.`, isCloseable: false, backgroundColor: 'var(--theme-color-warning)', }, @@ -168,7 +171,7 @@ const config: Config = { ], customFields: { withBrandTheme, - versions + versionDeployment }, themeConfig: { ...getAnnouncementBarConfig(), diff --git a/packages/documentation/src/components/VersionRedirect/index.tsx b/packages/documentation/src/components/VersionRedirect/index.tsx index 3378378858..29566d52e8 100644 --- a/packages/documentation/src/components/VersionRedirect/index.tsx +++ b/packages/documentation/src/components/VersionRedirect/index.tsx @@ -11,12 +11,11 @@ import { IxDropdownButton, IxDropdownItem } from '@siemens/ix-react'; export default function VersionRedirect() { const context = useDocusaurusContext(); - const versionMeta = context.siteConfig.customFields.versions as any; + const versionDeployment = context.siteConfig.customFields + .versionDeployment as any; - console.log(versionMeta); - - const { currentVersion } = versionMeta; - const selected = versionMeta.versions.find( + const { currentVersion } = versionDeployment; + const selected = versionDeployment.versions.find( (version) => version.id === currentVersion ); @@ -28,7 +27,7 @@ export default function VersionRedirect() { return ( - {versionMeta.versions.map((version) => ( + {versionDeployment.versions.map((version) => ( Date: Mon, 18 Mar 2024 18:04:48 +0100 Subject: [PATCH 06/35] fix: update to latest stencil version --- packages/core/component-doc.json | 2 +- packages/core/package.json | 2 +- pnpm-lock.yaml | 40 ++++++++++++++++---------------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/packages/core/component-doc.json b/packages/core/component-doc.json index 4a0d82ec64..65f7098974 100644 --- a/packages/core/component-doc.json +++ b/packages/core/component-doc.json @@ -2,7 +2,7 @@ "timestamp": "", "compiler": { "name": "@stencil/core", - "version": "4.12.3", + "version": "4.12.6", "typescriptVersion": "5.3.3" }, "components": [ diff --git a/packages/core/package.json b/packages/core/package.json index 60f8eedd28..f6c4c2898c 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -43,7 +43,7 @@ }, "dependencies": { "@floating-ui/dom": "^1.5.1", - "@stencil/core": "^4.12.3", + "@stencil/core": "^4.12.6", "@types/luxon": "^3.3.7", "animejs": "~3.2.1", "hyperlist": "^1.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9c3ae8983f..bada827a11 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -272,8 +272,8 @@ importers: specifier: ^2.11.0 version: 2.11.8 '@stencil/core': - specifier: ^4.12.3 - version: 4.12.3 + specifier: ^4.12.6 + version: 4.12.6 '@types/luxon': specifier: ^3.3.7 version: 3.3.7 @@ -298,19 +298,19 @@ importers: version: 0.7.1(@typescript-eslint/eslint-plugin@6.18.1)(@typescript-eslint/parser@6.18.1)(eslint-plugin-react@7.33.2)(eslint@8.56.0)(typescript@5.3.3) '@stencil-community/postcss': specifier: ^2.2.0 - version: 2.2.0(@stencil/core@4.12.3) + version: 2.2.0(@stencil/core@4.12.6) '@stencil/angular-output-target': specifier: ^0.8.3 - version: 0.8.3(@stencil/core@4.12.3) + version: 0.8.3(@stencil/core@4.12.6) '@stencil/react-output-target': specifier: ^0.5.3 - version: 0.5.3(@stencil/core@4.12.3) + version: 0.5.3(@stencil/core@4.12.6) '@stencil/sass': specifier: ^3.0.8 - version: 3.0.8(@stencil/core@4.12.3) + version: 3.0.8(@stencil/core@4.12.6) '@stencil/vue-output-target': specifier: ^0.8.7 - version: 0.8.7(@stencil/core@4.12.3) + version: 0.8.7(@stencil/core@4.12.6) '@testing-library/dom': specifier: ^8.11.0 version: 8.20.1 @@ -6992,21 +6992,21 @@ packages: typescript: 5.3.3 dev: true - /@stencil-community/postcss@2.2.0(@stencil/core@4.12.3): + /@stencil-community/postcss@2.2.0(@stencil/core@4.12.6): resolution: {integrity: sha512-PuPdjqgF6HdvSLwS6fpLf1TRzd3bd6zqpsICCUA0u9sxPnwrsIpx1xYyA/K9hSWrmyUg0WhHPvkX9k26N5DCnw==} peerDependencies: '@stencil/core': '>=2.0.0 || >=3.0.0 || >=4.0.0' dependencies: - '@stencil/core': 4.12.3 + '@stencil/core': 4.12.6 postcss: 8.4.31 dev: true - /@stencil/angular-output-target@0.8.3(@stencil/core@4.12.3): + /@stencil/angular-output-target@0.8.3(@stencil/core@4.12.6): resolution: {integrity: sha512-I/QO1sEx09WWUaNlA30EBhlXYftOSfSBTwYBwC65qlpHDIlD5WU3EAtKhU5IphfwhxnD63kvOoU1YvTUXFHNng==} peerDependencies: '@stencil/core': '>=2.0.0 || >=3 || >= 4.0.0-beta.0 || >= 4.0.0' dependencies: - '@stencil/core': 4.12.3 + '@stencil/core': 4.12.6 dev: true /@stencil/core@3.2.1: @@ -7014,34 +7014,34 @@ packages: engines: {node: '>=14.10.0', npm: '>=6.0.0'} hasBin: true - /@stencil/core@4.12.3: - resolution: {integrity: sha512-9XkE9i2aXPlApMNeq3tbVHKx0eAfDc7QGyIl6t5NMuQFTOGL5Xd1soF38d+hCIDpUoUUtY7jXWg+iFrlrMzQhg==} + /@stencil/core@4.12.6: + resolution: {integrity: sha512-15JO2TdaxGVKNdLZb/2TtDa+juj3XGD/V0y/disgdzYYSnajgSh06nwODfdHz9eTUh1Hisz+KIo857I1rCZrfg==} engines: {node: '>=16.0.0', npm: '>=7.10.0'} hasBin: true - /@stencil/react-output-target@0.5.3(@stencil/core@4.12.3): + /@stencil/react-output-target@0.5.3(@stencil/core@4.12.6): resolution: {integrity: sha512-68jwRp35CjAcwhTJ9yFD/3n+jrHOqvEH2jreVuPVvZK+4tkhPlYlwz0d1E1RlF3jyifUSfdkWUGgXIEy8Fo3yw==} peerDependencies: '@stencil/core': '>=2.0.0 || >=3 || >= 4.0.0-beta.0 || >= 4.0.0' dependencies: - '@stencil/core': 4.12.3 + '@stencil/core': 4.12.6 dev: true - /@stencil/sass@3.0.8(@stencil/core@4.12.3): + /@stencil/sass@3.0.8(@stencil/core@4.12.6): resolution: {integrity: sha512-QJUG4Dr/b3wSizViwQXorrk1PJzxOsKkq5hSqtUHc3NNG3iomC4DQFYGeu15yNfoCDBtt4qkyHSCynsekQ8F6A==} engines: {node: '>=12.0.0', npm: '>=6.0.0'} peerDependencies: '@stencil/core': '>=2.0.0 || >=3.0.0-beta.0 || >= 4.0.0-beta.0 || >= 4.0.0' dependencies: - '@stencil/core': 4.12.3 + '@stencil/core': 4.12.6 dev: true - /@stencil/vue-output-target@0.8.7(@stencil/core@4.12.3): + /@stencil/vue-output-target@0.8.7(@stencil/core@4.12.6): resolution: {integrity: sha512-hgOzbKKgLdCFrhLpmaw/qQrPSXl6hZ09K+j3p/iWh3esq6sxnwuW1PJKLniwkT4Z/JlDIk6stGPGQYi+WE5I2Q==} peerDependencies: '@stencil/core': '>=2.0.0 || >=3 || >= 4.0.0-beta.0 || >= 4.0.0' dependencies: - '@stencil/core': 4.12.3 + '@stencil/core': 4.12.6 dev: true /@svgr/babel-plugin-add-jsx-attribute@6.5.1(@babel/core@7.23.7): @@ -16284,7 +16284,7 @@ packages: pretty-format: 29.7.0 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1(@types/node@18.18.7)(typescript@4.7.4) + ts-node: 10.9.1(@types/node@16.18.70)(typescript@5.3.3) transitivePeerDependencies: - babel-plugin-macros - supports-color From cb306de7e2c3c4d40f5ecccf059ba77bb04403be Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Mon, 18 Mar 2024 18:14:43 +0100 Subject: [PATCH 07/35] fix: remove ts recommanded config for eslint --- packages/core/.eslintrc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/.eslintrc.json b/packages/core/.eslintrc.json index 2745fefbb5..a7ac4abc24 100644 --- a/packages/core/.eslintrc.json +++ b/packages/core/.eslintrc.json @@ -3,7 +3,7 @@ "parserOptions": { "project": "./tsconfig.json" }, - "extends": ["plugin:@typescript-eslint/recommended", "plugin:@stencil-community/recommended", "ix"], + "extends": [/* "plugin:@typescript-eslint/recommended", */ "plugin:@stencil-community/recommended", "ix"], "rules": { "@stencil-community/async-methods": 0, "@stencil-community/own-props-must-be-private": 0, From 29937c07e3373e5e6d5c589159b30ab5c8a93d8f Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Mon, 18 Mar 2024 18:23:08 +0100 Subject: [PATCH 08/35] ci: add deploy script --- .github/workflows/deploy-preview.yml | 55 ++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/deploy-preview.yml diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml new file mode 100644 index 0000000000..fb6ed42110 --- /dev/null +++ b/.github/workflows/deploy-preview.yml @@ -0,0 +1,55 @@ +name: Workflow Labeling + +on: + pull_request: + types: [opened,synchronize,reopened] + +jobs: + comment-workflow: + runs-on: ubuntu-latest + steps: + + # Useful if we try to also integrate other labels + # - name: Find comments + # id: find_comments + # uses: actions-cool/issues-helper@v3 + # with: + # actions: 'find-comments' + # token: ${{ secrets.GITHUB_TOKEN }} + # issue-number: ${{ github.event.issue.number }} + # comment-auth: 'github-actions[bot]' + # body-includes: '🤖 Hello ' + + # - uses: actions/github-script@v7 + # id: filter-comment + # env: + # COMMENTS_RESULT: ${{ steps.find_comments.outputs.comments }} + # with: + # script: | + # const { COMMENTS_RESULT } = process.env; + # const comments = JSON.parse(COMMENTS_RESULT); + + # if (comments.length === 1) { + # return comments[0].id; + # } + + # return ''; + # result-encoding: string + + - name: Deploy Preview for PR + if: "contains(github.event.labels.*.name, 'Deploy Preview')" + - name: Debug + shell: bash + run: | + echo Test + # uses: actions-cool/issues-helper@v3 + # with: + # actions: 'create-comment' + # token: ${{ secrets.GITHUB_TOKEN }} + # body: | + # 🤖 Hello @${{ github.event.issue.user.login }} + + # Your issue will be analyzed and is part of our internal workflow. + # To get informed about our workflow please checkout the [Contributing Guidelines](https://github.com/siemens/ix/blob/main/CONTRIBUTING.md#issue-workflow) + + # JIRA: IX-000 From 488d03b01f007f91c0d2632d92144a96ed6b522d Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Mon, 18 Mar 2024 18:24:25 +0100 Subject: [PATCH 09/35] ci: fix script --- .github/workflows/deploy-preview.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index fb6ed42110..87ee81a872 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -38,7 +38,6 @@ jobs: - name: Deploy Preview for PR if: "contains(github.event.labels.*.name, 'Deploy Preview')" - - name: Debug shell: bash run: | echo Test From db0482ad496fa3b6143c0299293ce33bbef0e474 Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Mon, 18 Mar 2024 18:25:38 +0100 Subject: [PATCH 10/35] ci: rename workflow name --- .github/workflows/deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 87ee81a872..b76c81e778 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -1,4 +1,4 @@ -name: Workflow Labeling +name: Deploy Preview on: pull_request: From 84bcb6df2885e904a902749f742376afa931b772 Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Mon, 18 Mar 2024 18:28:06 +0100 Subject: [PATCH 11/35] ci: add types to pull_request trigger --- .github/workflows/deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index b76c81e778..213b1ff5c6 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -2,7 +2,7 @@ name: Deploy Preview on: pull_request: - types: [opened,synchronize,reopened] + types: [opened, synchronize, reopened, labeled] jobs: comment-workflow: From 514ef33671efcef5c411e8e2685318501f9d70c7 Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Mon, 18 Mar 2024 18:31:00 +0100 Subject: [PATCH 12/35] ci: adjust query --- .github/workflows/deploy-preview.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 213b1ff5c6..5384ce4cec 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -5,7 +5,7 @@ on: types: [opened, synchronize, reopened, labeled] jobs: - comment-workflow: + netlify: runs-on: ubuntu-latest steps: @@ -37,7 +37,7 @@ jobs: # result-encoding: string - name: Deploy Preview for PR - if: "contains(github.event.labels.*.name, 'Deploy Preview')" + if: "contains(github.event.pull_request.labels.*.name, 'Deploy Preview')" shell: bash run: | echo Test From 63ea1a1d9f71edb171d4ea85f94a15c840e41082 Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Mon, 18 Mar 2024 18:32:08 +0100 Subject: [PATCH 13/35] ci: test --- .github/workflows/deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 5384ce4cec..aa18ebedf2 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -40,7 +40,7 @@ jobs: if: "contains(github.event.pull_request.labels.*.name, 'Deploy Preview')" shell: bash run: | - echo Test + echo Test 123 # uses: actions-cool/issues-helper@v3 # with: # actions: 'create-comment' From 6152b50d01930f2d97f6fd779dde47e00c680c8f Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Mon, 18 Mar 2024 18:37:27 +0100 Subject: [PATCH 14/35] ci: add debug statement --- .github/workflows/deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index aa18ebedf2..70941a166e 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -40,7 +40,7 @@ jobs: if: "contains(github.event.pull_request.labels.*.name, 'Deploy Preview')" shell: bash run: | - echo Test 123 + echo ${{ toJSON(github.event.pull_request) }} # uses: actions-cool/issues-helper@v3 # with: # actions: 'create-comment' From 6c65af4891979c8b55e429ef71353edc3f6c437e Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Mon, 18 Mar 2024 18:38:48 +0100 Subject: [PATCH 15/35] ci: add debug statement --- .github/workflows/deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 70941a166e..0291f13e02 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -37,7 +37,7 @@ jobs: # result-encoding: string - name: Deploy Preview for PR - if: "contains(github.event.pull_request.labels.*.name, 'Deploy Preview')" + # if: "contains(github.event.pull_request.labels.*.name, 'Deploy Preview')" shell: bash run: | echo ${{ toJSON(github.event.pull_request) }} From 3cab5d18500a8175f9ad3326cfdb8fc464e0a06f Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Mon, 18 Mar 2024 18:42:00 +0100 Subject: [PATCH 16/35] ci: add debug statement --- .github/workflows/deploy-preview.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 0291f13e02..6c19fb8324 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -37,10 +37,10 @@ jobs: # result-encoding: string - name: Deploy Preview for PR - # if: "contains(github.event.pull_request.labels.*.name, 'Deploy Preview')" + if: contains( github.event.pull_request.labels.*.name, 'Deploy Preview') shell: bash run: | - echo ${{ toJSON(github.event.pull_request) }} + echo Deploy to netlify # uses: actions-cool/issues-helper@v3 # with: # actions: 'create-comment' From 12a9ea704c55a739bf34d586771fcd50496b7874 Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Mon, 18 Mar 2024 18:43:21 +0100 Subject: [PATCH 17/35] ci: add debug statement --- .github/workflows/deploy-preview.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 6c19fb8324..a168dbf362 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -36,8 +36,12 @@ jobs: # return ''; # result-encoding: string + - name: Debug + shell: bash + run: echo ${{ contains(github.event.pull_request.labels.*.name, 'Deploy Preview') }} + - name: Deploy Preview for PR - if: contains( github.event.pull_request.labels.*.name, 'Deploy Preview') + if: contains(github.event.pull_request.labels.*.name, 'Deploy Preview') shell: bash run: | echo Deploy to netlify From 1c23d884900e44b412d5b58fe22548e5d98bad71 Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Mon, 18 Mar 2024 18:46:21 +0100 Subject: [PATCH 18/35] ci: add debug statement --- .github/workflows/deploy-preview.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index a168dbf362..1803bb344f 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -36,10 +36,6 @@ jobs: # return ''; # result-encoding: string - - name: Debug - shell: bash - run: echo ${{ contains(github.event.pull_request.labels.*.name, 'Deploy Preview') }} - - name: Deploy Preview for PR if: contains(github.event.pull_request.labels.*.name, 'Deploy Preview') shell: bash From 761924960abf435f3601292a59fa4b91fc5e8da5 Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Mon, 18 Mar 2024 18:59:06 +0100 Subject: [PATCH 19/35] ci: add comment --- .github/workflows/deploy-preview.yml | 87 +++++++++++++++------------- 1 file changed, 46 insertions(+), 41 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 1803bb344f..b1ba67dc00 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -9,46 +9,51 @@ jobs: runs-on: ubuntu-latest steps: - # Useful if we try to also integrate other labels - # - name: Find comments - # id: find_comments - # uses: actions-cool/issues-helper@v3 - # with: - # actions: 'find-comments' - # token: ${{ secrets.GITHUB_TOKEN }} - # issue-number: ${{ github.event.issue.number }} - # comment-auth: 'github-actions[bot]' - # body-includes: '🤖 Hello ' - - # - uses: actions/github-script@v7 - # id: filter-comment - # env: - # COMMENTS_RESULT: ${{ steps.find_comments.outputs.comments }} - # with: - # script: | - # const { COMMENTS_RESULT } = process.env; - # const comments = JSON.parse(COMMENTS_RESULT); - - # if (comments.length === 1) { - # return comments[0].id; - # } - - # return ''; - # result-encoding: string - - name: Deploy Preview for PR if: contains(github.event.pull_request.labels.*.name, 'Deploy Preview') - shell: bash - run: | - echo Deploy to netlify - # uses: actions-cool/issues-helper@v3 - # with: - # actions: 'create-comment' - # token: ${{ secrets.GITHUB_TOKEN }} - # body: | - # 🤖 Hello @${{ github.event.issue.user.login }} - - # Your issue will be analyzed and is part of our internal workflow. - # To get informed about our workflow please checkout the [Contributing Guidelines](https://github.com/siemens/ix/blob/main/CONTRIBUTING.md#issue-workflow) - - # JIRA: IX-000 + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-comment' + token: ${{ secrets.GITHUB_TOKEN }} + body: | + 🤖 PR Preview Deployment + + Deployment in progress + + + - name: Find comments + id: find_comments + uses: actions-cool/issues-helper@v3 + with: + actions: 'find-comments' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + comment-auth: 'github-actions[bot]' + body-includes: '🤖 PR Preview Deployment' + + - uses: actions/github-script@v7 + id: filter-comment + env: + COMMENTS_RESULT: ${{ steps.find_comments.outputs.comments }} + with: + script: | + const { COMMENTS_RESULT } = process.env; + const comments = JSON.parse(COMMENTS_RESULT); + + if (comments.length === 1) { + return comments[0].id; + } + + return ''; + result-encoding: string + + - name: Update comment + uses: actions-cool/issues-helper@v3 + with: + actions: 'update-comment' + token: ${{ secrets.GITHUB_TOKEN }} + comment-id: ${{ steps.filter-comment.outputs.results }} + body: | + 🤖 PR Preview Deployment + + Deployment in ready: From e1e81f9a7a01cbe7782ee6fb4c4ca9fcdc57c159 Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Mon, 18 Mar 2024 19:00:17 +0100 Subject: [PATCH 20/35] ci: fix script --- .github/workflows/deploy-preview.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index b1ba67dc00..fa741be602 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -13,6 +13,7 @@ jobs: if: contains(github.event.pull_request.labels.*.name, 'Deploy Preview') uses: actions-cool/issues-helper@v3 with: + issue-number: ${{ github.event.pull_request.number }} actions: 'create-comment' token: ${{ secrets.GITHUB_TOKEN }} body: | From 99efd093052976755a618b938e0774c01ba13fea Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Mon, 18 Mar 2024 19:01:55 +0100 Subject: [PATCH 21/35] ci: fix script --- .github/workflows/deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index fa741be602..74e61c04f5 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -28,7 +28,7 @@ jobs: with: actions: 'find-comments' token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} + issue-number: ${{ github.event.pull_request.number }} comment-auth: 'github-actions[bot]' body-includes: '🤖 PR Preview Deployment' From d3d9e2a12d46d2734bf22dd7942d69ffe4661ddb Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Mon, 18 Mar 2024 19:12:31 +0100 Subject: [PATCH 22/35] ci: test deploy --- .github/workflows/deploy-preview.yml | 66 +++++++++------------------- 1 file changed, 20 insertions(+), 46 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 74e61c04f5..6086abe2c1 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -9,52 +9,26 @@ jobs: runs-on: ubuntu-latest steps: - - name: Deploy Preview for PR - if: contains(github.event.pull_request.labels.*.name, 'Deploy Preview') - uses: actions-cool/issues-helper@v3 + - name: Publish + id: publish + uses: netlify/actions/cli@master with: - issue-number: ${{ github.event.pull_request.number }} - actions: 'create-comment' - token: ${{ secrets.GITHUB_TOKEN }} - body: | - 🤖 PR Preview Deployment - - Deployment in progress - - - - name: Find comments - id: find_comments - uses: actions-cool/issues-helper@v3 - with: - actions: 'find-comments' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.pull_request.number }} - comment-auth: 'github-actions[bot]' - body-includes: '🤖 PR Preview Deployment' - - - uses: actions/github-script@v7 - id: filter-comment + args: deploy env: - COMMENTS_RESULT: ${{ steps.find_comments.outputs.comments }} - with: - script: | - const { COMMENTS_RESULT } = process.env; - const comments = JSON.parse(COMMENTS_RESULT); - - if (comments.length === 1) { - return comments[0].id; - } - - return ''; - result-encoding: string - - - name: Update comment - uses: actions-cool/issues-helper@v3 - with: - actions: 'update-comment' - token: ${{ secrets.GITHUB_TOKEN }} - comment-id: ${{ steps.filter-comment.outputs.results }} - body: | - 🤖 PR Preview Deployment + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + + - name: Debug output + shell: bash + run: | + echo ${{ steps.publish.outputs.NETLIFY_URL }} + # - name: Deploy Preview for PR + # if: contains(github.event.pull_request.labels.*.name, 'Deploy Preview') + # uses: actions-cool/issues-helper@v3 + # with: + # issue-number: ${{ github.event.pull_request.number }} + # actions: 'create-comment' + # token: ${{ secrets.GITHUB_TOKEN }} + # body: | + # 📡 PR Preview Deployment - Deployment in ready: From cadf4e658dc69db5ce95737b076269010f7054da Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Mon, 18 Mar 2024 19:14:47 +0100 Subject: [PATCH 23/35] ci: add build step --- .github/workflows/deploy-preview.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 6086abe2c1..095c115121 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -8,6 +8,13 @@ jobs: netlify: runs-on: ubuntu-latest steps: + - name: Build + uses: netlify/actions/cli@master + with: + args: build + env: + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - name: Publish id: publish From 06bf242696bc12582c46a6da4daafccea18c5f20 Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Tue, 19 Mar 2024 07:54:00 +0100 Subject: [PATCH 24/35] ci: combine workflow files --- .github/workflows/deploy-preview.yml | 41 ---------------------------- .github/workflows/pr.yml | 22 +++++++++++++++ 2 files changed, 22 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/deploy-preview.yml diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml deleted file mode 100644 index 095c115121..0000000000 --- a/.github/workflows/deploy-preview.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Deploy Preview - -on: - pull_request: - types: [opened, synchronize, reopened, labeled] - -jobs: - netlify: - runs-on: ubuntu-latest - steps: - - name: Build - uses: netlify/actions/cli@master - with: - args: build - env: - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - - - name: Publish - id: publish - uses: netlify/actions/cli@master - with: - args: deploy - env: - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - - - name: Debug output - shell: bash - run: | - echo ${{ steps.publish.outputs.NETLIFY_URL }} - # - name: Deploy Preview for PR - # if: contains(github.event.pull_request.labels.*.name, 'Deploy Preview') - # uses: actions-cool/issues-helper@v3 - # with: - # issue-number: ${{ github.event.pull_request.number }} - # actions: 'create-comment' - # token: ${{ secrets.GITHUB_TOKEN }} - # body: | - # 📡 PR Preview Deployment - diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 7014613519..341a59560c 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -8,6 +8,7 @@ on: - opened - reopened - synchronize + - labeled concurrency: pr-${{ github.ref }} @@ -125,6 +126,7 @@ jobs: name: core-html-report--attempt-${{ github.run_attempt }} path: playwright-report retention-days: 2 + unit: if: ${{ needs.changes.outputs.core == 'true' || needs.changes.outputs.angular == 'true' }} needs: [build] @@ -138,3 +140,23 @@ jobs: - name: Test run: pnpm run test --cache-dir=.turbo --filter !\documentation + + deploy-preview: + if: ${{ contains(github.event.pull_request.labels.*.name, 'Deploy Preview') }} + steps: + - name: Checkout + uses: actions/checkout@v3 + + - uses: ./.github/workflows/actions/turbo + + - name: Build + run: pnpm build --cache-dir=.turbo --filter documentation + + - name: Publish + id: publish + uses: netlify/actions/cli@master + with: + args: deploy + env: + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} From e03a2bf84c1925e87b7917559b2fd309fb087071 Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Tue, 19 Mar 2024 07:54:57 +0100 Subject: [PATCH 25/35] ci: fix --- .github/workflows/pr.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 341a59560c..007a21e4b6 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -105,7 +105,6 @@ jobs: merge-core-reports: if: failure() needs: [visual-testing-core] - runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -143,6 +142,8 @@ jobs: deploy-preview: if: ${{ contains(github.event.pull_request.labels.*.name, 'Deploy Preview') }} + needs: [build] + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 From 2b1f7d600f82104ef29c2f1135fbe92bbfdbfd43 Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Tue, 19 Mar 2024 08:54:56 +0100 Subject: [PATCH 26/35] ci: test --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 007a21e4b6..b271c10662 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -157,7 +157,7 @@ jobs: id: publish uses: netlify/actions/cli@master with: - args: deploy + args: deploy --site $NETLIFY_SITE_ID --context deploy-preview env: NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} From aab8037458e4b4b5a9cf08ca62a2272b71498518 Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Tue, 19 Mar 2024 10:12:43 +0100 Subject: [PATCH 27/35] ci: test --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index b271c10662..bd4162ecf6 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -157,7 +157,7 @@ jobs: id: publish uses: netlify/actions/cli@master with: - args: deploy --site $NETLIFY_SITE_ID --context deploy-preview + args: deploy --context deploy-preview --dir packages/documentation/build env: NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} From 94da9b96b054089a119d34a4faf380a3a2206e66 Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Tue, 19 Mar 2024 10:38:07 +0100 Subject: [PATCH 28/35] ci: test --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index bd4162ecf6..048b9719ed 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -157,7 +157,7 @@ jobs: id: publish uses: netlify/actions/cli@master with: - args: deploy --context deploy-preview --dir packages/documentation/build + args: deploy --context deploy-preview --filter documentation env: NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} From 65fd8e25406c252b3393b653c1a0a7b87019ec7b Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Tue, 19 Mar 2024 10:44:14 +0100 Subject: [PATCH 29/35] ci: test --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 048b9719ed..46c0f5f059 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -157,7 +157,7 @@ jobs: id: publish uses: netlify/actions/cli@master with: - args: deploy --context deploy-preview --filter documentation + args: deploy --build --context deploy-preview --filter documentation env: NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} From b2bd3b11fcb5b27d6832d82fa63ccc2a66a1c1a9 Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Tue, 19 Mar 2024 11:01:08 +0100 Subject: [PATCH 30/35] ci: test --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 46c0f5f059..fe8d826317 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -157,7 +157,7 @@ jobs: id: publish uses: netlify/actions/cli@master with: - args: deploy --build --context deploy-preview --filter documentation + args: deploy --filter documentation env: NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} From 757cbd923dd7fcf7b2a4ae69bf969a9b364a9304 Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Tue, 19 Mar 2024 11:16:32 +0100 Subject: [PATCH 31/35] ci: test --- .github/workflows/pr.yml | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index fe8d826317..e8fc67e5fa 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -157,7 +157,45 @@ jobs: id: publish uses: netlify/actions/cli@master with: - args: deploy --filter documentation + args: deploy --filter documentation --alias pr-${{ github.event.pull_request.number }} env: NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + + - name: Find comments + id: find_comments + uses: actions-cool/issues-helper@v3 + with: + actions: 'find-comments' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.pull_request.number }} + comment-auth: 'github-actions[bot]' + body-includes: '🚢 PR Deployment is ready ' + + - uses: actions/github-script@v7 + id: filter-comment + env: + COMMENTS_RESULT: ${{ steps.find_comments.outputs.comments }} + with: + script: | + const { COMMENTS_RESULT } = process.env; + const comments = JSON.parse(COMMENTS_RESULT); + + if (comments.length === 1) { + return comments[0].id; + } + + return ''; + result-encoding: string + + - name: Create PR comment + if: ${{ steps.filter-comment.outputs.result == '' }} + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-comment' + token: ${{ secrets.GITHUB_TOKEN }} + body: | + 🚢 PR Deployment is ready + + Checkout [${{ steps.publish.outputs.NETLIFY_URL }}](${{ steps.publish.outputs.NETLIFY_URL }}) + From f1b5603787625020843cf08143355f9c6ac9b11a Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Tue, 19 Mar 2024 13:54:05 +0100 Subject: [PATCH 32/35] ci: test --- .github/workflows/pr.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index e8fc67e5fa..a1420bb8a4 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -150,14 +150,14 @@ jobs: - uses: ./.github/workflows/actions/turbo - - name: Build - run: pnpm build --cache-dir=.turbo --filter documentation + # - name: Build + # run: pnpm build --cache-dir=.turbo --filter documentation - name: Publish id: publish uses: netlify/actions/cli@master with: - args: deploy --filter documentation --alias pr-${{ github.event.pull_request.number }} + args: deploy --build --context deploy-preview --filter documentation --alias pr-${{ github.event.pull_request.number }} env: NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} @@ -192,10 +192,12 @@ jobs: if: ${{ steps.filter-comment.outputs.result == '' }} uses: actions-cool/issues-helper@v3 with: + issue-number: ${{ github.event.pull_request.number }} actions: 'create-comment' token: ${{ secrets.GITHUB_TOKEN }} body: | 🚢 PR Deployment is ready - Checkout [${{ steps.publish.outputs.NETLIFY_URL }}](${{ steps.publish.outputs.NETLIFY_URL }}) + Preview ✅: [${{ steps.publish.outputs.NETLIFY_URL }}](${{ steps.publish.outputs.NETLIFY_URL }}) + Logs: [${{ steps.publish.outputs.NETLIFY_LOGS_URL }}](${{ steps.publish.outputs.NETLIFY_LOGS_URL }}) From 2e19bbc03ae9468b30057ccab7a6545790f09fec Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Wed, 20 Mar 2024 07:16:55 +0100 Subject: [PATCH 33/35] ci: remove pr steps --- .github/workflows/pr.yml | 62 ---------------------------------------- 1 file changed, 62 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index a1420bb8a4..2987811444 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -139,65 +139,3 @@ jobs: - name: Test run: pnpm run test --cache-dir=.turbo --filter !\documentation - - deploy-preview: - if: ${{ contains(github.event.pull_request.labels.*.name, 'Deploy Preview') }} - needs: [build] - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - uses: ./.github/workflows/actions/turbo - - # - name: Build - # run: pnpm build --cache-dir=.turbo --filter documentation - - - name: Publish - id: publish - uses: netlify/actions/cli@master - with: - args: deploy --build --context deploy-preview --filter documentation --alias pr-${{ github.event.pull_request.number }} - env: - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - - - name: Find comments - id: find_comments - uses: actions-cool/issues-helper@v3 - with: - actions: 'find-comments' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.pull_request.number }} - comment-auth: 'github-actions[bot]' - body-includes: '🚢 PR Deployment is ready ' - - - uses: actions/github-script@v7 - id: filter-comment - env: - COMMENTS_RESULT: ${{ steps.find_comments.outputs.comments }} - with: - script: | - const { COMMENTS_RESULT } = process.env; - const comments = JSON.parse(COMMENTS_RESULT); - - if (comments.length === 1) { - return comments[0].id; - } - - return ''; - result-encoding: string - - - name: Create PR comment - if: ${{ steps.filter-comment.outputs.result == '' }} - uses: actions-cool/issues-helper@v3 - with: - issue-number: ${{ github.event.pull_request.number }} - actions: 'create-comment' - token: ${{ secrets.GITHUB_TOKEN }} - body: | - 🚢 PR Deployment is ready - - Preview ✅: [${{ steps.publish.outputs.NETLIFY_URL }}](${{ steps.publish.outputs.NETLIFY_URL }}) - Logs: [${{ steps.publish.outputs.NETLIFY_LOGS_URL }}](${{ steps.publish.outputs.NETLIFY_LOGS_URL }}) - From 1d76a815580d8710da5fd55f41772ba9554c7002 Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Wed, 20 Mar 2024 08:34:10 +0100 Subject: [PATCH 34/35] ci: test [deploy netlify] --- netlify.toml | 2 ++ scripts/ignore-netlify.js | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 netlify.toml create mode 100644 scripts/ignore-netlify.js diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 0000000000..d8811424f6 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,2 @@ +[build] + ignore = diff --git a/scripts/ignore-netlify.js b/scripts/ignore-netlify.js new file mode 100644 index 0000000000..0ce0cf6fe6 --- /dev/null +++ b/scripts/ignore-netlify.js @@ -0,0 +1,8 @@ +/* + * SPDX-FileCopyrightText: 2024 Siemens AG + * + * SPDX-License-Identifier: MIT + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ From 656cd08fe706e803b5c217f73740b6e68e3d6e3f Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Wed, 20 Mar 2024 08:46:05 +0100 Subject: [PATCH 35/35] ci: add toml --- netlify.toml | 2 +- scripts/ignore-netlify.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index d8811424f6..79d16855e0 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,2 +1,2 @@ [build] - ignore = + ignore = "GIT_COMMIT_MESSAGE=$(git show -s --format=%s $CACHED_COMMIT_REF) node ./scripts/ignore-netlify.js" diff --git a/scripts/ignore-netlify.js b/scripts/ignore-netlify.js index 0ce0cf6fe6..7fbb58457f 100644 --- a/scripts/ignore-netlify.js +++ b/scripts/ignore-netlify.js @@ -6,3 +6,11 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ + +const GIT_COMMIT_MESSAGE = process.env.GIT_COMMIT_MESSAGE; + +if (GIT_COMMIT_MESSAGE.includes('[deploy netlify]')) { + process.exit(1); +} + +process.exit(0);