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

feat: add Create a new Module Federation project cli #3446

Merged
merged 24 commits into from
Mar 14, 2025

Conversation

2heal1
Copy link
Member

@2heal1 2heal1 commented Jan 20, 2025

Description

add create-module-federation cli

how to use it ?

# use npm create-module-federation@latest for official version , now it's only for test
npm create-module-federation@next

It supports two category:

  • app
  • lib
  • other (for custom template)

and it also support choose framework mode or build mode

App type:

web

Lib type:
lib

The initial page:

image

Other type:

It will execute the create command

    const OTHER_TYPE: {
      [typeName: string]: {
        label: string;
        command: string;
        hint?: string;
      };
    } = {
      zephyr: {
        label: 'zephyr',
        command: 'npm create zephyr@latest',
        hint: 'npm create zephyr@latest',
      },
    };

    const { status } = spawnSync(OTHER_TYPE.zephyr.cmd, cmdArgs, {
      stdio: 'inherit',
    });
    process.exit(status ?? 0);

image

Related Issue

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the documentation.

Copy link

changeset-bot bot commented Jan 20, 2025

🦋 Changeset detected

Latest commit: 79355a6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 30 packages
Name Type
create-module-federation Major
@module-federation/rsbuild-plugin Major
@module-federation/modern-js Major
@module-federation/runtime Major
@module-federation/enhanced Major
@module-federation/rspack Major
@module-federation/webpack-bundler-runtime Major
@module-federation/sdk Major
@module-federation/runtime-tools Major
@module-federation/managers Major
@module-federation/manifest Major
@module-federation/dts-plugin Major
@module-federation/third-party-dts-extractor Major
@module-federation/devtools Major
@module-federation/bridge-react Major
@module-federation/bridge-vue3 Major
@module-federation/bridge-shared Major
@module-federation/bridge-react-webpack-plugin Major
@module-federation/retry-plugin Major
@module-federation/data-prefetch Major
@module-federation/error-codes Major
@module-federation/inject-external-runtime-core-plugin Major
@module-federation/runtime-core Major
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/storybook-addon Major
@module-federation/modernjsapp Patch
@module-federation/esbuild Patch
@module-federation/utilities Patch
website-new Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented Jan 20, 2025

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 79355a6
🔍 Latest deploy log https://app.netlify.com/sites/module-federation-docs/deploys/67d3a7b72299aa0007e8e965
😎 Deploy Preview https://deploy-preview-3446--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@zackarychapple
Copy link
Collaborator

@swalker326 @ryok90 can one of you add a "include zephyr" option along with the appropriate configurations to this PR. I think it would be a great value add.

@zmzlois
Copy link

zmzlois commented Jan 21, 2025

@swalker326 @ryok90 can one of you add a "include zephyr" option along with the appropriate configurations to this PR. I think it would be a great value add.

"Add zephyr as deploy platform" 🚀

@2heal1 2heal1 force-pushed the feat/create-module-federation branch 4 times, most recently from 1de4a04 to 77e5763 Compare March 5, 2025 09:24
@2heal1 2heal1 changed the title WIP: feat: add Create a new Module Federation project cli feat: add Create a new Module Federation project cli Mar 5, 2025
@2heal1 2heal1 changed the title feat: add Create a new Module Federation project cli WIP: feat: add Create a new Module Federation project cli Mar 6, 2025
@2heal1
Copy link
Member Author

2heal1 commented Mar 6, 2025

@Nsttt you can create create-zephyr package, and add more info here

The link not jump rightly .

Here is the key

const OTHER_TYPE: {
  [typeName: string]: {
    label: string;
    command: string;
    hint?: string;
  };
} = {
  zephyr: {
    label: 'zephyr',
    command: 'npm create zephyr@latest',
    hint: 'npm create zephyr@latest',
  },
};

@2heal1 2heal1 changed the title WIP: feat: add Create a new Module Federation project cli feat: add Create a new Module Federation project cli Mar 14, 2025
@2heal1 2heal1 force-pushed the feat/create-module-federation branch from ffbd25c to 928f51d Compare March 14, 2025 03:50
@2heal1 2heal1 merged commit f302eeb into main Mar 14, 2025
15 of 16 checks passed
@2heal1 2heal1 deleted the feat/create-module-federation branch March 14, 2025 06:24
@2heal1 2heal1 mentioned this pull request Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants