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

🤖 Bip Bop - Fusion Framework Release #2512

Merged
merged 1 commit into from
Oct 15, 2024
Merged

🤖 Bip Bop - Fusion Framework Release #2512

merged 1 commit into from
Oct 15, 2024

Conversation

github-actions[bot]
Copy link
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@equinor/[email protected]

Major Changes

  • #2494 e11ad64 Thanks @odinr! - Adding new commands for app management, build-publish, build-pack, build-upload, build-config, build-manifest and build-tag.

    Introduces new parameters to the build-config command for publishing the app config to a build version.

    Commands:

    • build-pack - Bundle the app for distribution
      • -o, --output <output> - Output directory for the packed app
      • -a, --archive - Archive name for the packed app
    • build-upload - Upload the packed app to the Fusion App Store
      • -b, --bundle <bundle> - Path to the packed app bundle
      • -e, --env <ci | fqa | tr | fprd> - Environment to upload the app to
      • -s, --service <service> - Custom app service
    • build-tag - Tag the uploaded app with a version
      • -t, --tag <tag> - Tag to apply to the uploaded app
      • -v, --version <version> - Version to attach to the tag
      • -e, --env <ci | fqa | tr | fprd> - Environment to tag the app in
      • -s, --service <service> - Custom app service
    • build-publish - Publish the app config to a build version
      • -t, --tag <tag> - Tag to apply to the uploaded app
      • -e, --env <ci | fqa | tr | fprd> - Environment to tag the app in
      • -s, --service <service> - Custom app service
    • build-config - Generate app config for an environment
      • -o, --output <output> - Output file for the app config
      • -c, --config <config> - Path to the app config file (for config generation)
      • -p, --publish - Flag for upload the generated config
      • -v, --version<semver | current | latest | preview> - Publish the app config to version
      • -e, --env <ci | fqa | tr | fprd> - Environment to publish the app config to
      • -s, --service <service> - Custom app service
    • upload-config - Upload the app config to a build version
      • -c, --config <config> - Path to the app config json file to upload
      • -p, --publish<semver | current | latest | preview> - Publish the app config to the build version
      • -e, --env <ci | fqa | tr | fprd> - Environment to publish the app config to
      • -s, --service <service> - Custom app service
    • build-manifest - Creates the build manifest to publish with app
      • -o, --output <output> - Output file for manifest
      • -c, --config <config> - Manifest config file

    simple usage:

    fusion-framework-cli app build-publish -e ci

    complex usage:

    fusion-framework-cli app build-pack -o ./dist -a my-app.zip
    fusion-framework-cli app build-upload -b ./dist/my-app.zip -e ci
    fusion-framework-cli app build-tag -t my-tag -v 1.0.0 -e ci

    After publishing a build of an app, the app config should be uploaded to the build version. This is done by running the build-config command.

    # Publish the app config to the build version
    fusion-framework-cli app build-config -p -e ci
    
    # Publish the app config to a specific build tag
    fusion-framework-cli app build-config -p preview -e ci
    
    # Publish the app config to a specific build version
    fusion-framework-cli app build-config -p 1.0.0 -e ci

    breaking changes:

    • renaming all commands accociated with build.

    • The app-config endpoints is now an object containing url and scopes, where name is the object key:

        environment: {
            myProp: 'foobar',
        },
        endpoints: {
            api: {
                url: 'https://foo.bars'
                scopes: ['foobar./default']
            },
        },
    • The config command has been removed, use build-config instead

Minor Changes

  • #2494 e11ad64 Thanks @odinr! - Introduced proxyRequestLogger to log proxy requests in the CLI.

    • Show the request URL and method in the console when a proxy request is made.
    • Show proxy response status code
  • #2494 e11ad64 Thanks @odinr! - Create a plugin externalPublicPlugin to fix the issue with serving the index.html file from the specified external public directory. Vite mode spa will not serve the index.html file from the specified external public directory.

    • Enhanced the middleware to intercept requests and serve the index.html file from the specified external public directory.
    • Transformed the HTML using Vite's transformIndexHtml method.
    • Applied appropriate content headers and additional configured headers before sending the response.
    const viteConfig = defineConfig({
        // vite configuration
        root: './src', // this where vite will look for the index.html file
        plugins: [
            // path which contains the index.html file
            externalPublicPlugin('./my-portal'),
        ],
    });
  • #2494 e11ad64 Thanks @odinr! - Updated commands in CLI to reflect purpose of the command:

    • renamed config to build-config to generate build config of an application.
    • renamed packto build-pack to bundle an application.
    • added build-manifest command to generate build manifest of an application.

    [!WARNING]
    Config callback for manifest and config now allows void return type.
    Return value from callback is now merged with default config instead of replacing it, this might be a breaking change for some applications.

    [!NOTE]
    This mean that mergeAppConfig and mergeManifestConfig functions are no longer needed and can be removed from the application.

  • #2494 e11ad64 Thanks @odinr! - The appProxyPlugin is a Vite plugin designed to proxy requests to a Fusion app backend.
    It sets up proxy rules for API and bundle requests and serves the app configuration and manifest based on the app key and version.

    Key Features:

    1. Proxy Configuration:

      • Proxies API calls to the Fusion apps backend.
      • Proxies bundle requests to the Fusion apps backend.
      • Uses a base path proxyPath for proxying.
      • Captures and reuses authorization tokens for asset requests.
    2. App Configuration and Manifest:

      • Serves the app configuration if the request matches the current app and version.
      • Serves the app manifest if the request matches the current app.
    3. Middleware Setup:

      • Sets up middleware to handle requests for app configuration, manifest, and local bundles.

    This plugin is used by the CLI for local development, but design as exportable for custom CLI to consume applications from other API`s

    example configuration:

    const viteConfig = defineConfig({
        // vite configuration
        plugins: [
            appProxyPlugin({
                proxy: {
                    path: '/app-proxy',
                    target: 'https://fusion-s-apps-ci.azurewebsites.net/',
                    // optional callback when matched request is proxied
                    onProxyReq: (proxyReq, req, res) => {
                        proxyReq.on('response', (res) => {
                            console.log(res.statusCode);
                        });
                    },
                },
                // optional, but required for serving local app configuration, manifest and resources
                app: {
                    key: 'my-app',
                    version: '1.0.0',
                    generateConfig: async () => ({}),
                    generateManifest: async () => ({}),
                },
            }),
        ],
    });

    example usage:

    // Example API calls
    fetch('/app-proxy/apps/my-app/builds/1.0.0/config'); // local
    fetch('/app-proxy/apps/my-app/builds/0.0.9/config'); // proxy
    fetch('/app-proxy/apps/other-app/builds/1.0.0/config'); // proxy
    
    // Example asset calls
    fetch('/app-proxy/bundles/my-app/builds/1.0.0/index.js'); // local
    fetch('/app-proxy/bundles/my-app/builds/0.0.9/index.js'); // proxy
  • #2494 e11ad64 Thanks @odinr! - when building an application the AppAssetExportPlugin is now added to the ViteConfig and configure to include manifest.build.allowedExtensions

  • #2494 e11ad64 Thanks @odinr! - App Assets Export Plugin

    Create a plugin that exports assets from the app's source code.
    This plugin resolves the issue where assets are not extracted from the app's source code since the app is in lib mode.

    export default {
      plugins: [
        AppAssetExportPlugin(
          include: createExtensionFilterPattern(
            manifest.build.allowedExtensions
            ),
        ),
      ]
    }

    see readme for more information.

Patch Changes

  • #2494 e11ad64 Thanks @odinr! - Updating fusion-wc-person to fix issues when using selectedPerson = null in PersonSelect component.

    Updated the following dependencies

    • @equinor/fusion-wc-person from ^3.0.1 to ^3.0.3 in packages/cli/package.json and packages/react/components/people-resolver/package.json.
  • #2494 e11ad64 Thanks @odinr! - Generated base manifest from package will now include StandardIncludeAssetExtensions as allowedExtensions

@equinor/[email protected]

Major Changes

  • #2494 e11ad64 Thanks @odinr! - Adjusted module to the new app service API.

    [!WARNING]
    This will introduce breaking changes to the configuration of AppConfigurator.client.

    Added

    • Introduced AppClient class to handle application manifest and configuration queries.
    • Added zod to validate the application manifest.

    Changed

    • Updated AppModuleProvider to use AppClient for fetching application manifests and configurations.
    • Modified AppConfigurator to utilize AppClient for client configuration.
    • Updated useApps hook with new input parameter for filterByCurrentUser in fusion-framework-react.

    Migration

    before:

    configurator.setClient({
        getAppManifest: {
            client: {
                fn: ({ appKey }) => httpClient.json$<ApiApp>(`/apps/${appKey}`),
            },
            key: ({ appKey }) => appKey,
        },
        getAppManifests: {
            client: {
                fn: () => httpClient.json$<ApiApp[]>(`/apps`),
            },
            key: () => `all-apps`,
        },
        getAppConfig: {
            client: {
                fn: ({ appKey }) => httpClient.json$<ApiApp>(`/apps/${appKey}/config`),
            },
            key: ({ appKey }) => appKey,
        },
    });

    after:

    import { AppClient } from `@equinor/fusion-framework-module-app`;
    configurator.setClient(new AppClient());

    custom client implementation:

    import { AppClient } from `@equinor/fusion-framework-module-app`;
    class CustomAppClient implements IAppClient { ... }
    configurator.setClient(new CustomAppClient());

@equinor/[email protected]

Minor Changes

  • #2494 e11ad64 Thanks @odinr! - Adjusted module to the new app service API.

    [!WARNING]
    This will introduce breaking changes to the configuration of AppConfigurator.client.

    Added

    • Introduced AppClient class to handle application manifest and configuration queries.
    • Added zod to validate the application manifest.

    Changed

    • Updated AppModuleProvider to use AppClient for fetching application manifests and configurations.
    • Modified AppConfigurator to utilize AppClient for client configuration.
    • Updated useApps hook with new input parameter for filterByCurrentUser in fusion-framework-react.

    Migration

    before:

    configurator.setClient({
        getAppManifest: {
            client: {
                fn: ({ appKey }) => httpClient.json$<ApiApp>(`/apps/${appKey}`),
            },
            key: ({ appKey }) => appKey,
        },
        getAppManifests: {
            client: {
                fn: () => httpClient.json$<ApiApp[]>(`/apps`),
            },
            key: () => `all-apps`,
        },
        getAppConfig: {
            client: {
                fn: ({ appKey }) => httpClient.json$<ApiApp>(`/apps/${appKey}/config`),
            },
            key: ({ appKey }) => appKey,
        },
    });

    after:

    import { AppClient } from `@equinor/fusion-framework-module-app`;
    configurator.setClient(new AppClient());

    custom client implementation:

    import { AppClient } from `@equinor/fusion-framework-module-app`;
    class CustomAppClient implements IAppClient { ... }
    configurator.setClient(new CustomAppClient());

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Patch Changes

  • #2494 e11ad64 Thanks @odinr! - Adjusted module to the new app service API.

    [!WARNING]
    This will introduce breaking changes to the configuration of AppConfigurator.client.

    Added

    • Introduced AppClient class to handle application manifest and configuration queries.
    • Added zod to validate the application manifest.

    Changed

    • Updated AppModuleProvider to use AppClient for fetching application manifests and configurations.
    • Modified AppConfigurator to utilize AppClient for client configuration.
    • Updated useApps hook with new input parameter for filterByCurrentUser in fusion-framework-react.

    Migration

    before:

    configurator.setClient({
        getAppManifest: {
            client: {
                fn: ({ appKey }) => httpClient.json$<ApiApp>(`/apps/${appKey}`),
            },
            key: ({ appKey }) => appKey,
        },
        getAppManifests: {
            client: {
                fn: () => httpClient.json$<ApiApp[]>(`/apps`),
            },
            key: () => `all-apps`,
        },
        getAppConfig: {
            client: {
                fn: ({ appKey }) => httpClient.json$<ApiApp>(`/apps/${appKey}/config`),
            },
            key: ({ appKey }) => appKey,
        },
    });

    after:

    import { AppClient } from `@equinor/fusion-framework-module-app`;
    configurator.setClient(new AppClient());

    custom client implementation:

    import { AppClient } from `@equinor/fusion-framework-module-app`;
    class CustomAppClient implements IAppClient { ... }
    configurator.setClient(new CustomAppClient());
  • Updated dependencies [e11ad64]:

@equinor/[email protected]

Patch Changes

  • #2494 e11ad64 Thanks @odinr! - Adjusted module to the new app service API.

    [!WARNING]
    This will introduce breaking changes to the configuration of AppConfigurator.client.

    Added

    • Introduced AppClient class to handle application manifest and configuration queries.
    • Added zod to validate the application manifest.

    Changed

    • Updated AppModuleProvider to use AppClient for fetching application manifests and configurations.
    • Modified AppConfigurator to utilize AppClient for client configuration.
    • Updated useApps hook with new input parameter for filterByCurrentUser in fusion-framework-react.

    Migration

    before:

    configurator.setClient({
        getAppManifest: {
            client: {
                fn: ({ appKey }) => httpClient.json$<ApiApp>(`/apps/${appKey}`),
            },
            key: ({ appKey }) => appKey,
        },
        getAppManifests: {
            client: {
                fn: () => httpClient.json$<ApiApp[]>(`/apps`),
            },
            key: () => `all-apps`,
        },
        getAppConfig: {
            client: {
                fn: ({ appKey }) => httpClient.json$<ApiApp>(`/apps/${appKey}/config`),
            },
            key: ({ appKey }) => appKey,
        },
    });

    after:

    import { AppClient } from `@equinor/fusion-framework-module-app`;
    configurator.setClient(new AppClient());

    custom client implementation:

    import { AppClient } from `@equinor/fusion-framework-module-app`;
    class CustomAppClient implements IAppClient { ... }
    configurator.setClient(new CustomAppClient());
  • Updated dependencies [e11ad64]:

@equinor/[email protected]

Patch Changes

  • #2494 e11ad64 Thanks @odinr! - Updating fusion-wc-person to fix issues when using selectedPerson = null in PersonSelect component.

    Updated the following dependencies

    • @equinor/fusion-wc-person from ^3.0.1 to ^3.0.3 in packages/cli/package.json and packages/react/components/people-resolver/package.json.
  • Updated dependencies [e11ad64]:

@equinor/[email protected]

Patch Changes

  • #2494 e11ad64 Thanks @odinr! - Adjusted module to the new app service API.

    [!WARNING]
    This will introduce breaking changes to the configuration of AppConfigurator.client.

    Added

    • Introduced AppClient class to handle application manifest and configuration queries.
    • Added zod to validate the application manifest.

    Changed

    • Updated AppModuleProvider to use AppClient for fetching application manifests and configurations.
    • Modified AppConfigurator to utilize AppClient for client configuration.
    • Updated useApps hook with new input parameter for filterByCurrentUser in fusion-framework-react.

    Migration

    before:

    configurator.setClient({
        getAppManifest: {
            client: {
                fn: ({ appKey }) => httpClient.json$<ApiApp>(`/apps/${appKey}`),
            },
            key: ({ appKey }) => appKey,
        },
        getAppManifests: {
            client: {
                fn: () => httpClient.json$<ApiApp[]>(`/apps`),
            },
            key: () => `all-apps`,
        },
        getAppConfig: {
            client: {
                fn: ({ appKey }) => httpClient.json$<ApiApp>(`/apps/${appKey}/config`),
            },
            key: ({ appKey }) => appKey,
        },
    });

    after:

    import { AppClient } from `@equinor/fusion-framework-module-app`;
    configurator.setClient(new AppClient());

    custom client implementation:

    import { AppClient } from `@equinor/fusion-framework-module-app`;
    class CustomAppClient implements IAppClient { ... }
    configurator.setClient(new CustomAppClient());
  • Updated dependencies [e11ad64]:

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Minor Changes

@equinor/[email protected]

Patch Changes

  • #2494 e11ad64 Thanks @odinr! - Cleaned up app config

    Removed app.config.* from the cookbook apps to prevent confusion when using the cookbook apps as a template for new apps.

@equinor/[email protected]

Patch Changes

  • #2494 e11ad64 Thanks @odinr! - Cleaned up app config

    Removed app.config.* from the cookbook apps to prevent confusion when using the cookbook apps as a template for new apps.

@equinor/[email protected]

Patch Changes

  • #2494 e11ad64 Thanks @odinr! - Cleaned up app config

    Removed app.config.* from the cookbook apps to prevent confusion when using the cookbook apps as a template for new apps.

@equinor/[email protected]

Patch Changes

  • #2494 e11ad64 Thanks @odinr! - Cleaned up app config

    Removed app.config.* from the cookbook apps to prevent confusion when using the cookbook apps as a template for new apps.

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Patch Changes

  • #2494 e11ad64 Thanks @odinr! - Cleaned up app config

    Removed app.config.* from the cookbook apps to prevent confusion when using the cookbook apps as a template for new apps.

@equinor/[email protected]

Patch Changes

@equinor/[email protected]

Patch Changes

  • #2494 e11ad64 Thanks @odinr! - Cleaned up app config

    Removed app.config.* from the cookbook apps to prevent confusion when using the cookbook apps as a template for new apps.

@equinor/[email protected]

Patch Changes

  • #2494 e11ad64 Thanks @odinr! - Cleaned up app config

    Removed app.config.* from the cookbook apps to prevent confusion when using the cookbook apps as a template for new apps.

@equinor/[email protected]

Patch Changes

  • #2494 e11ad64 Thanks @odinr! - Cleaned up app config

    Removed app.config.* from the cookbook apps to prevent confusion when using the cookbook apps as a template for new apps.

@equinor/[email protected]

Patch Changes

  • #2494 e11ad64 Thanks @odinr! - Cleaned up app config

    Removed app.config.* from the cookbook apps to prevent confusion when using the cookbook apps as a template for new apps.

@equinor/[email protected]

Patch Changes

  • #2494 e11ad64 Thanks @odinr! - Cleaned up app config

    Removed app.config.* from the cookbook apps to prevent confusion when using the cookbook apps as a template for new apps.

[email protected]

Patch Changes

@github-actions github-actions bot requested review from odinr and a team as code owners October 15, 2024 09:09
@github-actions github-actions bot marked this pull request as draft October 15, 2024 09:09
@odinr odinr marked this pull request as ready for review October 15, 2024 10:20
@github-actions github-actions bot added 👨🏻‍🍳 cookbooks 👾 React 💾 CLI fusion framework CLI 📚 documentation Improvements or additions to documentation 🧬 Modules labels Oct 15, 2024
Copy link
Contributor Author

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 0.39% 1746 / 440975
🔵 Statements 0.39% 1746 / 440975
🔵 Functions 23.8% 219 / 920
🔵 Branches 37.34% 400 / 1071
File CoverageNo changed files found.
Generated in workflow #7883 for commit ffc8b07 by the Vitest Coverage Report Action

@odinr odinr merged commit c7fb888 into main Oct 15, 2024
9 checks passed
@odinr odinr deleted the changeset-release/main branch October 15, 2024 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💾 CLI fusion framework CLI 👨🏻‍🍳 cookbooks 📚 documentation Improvements or additions to documentation 🧬 Modules 👾 React
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants