create-mfeflow 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +14 -2
- package/bin/create-mfeflow.js +4 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +25 -0
- package/dist/version.d.ts +8 -0
- package/package.json +58 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sanjeev Sharma
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# create-mfeflow
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Part of [mfeflow](https://github.com/mfeflow/mfeflow), the React micro-frontend boilerplate and platform kit.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm create mfeflow@latest my-app -- --yes
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
This is `mfeflow init` with the same arguments, so every flag of
|
|
10
|
+
[`mfeflow init`](https://github.com/mfeflow/mfeflow/tree/main/packages/cli#readme) works here
|
|
11
|
+
(`--scope`, `--remotes`, `--features`, `--preset`, `--dry-run`, `--json`, `--local`, ...).
|
|
12
|
+
|
|
13
|
+
Pre-1.0: flags and templates may change in minor versions.
|
|
14
|
+
|
|
15
|
+
MIT licensed.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Runtime } from 'mfeflow';
|
|
2
|
+
/**
|
|
3
|
+
* `npm create mfeflow@latest my-app -- --yes` runs this with `['my-app', '--yes']`.
|
|
4
|
+
* It is `mfeflow init` with the same arguments, so every `init` flag works.
|
|
5
|
+
*/
|
|
6
|
+
export declare function main(argv: readonly string[], runtime?: Runtime): Promise<number>;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { main } from "mfeflow";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
function isPackageJson(value) {
|
|
4
|
+
return 'object' == typeof value && null !== value && 'name' in value && 'version' in value && 'string' == typeof value.name && 'string' == typeof value.version;
|
|
5
|
+
}
|
|
6
|
+
function readPackageJson() {
|
|
7
|
+
const require = createRequire(import.meta.url);
|
|
8
|
+
const pkg = require('../package.json');
|
|
9
|
+
if (!isPackageJson(pkg)) throw new Error('package.json is missing a name or version');
|
|
10
|
+
return pkg;
|
|
11
|
+
}
|
|
12
|
+
async function src_main(argv, runtime) {
|
|
13
|
+
if ('--version' === argv[0] || '-v' === argv[0]) {
|
|
14
|
+
process.stdout.write(`create-mfeflow ${readPackageJson().version}\n`);
|
|
15
|
+
return 0;
|
|
16
|
+
}
|
|
17
|
+
return runtime ? main([
|
|
18
|
+
'init',
|
|
19
|
+
...argv
|
|
20
|
+
], runtime) : main([
|
|
21
|
+
'init',
|
|
22
|
+
...argv
|
|
23
|
+
]);
|
|
24
|
+
}
|
|
25
|
+
export { src_main as main };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface PackageJson {
|
|
2
|
+
name: string;
|
|
3
|
+
version: string;
|
|
4
|
+
}
|
|
5
|
+
/** True when `value` has a string `name` and `version`. */
|
|
6
|
+
export declare function isPackageJson(value: unknown): value is PackageJson;
|
|
7
|
+
/** Name and version from this package's package.json (works from src/ and dist/). */
|
|
8
|
+
export declare function readPackageJson(): PackageJson;
|
package/package.json
CHANGED
|
@@ -1,6 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-mfeflow",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Create a React micro-frontend project with mfeflow: npm create mfeflow@latest.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"micro-frontend",
|
|
7
|
+
"micro-frontends",
|
|
8
|
+
"mfe",
|
|
9
|
+
"module-federation",
|
|
10
|
+
"module-federation-2",
|
|
11
|
+
"react",
|
|
12
|
+
"rsbuild",
|
|
13
|
+
"rspack",
|
|
14
|
+
"cli",
|
|
15
|
+
"scaffolding",
|
|
16
|
+
"boilerplate"
|
|
17
|
+
],
|
|
18
|
+
"homepage": "https://mfeflow.github.io/mfeflow/",
|
|
19
|
+
"bugs": "https://github.com/mfeflow/mfeflow/issues",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/mfeflow/mfeflow.git",
|
|
23
|
+
"directory": "packages/create-mfeflow"
|
|
24
|
+
},
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"author": "Sanjeev Sharma <speedsharma.ai@gmail.com>",
|
|
27
|
+
"type": "module",
|
|
28
|
+
"bin": {
|
|
29
|
+
"create-mfeflow": "./bin/create-mfeflow.js"
|
|
30
|
+
},
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"import": "./dist/index.js",
|
|
35
|
+
"default": "./dist/index.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"bin",
|
|
40
|
+
"dist"
|
|
41
|
+
],
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=22.12"
|
|
44
|
+
},
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public",
|
|
47
|
+
"provenance": true
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"mfeflow": "0.2.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@rslib/core": "1.0.5",
|
|
54
|
+
"@types/node": "26.6.6",
|
|
55
|
+
"typescript": "7.0.2"
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "rslib build",
|
|
59
|
+
"typecheck": "tsc --noEmit"
|
|
60
|
+
}
|
|
6
61
|
}
|