mfeflow 0.2.0 → 0.4.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.
Files changed (76) hide show
  1. package/README.md +17 -14
  2. package/assets/features/analytics-clarity/feature.json +64 -0
  3. package/assets/features/analytics-clarity/files/clarity-test.ts +36 -0
  4. package/assets/features/analytics-clarity/files/clarity.ts +26 -0
  5. package/assets/features/analytics-gtm/files/init.ts +2 -2
  6. package/assets/features/commit-prompt/feature.json +27 -0
  7. package/assets/features/commit-prompt/files/cz.config.js +27 -0
  8. package/assets/features/data-react-query/feature.json +89 -0
  9. package/assets/features/data-react-query/files/keys.ts.eta +8 -0
  10. package/assets/features/data-react-query/files/remote-Query-test.tsx.eta +39 -0
  11. package/assets/features/data-react-query/files/remote-Query.tsx +15 -0
  12. package/assets/features/data-react-query/files/shell-Query-test.tsx +21 -0
  13. package/assets/features/data-react-query/files/shell-Query.tsx +14 -0
  14. package/assets/features/data-react-query/files/useHealth.fetch.ts.eta +15 -0
  15. package/assets/features/data-react-query/files/useHealth.http.ts.eta +11 -0
  16. package/assets/features/env-t3/feature.json +21 -0
  17. package/assets/features/forms/feature.json +90 -0
  18. package/assets/features/forms/files/ContactForm-test.tsx +35 -0
  19. package/assets/features/forms/files/ContactForm.tsx +50 -0
  20. package/assets/features/forms/files/schema.arktype.ts +9 -0
  21. package/assets/features/forms/files/schema.valibot.ts +9 -0
  22. package/assets/features/forms/files/schema.zod.ts +9 -0
  23. package/assets/features/i18n/feature.json +139 -0
  24. package/assets/features/i18n/files/LanguageSwitcher.tsx +28 -0
  25. package/assets/features/i18n/files/Languages.tsx +12 -0
  26. package/assets/features/i18n/files/language-switcher-test.tsx +19 -0
  27. package/assets/features/i18n/files/remote-I18n-test.tsx.eta +43 -0
  28. package/assets/features/i18n/files/remote-I18n.tsx.eta +36 -0
  29. package/assets/features/i18n/files/remote-ar.json.eta +3 -0
  30. package/assets/features/i18n/files/remote-config.ts +9 -0
  31. package/assets/features/i18n/files/remote-en.json.eta +3 -0
  32. package/assets/features/i18n/files/remote-load.ts +4 -0
  33. package/assets/features/i18n/files/shell-config.ts +20 -0
  34. package/assets/features/i18n/files/shell-init-test.ts +32 -0
  35. package/assets/features/i18n/files/shell-init.ts +7 -0
  36. package/assets/features/lint-oxlint/files/oxlintrc.json +1 -1
  37. package/assets/features/lint-oxlint/files/prettierignore +1 -0
  38. package/assets/features/storybook/feature.json +119 -0
  39. package/assets/features/storybook/files/App.stories.tsx.eta +8 -0
  40. package/assets/features/storybook/files/Home.stories.tsx +9 -0
  41. package/assets/features/storybook/files/button.stories.tsx +14 -0
  42. package/assets/features/storybook/files/remote-main.ts +13 -0
  43. package/assets/features/storybook/files/rsbuild.config.ts +10 -0
  44. package/assets/features/storybook/files/shell-main.ts +39 -0
  45. package/assets/features/tailwind/feature.json +87 -0
  46. package/assets/features/tailwind/files/Scope-test.tsx.eta +17 -0
  47. package/assets/features/tailwind/files/Scope.tsx.eta +15 -0
  48. package/assets/features/tailwind/files/postcss.config.mjs +1 -0
  49. package/assets/features/tailwind/files/remote-styles.css.eta +21 -0
  50. package/assets/features/tailwind/files/shell-styles.css.eta +22 -0
  51. package/assets/features/testing/files/vitest.config.ts +11 -2
  52. package/assets/features/theming/feature.json +103 -0
  53. package/assets/features/theming/files/Theme.tsx +15 -0
  54. package/assets/features/theming/files/ThemeToggle.tsx +23 -0
  55. package/assets/features/theming/files/apply-stored-test.ts +37 -0
  56. package/assets/features/theming/files/apply-stored.ts +13 -0
  57. package/assets/features/theming/files/head-script.ts +8 -0
  58. package/assets/features/theming/files/theme-toggle-test.tsx +18 -0
  59. package/assets/features/theming/files/theme.css +14 -0
  60. package/assets/features/theming/files/themes.ts +30 -0
  61. package/assets/features/theming/files/tokens-test.ts +9 -0
  62. package/assets/features/theming/files/tokens.ts +9 -0
  63. package/assets/features/ui-shadcn/feature.json +61 -0
  64. package/assets/features/ui-shadcn/files/button-test.tsx.eta +32 -0
  65. package/assets/features/ui-shadcn/files/button.tsx.eta +36 -0
  66. package/assets/features/ui-shadcn/files/components.json.eta +22 -0
  67. package/assets/features/ui-shadcn/files/utils-test.ts.eta +17 -0
  68. package/assets/features/ui-shadcn/files/utils.ts.eta +11 -0
  69. package/assets/templates/monorepo/files/root/gitignore.eta +1 -0
  70. package/assets/templates/monorepo/files/root/pnpm-workspace.yaml.eta +3 -1
  71. package/dist/commands/features.d.ts +2 -2
  72. package/dist/commands/registry.d.ts +52 -0
  73. package/dist/index.d.ts +1 -1
  74. package/dist/index.js +368 -33
  75. package/dist/output.d.ts +43 -1
  76. package/package.json +4 -4
package/dist/output.d.ts CHANGED
@@ -57,6 +57,9 @@ export interface AddResult extends WriteReport {
57
57
  skipped: string[];
58
58
  }
59
59
  export interface FeatureInfo {
60
+ /** `mfeflow` for the features that ship with the CLI, otherwise the registry's namespace, like `@test`. */
61
+ source: string;
62
+ /** What you pass to `mfeflow add`: `lint-oxlint`, or `@test/hello` for a registry's. */
60
63
  name: string;
61
64
  version: string;
62
65
  description: string;
@@ -64,11 +67,50 @@ export interface FeatureInfo {
64
67
  default: boolean;
65
68
  installed: boolean;
66
69
  }
70
+ export interface RegistryStatus {
71
+ namespace: string;
72
+ /** The index.json asked for. */
73
+ index: string;
74
+ /** How many items it lists. */
75
+ items: number;
76
+ /** Why it could not be read; the other registries are listed regardless. */
77
+ error: ErrorReport | null;
78
+ }
67
79
  export interface FeaturesResult {
68
80
  ok: true;
69
81
  command: 'features';
70
82
  search: string | null;
71
83
  features: FeatureInfo[];
84
+ registries: RegistryStatus[];
85
+ }
86
+ export interface RegistryEntryInfo {
87
+ namespace: string;
88
+ /** The URL template from mfeflow.json. */
89
+ url: string;
90
+ /** Where its index.json is. */
91
+ index: string;
92
+ }
93
+ export interface RegistryResult {
94
+ ok: true;
95
+ command: 'registry';
96
+ action: 'add' | 'remove' | 'list' | 'build';
97
+ dryRun: boolean;
98
+ /** The project folder; null for `build`, which needs none. */
99
+ root: string | null;
100
+ /** Whether mfeflow.json changed (or would have, for a dry run). */
101
+ changed: boolean;
102
+ /** The registries of the project after the action. */
103
+ registries: RegistryEntryInfo[];
104
+ build: {
105
+ namespace: string;
106
+ out: string;
107
+ features: {
108
+ name: string;
109
+ version: string;
110
+ }[];
111
+ /** Relative to `out`. */
112
+ files: string[];
113
+ } | null;
72
114
  }
73
115
  /** What `doctor`, `validate` and `check-compat` print with `--json`. `ok` is false when any finding is an error. */
74
116
  export interface ReportResult {
@@ -147,7 +189,7 @@ export interface FailureResult {
147
189
  error: ErrorReport;
148
190
  exitCode: number;
149
191
  }
150
- export type CliResult = InitResult | AddResult | FeaturesResult | ReportResult | BudgetResult | DevResult | FailureResult;
192
+ export type CliResult = InitResult | AddResult | FeaturesResult | RegistryResult | ReportResult | BudgetResult | DevResult | FailureResult;
151
193
  /** The plan as plain data for `--json`, without file contents. Features are listed once. */
152
194
  export declare function planReport(plan: Plan): PlanReport;
153
195
  /** Checks a document the CLI printed with `--json`. Returns the problems; empty means valid. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mfeflow",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Create and grow a React micro-frontend platform: mfeflow init, add remote, add <feature>.",
5
5
  "keywords": [
6
6
  "micro-frontend",
@@ -49,14 +49,14 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@clack/prompts": "1.8.1",
52
- "@mfeflow/contracts": "0.2.0",
53
- "@mfeflow/core": "0.2.0",
52
+ "@mfeflow/contracts": "0.4.0",
53
+ "@mfeflow/core": "0.4.0",
54
54
  "citty": "0.2.2",
55
55
  "semver": "7.8.5",
56
56
  "yaml": "2.9.1"
57
57
  },
58
58
  "devDependencies": {
59
- "@mfeflow/rsbuild": "0.2.0",
59
+ "@mfeflow/rsbuild": "0.4.0",
60
60
  "@rslib/core": "1.0.5",
61
61
  "@types/node": "26.6.6",
62
62
  "@types/semver": "7.8.0",