@mmapp/react-compiler 0.1.0-alpha.7 → 0.1.0-alpha.9
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/dist/auth-3UK75242.mjs +17 -0
- package/dist/babel/index.d.mts +2 -2
- package/dist/babel/index.d.ts +2 -2
- package/dist/babel/index.js +27 -31
- package/dist/babel/index.mjs +1 -1
- package/dist/chunk-7T6Q5KAA.mjs +7506 -0
- package/dist/chunk-ABYPKRSB.mjs +215 -0
- package/dist/chunk-BZEXUPDH.mjs +175 -0
- package/dist/chunk-J3M4GUS7.mjs +161 -0
- package/dist/chunk-JRGFBWTN.mjs +2918 -0
- package/dist/chunk-R2DD5GTY.mjs +186 -0
- package/dist/chunk-UDDTWG5J.mjs +734 -0
- package/dist/chunk-VLTKQDJ3.mjs +244 -0
- package/dist/chunk-WVYY32LD.mjs +939 -0
- package/dist/chunk-XDVM4YHX.mjs +3450 -0
- package/dist/cli/index.js +4372 -3240
- package/dist/cli/index.mjs +77 -179
- package/dist/codemod/cli.js +1 -1
- package/dist/codemod/cli.mjs +1 -1
- package/dist/codemod/index.d.mts +3 -3
- package/dist/codemod/index.d.ts +3 -3
- package/dist/codemod/index.js +1 -1
- package/dist/codemod/index.mjs +1 -1
- package/dist/deploy-YAJGW6II.mjs +9 -0
- package/dist/dev-server-CrQ041KP.d.mts +79 -0
- package/dist/dev-server-CrQ041KP.d.ts +79 -0
- package/dist/dev-server.d.mts +2 -2
- package/dist/dev-server.d.ts +2 -2
- package/dist/dev-server.js +1240 -120
- package/dist/dev-server.mjs +4 -4
- package/dist/envelope-ChEkuHij.d.mts +265 -0
- package/dist/envelope-ChEkuHij.d.ts +265 -0
- package/dist/envelope.d.mts +2 -2
- package/dist/envelope.d.ts +2 -2
- package/dist/envelope.js +27 -31
- package/dist/envelope.mjs +2 -2
- package/dist/index-CEKyyazf.d.mts +104 -0
- package/dist/index-CEKyyazf.d.ts +104 -0
- package/dist/index.d.mts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +1512 -600
- package/dist/index.mjs +8 -8
- package/dist/init-7FJENUDK.mjs +407 -0
- package/dist/project-compiler-ZB4RUYVL.mjs +10 -0
- package/dist/project-decompiler-U55HQUHW.mjs +7 -0
- package/dist/pull-KOL2QAYQ.mjs +109 -0
- package/dist/seed-KOGEPGOJ.mjs +154 -0
- package/dist/server-VW6UPCHO.mjs +277 -0
- package/dist/testing/index.d.mts +8 -8
- package/dist/testing/index.d.ts +8 -8
- package/dist/testing/index.js +27 -31
- package/dist/testing/index.mjs +1 -1
- package/dist/verify-OQDEQYMS.mjs +1833 -0
- package/dist/vite/index.d.mts +1 -1
- package/dist/vite/index.d.ts +1 -1
- package/dist/vite/index.js +27 -31
- package/dist/vite/index.mjs +2 -2
- package/examples/authentication/main.workflow.tsx +1 -1
- package/examples/authentication/mm.config.ts +1 -1
- package/examples/authentication/pages/LoginPage.tsx +2 -2
- package/examples/authentication/pages/SignupPage.tsx +2 -2
- package/examples/counter.workflow.tsx +1 -1
- package/examples/dashboard.workflow.tsx +1 -1
- package/examples/invoice-approval/actions/invoice.server.ts +1 -1
- package/examples/invoice-approval/main.workflow.tsx +1 -1
- package/examples/invoice-approval/mm.config.ts +1 -1
- package/examples/invoice-approval/pages/InvoiceDetailPage.tsx +1 -1
- package/examples/invoice-approval/pages/InvoiceFormPage.tsx +1 -1
- package/examples/invoice-approval/pages/InvoiceListPage.tsx +1 -1
- package/examples/todo-app.workflow.tsx +1 -1
- package/examples/uber-app/actions/matching.server.ts +1 -1
- package/examples/uber-app/actions/notifications.server.ts +1 -1
- package/examples/uber-app/actions/payments.server.ts +1 -1
- package/examples/uber-app/actions/pricing.server.ts +1 -1
- package/examples/uber-app/app/admin/analytics.tsx +2 -2
- package/examples/uber-app/app/admin/fleet.tsx +2 -2
- package/examples/uber-app/app/admin/surge-pricing.tsx +2 -2
- package/examples/uber-app/app/driver/dashboard.tsx +2 -2
- package/examples/uber-app/app/driver/earnings.tsx +2 -2
- package/examples/uber-app/app/driver/navigation.tsx +2 -2
- package/examples/uber-app/app/driver/ride-acceptance.tsx +2 -2
- package/examples/uber-app/app/rider/home.tsx +2 -2
- package/examples/uber-app/app/rider/payment-methods.tsx +2 -2
- package/examples/uber-app/app/rider/ride-history.tsx +2 -2
- package/examples/uber-app/app/rider/ride-tracking.tsx +2 -2
- package/examples/uber-app/components/DriverCard.tsx +1 -1
- package/examples/uber-app/components/MapView.tsx +3 -3
- package/examples/uber-app/components/RatingStars.tsx +2 -2
- package/examples/uber-app/components/RideCard.tsx +1 -1
- package/examples/uber-app/mm.config.ts +1 -1
- package/examples/uber-app/workflows/dispute-resolution.workflow.tsx +2 -2
- package/examples/uber-app/workflows/driver-onboarding.workflow.tsx +2 -2
- package/examples/uber-app/workflows/payment-processing.workflow.tsx +2 -2
- package/examples/uber-app/workflows/ride-request.workflow.tsx +2 -2
- package/package.json +7 -14
package/dist/testing/index.js
CHANGED
|
@@ -4237,7 +4237,7 @@ function extractImperativeWorkflow(path, state) {
|
|
|
4237
4237
|
const source = node.source.value;
|
|
4238
4238
|
for (const spec of node.specifiers) {
|
|
4239
4239
|
const localName = spec.local.name;
|
|
4240
|
-
if (source.includes("@mmapp/react") || source.includes("@
|
|
4240
|
+
if (source.includes("@mmapp/react") || source.includes("@mmapp/react")) {
|
|
4241
4241
|
stdLibImports.add(localName);
|
|
4242
4242
|
} else {
|
|
4243
4243
|
importedFns.set(localName, source);
|
|
@@ -6007,12 +6007,8 @@ function extractStaticObj(obj) {
|
|
|
6007
6007
|
return result;
|
|
6008
6008
|
}
|
|
6009
6009
|
|
|
6010
|
-
//
|
|
6011
|
-
|
|
6012
|
-
const uniqueTags = [...new Set(tags.filter((t22) => t22 !== primary))];
|
|
6013
|
-
uniqueTags.sort();
|
|
6014
|
-
return [primary, ...uniqueTags];
|
|
6015
|
-
}
|
|
6010
|
+
// src/babel/emitters/pure-form-emitter.ts
|
|
6011
|
+
var import_player_core = require("@mmapp/player-core");
|
|
6016
6012
|
|
|
6017
6013
|
// src/babel/emitters/experience-transform.ts
|
|
6018
6014
|
function transformToFrontend(node) {
|
|
@@ -6405,7 +6401,7 @@ function liftAction(action) {
|
|
|
6405
6401
|
}
|
|
6406
6402
|
return {
|
|
6407
6403
|
slug: action.id,
|
|
6408
|
-
category: normalizeCategory("expression", "mutation", action.type),
|
|
6404
|
+
category: (0, import_player_core.normalizeCategory)("expression", "mutation", action.type),
|
|
6409
6405
|
parts: parts.length > 0 ? parts : void 0
|
|
6410
6406
|
};
|
|
6411
6407
|
}
|
|
@@ -6435,7 +6431,7 @@ function liftSchedule(during) {
|
|
|
6435
6431
|
for (const action of during.actions) {
|
|
6436
6432
|
parts.push({
|
|
6437
6433
|
slug: "do",
|
|
6438
|
-
category: normalizeCategory("expression", "mutation", action.type),
|
|
6434
|
+
category: (0, import_player_core.normalizeCategory)("expression", "mutation", action.type),
|
|
6439
6435
|
parts: Object.entries(action.config || {}).map(([key, value]) => ({
|
|
6440
6436
|
slug: key,
|
|
6441
6437
|
category: ["atom"],
|
|
@@ -6445,7 +6441,7 @@ function liftSchedule(during) {
|
|
|
6445
6441
|
}
|
|
6446
6442
|
return {
|
|
6447
6443
|
slug: during.id,
|
|
6448
|
-
category: normalizeCategory("schedule", during.type),
|
|
6444
|
+
category: (0, import_player_core.normalizeCategory)("schedule", during.type),
|
|
6449
6445
|
parts
|
|
6450
6446
|
};
|
|
6451
6447
|
}
|
|
@@ -6458,14 +6454,14 @@ function liftState(state) {
|
|
|
6458
6454
|
if (state.on_enter && state.on_enter.length > 0) {
|
|
6459
6455
|
parts.push({
|
|
6460
6456
|
slug: "on_enter",
|
|
6461
|
-
category: normalizeCategory("expression", "sequence"),
|
|
6457
|
+
category: (0, import_player_core.normalizeCategory)("expression", "sequence"),
|
|
6462
6458
|
parts: state.on_enter.map(liftAction)
|
|
6463
6459
|
});
|
|
6464
6460
|
}
|
|
6465
6461
|
if (state.on_exit && state.on_exit.length > 0) {
|
|
6466
6462
|
parts.push({
|
|
6467
6463
|
slug: "on_exit",
|
|
6468
|
-
category: normalizeCategory("expression", "sequence"),
|
|
6464
|
+
category: (0, import_player_core.normalizeCategory)("expression", "sequence"),
|
|
6469
6465
|
parts: state.on_exit.map(liftAction)
|
|
6470
6466
|
});
|
|
6471
6467
|
}
|
|
@@ -6476,7 +6472,7 @@ function liftState(state) {
|
|
|
6476
6472
|
}
|
|
6477
6473
|
return {
|
|
6478
6474
|
slug: state.name,
|
|
6479
|
-
category: normalizeCategory("state", ...tags),
|
|
6475
|
+
category: (0, import_player_core.normalizeCategory)("state", ...tags),
|
|
6480
6476
|
parts: parts.length > 0 ? parts : void 0
|
|
6481
6477
|
};
|
|
6482
6478
|
}
|
|
@@ -6499,17 +6495,17 @@ function liftTransition(transition) {
|
|
|
6499
6495
|
if (transition.actions && transition.actions.length > 0) {
|
|
6500
6496
|
parts.push({
|
|
6501
6497
|
slug: "actions",
|
|
6502
|
-
category: normalizeCategory("expression", "sequence"),
|
|
6498
|
+
category: (0, import_player_core.normalizeCategory)("expression", "sequence"),
|
|
6503
6499
|
parts: transition.actions.map(liftAction)
|
|
6504
6500
|
});
|
|
6505
6501
|
}
|
|
6506
6502
|
if (transition.conditions && transition.conditions.length > 0) {
|
|
6507
6503
|
parts.push({
|
|
6508
6504
|
slug: "conditions",
|
|
6509
|
-
category: normalizeCategory("expression", "guard"),
|
|
6505
|
+
category: (0, import_player_core.normalizeCategory)("expression", "guard"),
|
|
6510
6506
|
parts: transition.conditions.map((c, i) => ({
|
|
6511
6507
|
slug: `condition_${i}`,
|
|
6512
|
-
category: normalizeCategory("expression", c.type || "condition"),
|
|
6508
|
+
category: (0, import_player_core.normalizeCategory)("expression", c.type || "condition"),
|
|
6513
6509
|
parts: c.expression ? [{ slug: c.expression, category: ["binding"] }] : void 0
|
|
6514
6510
|
}))
|
|
6515
6511
|
});
|
|
@@ -6548,7 +6544,7 @@ function liftField(field) {
|
|
|
6548
6544
|
}
|
|
6549
6545
|
return {
|
|
6550
6546
|
slug: field.name,
|
|
6551
|
-
category: normalizeCategory("field", field.type),
|
|
6547
|
+
category: (0, import_player_core.normalizeCategory)("field", field.type),
|
|
6552
6548
|
parts: parts.length > 0 ? parts : void 0
|
|
6553
6549
|
};
|
|
6554
6550
|
}
|
|
@@ -6571,20 +6567,20 @@ function liftView(node) {
|
|
|
6571
6567
|
if (match) {
|
|
6572
6568
|
parts.push({
|
|
6573
6569
|
slug: key,
|
|
6574
|
-
category: normalizeCategory("expression", "effect", "transition"),
|
|
6570
|
+
category: (0, import_player_core.normalizeCategory)("expression", "effect", "transition"),
|
|
6575
6571
|
parts: [{ slug: match[1], category: ["ref"] }]
|
|
6576
6572
|
});
|
|
6577
6573
|
} else {
|
|
6578
6574
|
parts.push({
|
|
6579
6575
|
slug: key,
|
|
6580
|
-
category: normalizeCategory("expression", "binding"),
|
|
6576
|
+
category: (0, import_player_core.normalizeCategory)("expression", "binding"),
|
|
6581
6577
|
parts: [{ slug: String(expr), category: ["binding"] }]
|
|
6582
6578
|
});
|
|
6583
6579
|
}
|
|
6584
6580
|
} else {
|
|
6585
6581
|
parts.push({
|
|
6586
6582
|
slug: key,
|
|
6587
|
-
category: normalizeCategory("expression", "binding"),
|
|
6583
|
+
category: (0, import_player_core.normalizeCategory)("expression", "binding"),
|
|
6588
6584
|
parts: [{ slug: String(expr), category: ["binding"] }]
|
|
6589
6585
|
});
|
|
6590
6586
|
}
|
|
@@ -6595,20 +6591,20 @@ function liftView(node) {
|
|
|
6595
6591
|
if (eqMatch) {
|
|
6596
6592
|
parts.push({
|
|
6597
6593
|
slug: "visible_when",
|
|
6598
|
-
category: normalizeCategory("expression", "guard"),
|
|
6594
|
+
category: (0, import_player_core.normalizeCategory)("expression", "guard"),
|
|
6599
6595
|
parts: [{
|
|
6600
6596
|
slug: "body",
|
|
6601
|
-
category: normalizeCategory("expression", "eq"),
|
|
6597
|
+
category: (0, import_player_core.normalizeCategory)("expression", "eq"),
|
|
6602
6598
|
parts: [
|
|
6603
|
-
{ slug: "lhs", category: normalizeCategory("expression", "path"), parts: [{ slug: eqMatch[1], category: ["binding"] }] },
|
|
6604
|
-
{ slug: "rhs", category: normalizeCategory("expression", "literal"), parts: [{ slug: eqMatch[2], category: ["literal"] }] }
|
|
6599
|
+
{ slug: "lhs", category: (0, import_player_core.normalizeCategory)("expression", "path"), parts: [{ slug: eqMatch[1], category: ["binding"] }] },
|
|
6600
|
+
{ slug: "rhs", category: (0, import_player_core.normalizeCategory)("expression", "literal"), parts: [{ slug: eqMatch[2], category: ["literal"] }] }
|
|
6605
6601
|
]
|
|
6606
6602
|
}]
|
|
6607
6603
|
});
|
|
6608
6604
|
} else {
|
|
6609
6605
|
parts.push({
|
|
6610
6606
|
slug: "visible_when",
|
|
6611
|
-
category: normalizeCategory("expression", "guard"),
|
|
6607
|
+
category: (0, import_player_core.normalizeCategory)("expression", "guard"),
|
|
6612
6608
|
parts: [{ slug: node.visible_when, category: ["binding"] }]
|
|
6613
6609
|
});
|
|
6614
6610
|
}
|
|
@@ -6620,7 +6616,7 @@ function liftView(node) {
|
|
|
6620
6616
|
}
|
|
6621
6617
|
return {
|
|
6622
6618
|
slug: node.id,
|
|
6623
|
-
category: normalizeCategory("view", componentTag),
|
|
6619
|
+
category: (0, import_player_core.normalizeCategory)("view", componentTag),
|
|
6624
6620
|
parts: parts.length > 0 ? parts : void 0
|
|
6625
6621
|
};
|
|
6626
6622
|
}
|
|
@@ -6641,7 +6637,7 @@ function emitCanonical(extracted, sourceFilename) {
|
|
|
6641
6637
|
}
|
|
6642
6638
|
parts.push({
|
|
6643
6639
|
slug: "manifest",
|
|
6644
|
-
category: normalizeCategory("meta", "manifest"),
|
|
6640
|
+
category: (0, import_player_core.normalizeCategory)("meta", "manifest"),
|
|
6645
6641
|
parts: [
|
|
6646
6642
|
{
|
|
6647
6643
|
slug: "workflows",
|
|
@@ -6662,7 +6658,7 @@ function emitCanonical(extracted, sourceFilename) {
|
|
|
6662
6658
|
let categoryArray;
|
|
6663
6659
|
if (category.includes("/")) {
|
|
6664
6660
|
const [primary, ...tags] = category.split("/");
|
|
6665
|
-
categoryArray = normalizeCategory(primary, ...tags);
|
|
6661
|
+
categoryArray = (0, import_player_core.normalizeCategory)(primary, ...tags);
|
|
6666
6662
|
} else {
|
|
6667
6663
|
categoryArray = [category];
|
|
6668
6664
|
}
|
|
@@ -7186,7 +7182,7 @@ function createVisitor(options = {}) {
|
|
|
7186
7182
|
if (mode === "strict" && STRICT_BANNED_HOOKS[hookName]) {
|
|
7187
7183
|
const error = {
|
|
7188
7184
|
code: STRICT_BANNED_HOOKS[hookName],
|
|
7189
|
-
message: `${hookName}() is not allowed in strict mode. Use @
|
|
7185
|
+
message: `${hookName}() is not allowed in strict mode. Use @mmapp/react effect hooks instead.`,
|
|
7190
7186
|
line: path.node.loc?.start.line,
|
|
7191
7187
|
column: path.node.loc?.start.column,
|
|
7192
7188
|
severity: "error"
|
|
@@ -7278,12 +7274,12 @@ function createVisitor(options = {}) {
|
|
|
7278
7274
|
}
|
|
7279
7275
|
}
|
|
7280
7276
|
if (mode !== "strict") return;
|
|
7281
|
-
if (source.startsWith("@
|
|
7277
|
+
if (source.startsWith("@mmapp/") || source.startsWith("@mmapp/") || source === "react" || source.startsWith("react/") || source.startsWith(".") || source.startsWith("/")) {
|
|
7282
7278
|
return;
|
|
7283
7279
|
}
|
|
7284
7280
|
const error = {
|
|
7285
7281
|
code: "STRICT_FORBIDDEN_IMPORT",
|
|
7286
|
-
message: `Import from '${source}' is not allowed in strict mode. Only @
|
|
7282
|
+
message: `Import from '${source}' is not allowed in strict mode. Only @mmapp/* and relative imports are permitted.`,
|
|
7287
7283
|
line: path.node.loc?.start.line,
|
|
7288
7284
|
column: path.node.loc?.start.column,
|
|
7289
7285
|
severity: "error"
|