Skip to content

Commit

Permalink
Merge branch 'main' into chore/enhanced-moduel-type
Browse files Browse the repository at this point in the history
  • Loading branch information
ScriptedAlchemy authored Apr 26, 2024
2 parents 494a7cb + 73132ed commit 129eeb5
Show file tree
Hide file tree
Showing 187 changed files with 12,495 additions and 2,022 deletions.
5 changes: 0 additions & 5 deletions .changeset/brown-cycles-boil.md

This file was deleted.

3 changes: 2 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"@module-federation/managers",
"@module-federation/manifest",
"@module-federation/dts-plugin",
"@module-federation/third-party-dts-extractor"
"@module-federation/third-party-dts-extractor",
"@module-federation/devtools"
]
],
"ignorePatterns": ["^alpha|^beta"],
Expand Down
5 changes: 5 additions & 0 deletions .changeset/five-timers-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/runtime': patch
---

package json main definition
5 changes: 5 additions & 0 deletions .changeset/pink-teachers-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/devtools': patch
---

chore(devtools): add modern lib to publish npm package
5 changes: 0 additions & 5 deletions .changeset/rich-peaches-tan.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/tame-planets-check.md

This file was deleted.

6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ body:
label: Validations
description: Before submitting the issue, please make sure you do the following
options:
- label: Read the [docs](https://github.com/module-federation/universe).
- label: Read the [docs](https://github.com/module-federation/core).
required: true
- label: Read the [common issues list](https://github.com/module-federation/universe/issues).
- label: Read the [common issues list](https://github.com/module-federation/core/issues).
required: true
- label: Check that there isn't [already an issue](https://github.com/module-federation/universe/issues) that reports the same bug to avoid creating a duplicate.
- label: Check that there isn't [already an issue](https://github.com/module-federation/core/issues) that reports the same bug to avoid creating a duplicate.
required: true
- label: Make sure this is a Module federation issue and not a framework-specific issue.
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Questions & Discussions
url: https://github.com/module-federation/universe/discussions
url: https://github.com/module-federation/core/discussions
about: Use GitHub discussions for message-board style questions and discussions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ body:
label: Validations
description: Before submitting the issue, please make sure you do the following
options:
- label: Read the [Contributing Guidelines](https://github.com/module-federation/universe/blob/canary/CONTRIBUTING.md).
- label: Read the [Contributing Guidelines](https://github.com/module-federation/core/blob/canary/CONTRIBUTING.md).
required: true
- label: Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
required: true
40 changes: 20 additions & 20 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,26 @@ jobs:
- name: Run Affected Test
run: npx nx affected -t test --parallel=3 --exclude='*,!tag:type:pkg'

- name: E2E Test for Next.js Dev
run: |
pnpm run app:next:dev &
sleep 1 &&
npx wait-on tcp:3001 &&
npx wait-on tcp:3002 &&
npx wait-on tcp:3000 &&
npx nx run-many --target=test:e2e --projects=3000-home,3001-shop,3002-checkout --parallel=2 &&
lsof -ti tcp:3000,3001,3002 | xargs kill
- name: E2E Test for Next.js Prod
run: |
pnpm run --filter @module-federation/3002-checkout --filter @module-federation/3000-home --filter @module-federation/3001-shop build &&
pnpm run app:next:prod &
sleep 2 &&
npx wait-on tcp:3001 &&
npx wait-on tcp:3002 &&
npx wait-on tcp:3000 &&
npx nx run-many --target=test:e2e --projects=3000-home,3001-shop,3002-checkout --parallel=1 &&
lsof -ti tcp:3000,3001,3002 | xargs kill
# - name: E2E Test for Next.js Dev
# run: |
# pnpm run app:next:dev &
# sleep 1 &&
# npx wait-on tcp:3001 &&
# npx wait-on tcp:3002 &&
# npx wait-on tcp:3000 &&
# npx nx run-many --target=test:e2e --projects=3000-home,3001-shop,3002-checkout --parallel=2 &&
# lsof -ti tcp:3000,3001,3002 | xargs kill

# - name: E2E Test for Next.js Prod
# run: |
# pnpm run --filter @module-federation/3002-checkout --filter @module-federation/3000-home --filter @module-federation/3001-shop build &&
# pnpm run app:next:prod &
# sleep 2 &&
# npx wait-on tcp:3001 &&
# npx wait-on tcp:3002 &&
# npx wait-on tcp:3000 &&
# npx nx run-many --target=test:e2e --projects=3000-home,3001-shop,3002-checkout --parallel=1 &&
# lsof -ti tcp:3000,3001,3002 | xargs kill

- name: E2E Test for ModernJS
run: npx nx run-many --target=test:e2e --projects=modernjs --parallel=1 && lsof -ti tcp:4001 | xargs kill
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-close-require.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
permissions:
issues: write
runs-on: ubuntu-latest
if: github.repository == 'module-federation/universe'
if: github.repository == 'module-federation/core'
steps:
- name: need reproduction
uses: actions-cool/issues-helper@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-labeled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
reply-labeled:
if: github.repository == 'module-federation/universe'
if: github.repository == 'module-federation/core'
runs-on: ubuntu-latest
steps:
- name: contribution welcome
Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ If you've changed some packages, you need add a new changeset for the changes. P
pnpm run changeset
```

![image](https://github.com/module-federation/universe/assets/27547179/15505abf-8b0b-450f-b2d0-ffdc52e710a4)
![image](https://github.com/module-federation/core/assets/27547179/15505abf-8b0b-450f-b2d0-ffdc52e710a4)


### Committing your Changes
Expand Down Expand Up @@ -138,7 +138,7 @@ Module Federation uses GitHub Actions for automated versioning and publishing:
2. Make sure that both "use workflow from" and "release branch" are split for the test version you want to release
3. Use the "next" TAB to release the test version

![image](https://github.com/module-federation/universe/assets/27547179/f84fd796-d1d9-42f6-8bb2-95b07c6d7749)
![image](https://github.com/module-federation/core/assets/27547179/f84fd796-d1d9-42f6-8bb2-95b07c6d7749)



Expand All @@ -147,15 +147,15 @@ Module Federation uses GitHub Actions for automated versioning and publishing:
1. Use the release pull request to release an official version
* It will create a pull request that includes the changed version

![image](https://github.com/module-federation/universe/assets/27547179/b5ed83f3-4cf8-4a95-859b-729e3ad0e7eb)
![image](https://github.com/module-federation/universe/assets/27547179/1cfc2e71-dbf9-41d8-84f8-3948eb636c7c)
![image](https://github.com/module-federation/core/assets/27547179/b5ed83f3-4cf8-4a95-859b-729e3ad0e7eb)
![image](https://github.com/module-federation/core/assets/27547179/1cfc2e71-dbf9-41d8-84f8-3948eb636c7c)



2. If the version is normal, release it using release workflow and then a branch of pull request
![image](https://github.com/module-federation/universe/assets/27547179/5c66e9e5-7bd7-4466-a1aa-38420f1dac82)
![image](https://github.com/module-federation/core/assets/27547179/5c66e9e5-7bd7-4466-a1aa-38420f1dac82)


4. Generate a release note based on the original tag after the release is complete

![image](https://github.com/module-federation/universe/assets/27547179/accc9626-9ffd-4074-8d47-14372ae77400)
![image](https://github.com/module-federation/core/assets/27547179/accc9626-9ffd-4074-8d47-14372ae77400)
49 changes: 23 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
<p align="center">
<img alt="Module federation Banner" width="260" src="https://github.com/module-federation/universe/assets/27547179/11234712-40fc-4696-a7fd-16e0c631005a">
<img alt="Module federation Banner" width="260" src="https://github.com/module-federation/core/assets/27547179/11234712-40fc-4696-a7fd-16e0c631005a">
</p>

# Module Federation

<p align="center">
<a href="https://www.npmjs.com/package/@module-federation/runtime?activeTab=readme">
<img src="https://img.shields.io/npm/v/@module-federation/runtime?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" />
</a>
<a href="https://npmcharts.com/compare/@module-federation/runtime?minimal=true">
<img src="https://img.shields.io/npm/dm/@module-federation/runtime.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="downloads" />
</a>
<a href="https://github.com/web-infra-dev/rspack/blob/main/LICENSE">
<img src="https://img.shields.io/npm/l/@module-federation/runtime?style=flat-square&colorA=564341&colorB=EDED91" alt="license" />
</a>
</p>

You can consider the module federation capabilities provided by this repository as "module federation 2.0". "Module Federation 2.0" differs from the "Module Federation" built into Webpack 5 by offering not only the core features of module export, loading, and dependency sharing but also additional dynamic type hinting, a "Manifest", a "Federation Runtime", and a "Runtime Plugin System". These features make "Module Federation" more suitable for use as a micro-frontend architecture in large-scale web applications.

## 💡 What is Module Federation?

- Module Federation is a concept that allows developers to share code and resources across multiple JavaScript applications
Expand All @@ -12,46 +26,29 @@

- Module Federation reuses common dependencies between modules as much as possible

[Learn more](https://module-federation.io/)

## 🔥 What does universe offer?

The universe repository provides a set of tools to enhance module federation's capabilities. These include:
## ✨ What new features does Module Federation provide?

- [Module Federation Runtime](https://module-federation.io/guide/basic/runtime.html)
- [Rspack Module Federation](https://module-federation.io/guide/basic/rspack.html)
- [Webpack Module Federation](https://module-federation.io/guide/basic/webpack.html)
- [Next.js Module Federation](https://module-federation.io/guide/framework/nextjs.html)
* 🎨 Module Federation Runtime
* 🧩 Runtime Plugins System
* 📝 Manifest
* 🚀 Dynamic type prompt
* 🛠️ Chrome Devtool

## 📚 Getting Started

To get started with Module Federation, see the [Quick Start](https://module-federation.io/guide/start/quick-start.html).


## 📦 Packages

Some of the underlying dependencies of the past are listed here, and [enhanced](https://module-federation.io/) access is recommended for direct use.

- [Node Module Federation](./packages/node)
- [Storybook addon for Module Federation](./packages/storybook-addon)
- [Native federation typescript](./packages/native-federation-typescript)
- [Utilities](./packages/utilities)

# 🧑‍💻 Community

Come and chat with us on [Discussions](https://github.com/module-federation/universe/discussions)! The Module federation team and users are active there, and we're always looking for contributions.
Come and chat with us on [Discussions](https://github.com/module-federation/universe/discussions) or [Discord](https://discord.gg/n69NnT3ACV)! The Module federation team and users are active there, and we're always looking for contributions.

# 🤝 Contribution

> New contributors welcome!
Please read the [Contributing Guide](https://github.com/module-federation/universe/blob/main/CONTRIBUTING.md).

# Credits

Thanks to:

- The [vite-plugin-federation](https://github.com/originjs/vite-plugin-federation) project created by [@ruleeeer](https://github.com/ruleeeer), `@module-federation/runtime` fork `vite-plugin-federation` semver logic used to verify version
Please read the [Contributing Guide](https://github.com/module-federation/core/blob/main/CONTRIBUTING.md).

# 🙌 Code of Conduct

Expand Down
14 changes: 7 additions & 7 deletions apps/docs/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ Before you begin, make sure you have the following installed on your machine:
- nx
- yarn
You also need a GitHub account and a fork of the https://github.com/module-federation/universe[module-federation/universe] repository.
You also need a GitHub account and a fork of the https://github.com/module-federation/core[module-federation/core] repository.

## Setting up your environment

Documentation website consists of 2 applications:

- `docs-ui` holds the visual part of the documentation website. When serving\building the docs app, docs-ui will be prebuilt as its dependency.
- `docs` is the one that is meant to contain all the actual documentation.
- `docs` is the one that is meant to contain all the actual documentation.
To set up your environment, follow these steps:

1. Clone your fork of the module-federation/universe repository to your local machine.
1. Clone your fork of the module-federation/core repository to your local machine.
2. Navigate to the `apps/docs` folder inside the cloned repository.
3. Run `npm install` to install the dependencies.
4. By default, serving\building will pull the changes from the `main` branch. To use it, run `nx run docs:serve`. Along with it there's a `local` configuration, that provides an ability to rely on the files within the filesystem. Can be used by running `nx run docs:serve:local`
Expand All @@ -44,20 +44,20 @@ To make changes to the documentation, follow these steps:
## Submitting pull requests

Once you are happy with your changes, you can submit a pull request to the module-federation/universe repository. A pull request is a way of proposing your changes to be merged into the main branch of the repository.
Once you are happy with your changes, you can submit a pull request to the module-federation/core repository. A pull request is a way of proposing your changes to be merged into the main branch of the repository.

To submit a pull request, follow these steps:

1. Commit your changes to your local branch using `git commit -m "your message"`.
2. Push your changes to your remote fork using `git push origin your-branch`.
3. Go to https://github.com/module-federation/universe and click on "New pull request".
3. Go to https://github.com/module-federation/core and click on "New pull request".
4. Select your fork and branch as the source and the main branch as the destination.
5. Fill in the title and description of your pull request and click on "Create pull request".
Your pull request will be reviewed by the maintainers of the `module-federation/universe` repository as well as by a technical writer who will check your content for accuracy, clarity, and adherence to Google Developers Documentation Style Guide. The technical writer may suggest some changes or improvements to your content before merging it to the main branch. and they will provide feedback or approve it.
Your pull request will be reviewed by the maintainers of the `module-federation/core` repository as well as by a technical writer who will check your content for accuracy, clarity, and adherence to Google Developers Documentation Style Guide. The technical writer may suggest some changes or improvements to your content before merging it to the main branch. and they will provide feedback or approve it.

## Conclusion

That's it! You have successfully contributed to the Module Federation documentation! Thank you for your time and effort!

If you have any questions or issues, feel free to reach out to us on https://github.com/module-federation/universe/discussions[GitHub Discussions]
If you have any questions or issues, feel free to reach out to us on https://github.com/module-federation/core/discussions[GitHub Discussions]
6 changes: 6 additions & 0 deletions apps/modernjs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @module-federation/modernjs

## 0.1.15

### Patch Changes

- @module-federation/enhanced@0.1.10

## 0.1.14

### Patch Changes
Expand Down
1 change: 1 addition & 0 deletions apps/modernjs/modern.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default defineConfig({
include: [
// should set module-federation in outer repo
/universe\/packages/,
/core\/packages/,
],
},
// source: {
Expand Down
2 changes: 1 addition & 1 deletion apps/modernjs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@module-federation/modernjs",
"private": true,
"version": "0.1.14",
"version": "0.1.15",
"scripts": {
"reset": "npx rimraf ./**/node_modules",
"dev": "modern dev",
Expand Down
6 changes: 6 additions & 0 deletions apps/website-new/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# website-new

## 1.0.3

### Patch Changes

- 60ac566: fix imports for node plugin in docs

## 1.0.2

### Patch Changes
Expand Down
19 changes: 12 additions & 7 deletions apps/website-new/docs/en/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"link": "/guide/start/",
"activeMatch": "/guide/"
},
{
"text": "Practice",
"link": "/practice/overview",
"activeMatch": "/practice/"
},
{
"text": "Configuration",
"link": "/configure/",
Expand All @@ -15,14 +20,14 @@
"activeMatch": "/plugin/"
},
{
"text": "Community",
"link": "/community/showcase",
"activeMatch": "/community/",
"text": "Showcase",
"link": "/showcase/index",
"activeMatch": "/showcase/"
},
{
"text": "Ecosystem",
"activeMatch": "/ecosystem/",
"items": [
{
"text": "Showcase",
"link": "/community/showcase/"
},
{
"text": "Module Federation Examples",
"link": "https://github.com/module-federation/module-federation-examples"
Expand Down
1 change: 1 addition & 0 deletions apps/website-new/docs/en/blog/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[ "announcement"]
Loading

0 comments on commit 129eeb5

Please sign in to comment.