Skip to content

Commit

Permalink
Feature/custom site config root (#4)
Browse files Browse the repository at this point in the history
* feat(builder): support customize projectRoot for finding site.config

* feat: update version 0.3.2
  • Loading branch information
PaynterChen authored Mar 20, 2024
1 parent 55d3286 commit 549aa8a
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useWorkspaces": true,
"version": "0.3.1",
"version": "0.3.2",
"changelog": true,
"changelogPreset": {
"name": "conventionalcommits",
Expand Down
4 changes: 2 additions & 2 deletions packages/builder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ringcentral/mfe-builder",
"version": "0.3.1",
"version": "0.3.2",
"description": "A micro frontends framework for building Web applications",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down Expand Up @@ -44,7 +44,7 @@
"webpack": "^5.75.0"
},
"dependencies": {
"@ringcentral/mfe-shared": "^0.3.1",
"@ringcentral/mfe-shared": "^0.3.2",
"yargs": "17.6.2"
}
}
2 changes: 1 addition & 1 deletion packages/builder/src/getConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const DEFAULT_REMOTE_ENTRY = 'remoteEntry.js';

export const getSiteConfig = ({ overrides = {} }: Options = {}): SiteConfig => {
// TODO: implement more config options
const rootPath = process.cwd();
const rootPath = overrides.projectRoot || process.cwd();
try {
const configFile = path.join(rootPath, 'site.config');
const rawConfig: SiteConfigFile = require(configFile);
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ringcentral/mfe-cli",
"version": "0.3.1",
"version": "0.3.2",
"description": "A micro frontends framework for building Web applications",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down Expand Up @@ -31,7 +31,7 @@
"@types/node-fetch": "2.6.3"
},
"dependencies": {
"@ringcentral/mfe-shared": "^0.3.1",
"@ringcentral/mfe-shared": "^0.3.2",
"commander": "10.0.1",
"fs-extra": "11.1.1",
"node-fetch": "^2.6.9",
Expand Down
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ringcentral/mfe-core",
"version": "0.3.1",
"version": "0.3.2",
"description": "A micro frontends framework for building Web applications",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand All @@ -25,8 +25,8 @@
"@ringcentral/mfe-shared": "^0.1.0"
},
"dependencies": {
"@ringcentral/mfe-shared": "^0.3.1",
"@ringcentral/mfe-transport": "^0.3.1"
"@ringcentral/mfe-shared": "^0.3.2",
"@ringcentral/mfe-transport": "^0.3.2"
},
"bugs": {
"url": "https://github.com/ringcentral/ringcentral-mfe/issues"
Expand Down
4 changes: 2 additions & 2 deletions packages/logger/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ringcentral/mfe-logger",
"version": "0.3.1",
"version": "0.3.2",
"description": "A micro frontends framework for building Web applications",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand All @@ -25,7 +25,7 @@
"@ringcentral/mfe-shared": "^0.1.0"
},
"dependencies": {
"@ringcentral/mfe-shared": "^0.3.1",
"@ringcentral/mfe-shared": "^0.3.2",
"@roarr/browser-log-writer": "1.3.0",
"dexie": "3.2.4",
"file-saver": "2.0.5",
Expand Down
4 changes: 2 additions & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ringcentral/mfe-react",
"version": "0.3.1",
"version": "0.3.2",
"description": "A micro frontends framework for building Web applications",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down Expand Up @@ -39,7 +39,7 @@
"react": "^17.0.2"
},
"dependencies": {
"@ringcentral/mfe-core": "^0.3.1"
"@ringcentral/mfe-core": "^0.3.2"
},
"devDependencies": {
"@testing-library/react": "^12.1.5",
Expand Down
4 changes: 2 additions & 2 deletions packages/sentry/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ringcentral/mfe-sentry",
"version": "0.3.1",
"version": "0.3.2",
"description": "A micro frontends framework for building Web applications",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down Expand Up @@ -39,7 +39,7 @@
"@ringcentral/mfe-shared": "^0.1.0"
},
"dependencies": {
"@ringcentral/mfe-shared": "^0.3.1",
"@ringcentral/mfe-shared": "^0.3.2",
"@sentry/browser": "^7.99.0",
"@sentry/tracing": "^7.99.0"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/service-worker/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ringcentral/mfe-service-worker",
"version": "0.3.1",
"version": "0.3.2",
"description": "A micro frontends framework for building Web applications",
"main": "index.js",
"module": "index.mjs",
Expand Down Expand Up @@ -46,7 +46,7 @@
"webpack": "^5.75.0"
},
"dependencies": {
"@ringcentral/mfe-shared": "^0.3.1",
"@ringcentral/mfe-shared": "^0.3.2",
"crypto": "^1.0.1",
"ts-md5": "1.3.1",
"workbox-window": "6.5.4"
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ringcentral/mfe-shared",
"version": "0.3.1",
"version": "0.3.2",
"description": "A micro frontends framework for building Web applications",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
5 changes: 5 additions & 0 deletions packages/shared/src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ export interface SiteOverridableConfig {
* The default value is 1000.
*/
retryDelay?: number;
/**
* Customize the projectRoot, which is used to resolve the absolute path of the site.config.
* The default value is the current working directory (process.cwd())
*/
projectRoot?: string;
}

export interface SiteConfig
Expand Down
4 changes: 2 additions & 2 deletions packages/transport/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ringcentral/mfe-transport",
"version": "0.3.1",
"version": "0.3.2",
"description": "A micro frontends framework for building Web applications",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down Expand Up @@ -39,7 +39,7 @@
"data-transport": "^4.3.5"
},
"dependencies": {
"@ringcentral/mfe-shared": "^0.3.1",
"@ringcentral/mfe-shared": "^0.3.2",
"data-transport": "^4.3.5"
}
}

0 comments on commit 549aa8a

Please sign in to comment.