@mmapp/react-compiler 0.1.0-alpha.5 → 0.1.0-alpha.7
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/babel/index.js +27 -23
- package/dist/babel/index.mjs +1 -1
- package/dist/chunk-5FTDWKHH.mjs +244 -0
- package/dist/chunk-7JRAEFRB.mjs +7510 -0
- package/dist/chunk-HRYR54PT.mjs +175 -0
- package/dist/chunk-O4AUS7EU.mjs +148 -0
- package/dist/chunk-Z2G5RZ4H.mjs +186 -0
- package/dist/chunk-ZE3KCHBM.mjs +2918 -0
- package/dist/cli/index.js +62 -24
- package/dist/cli/index.mjs +31 -6
- package/dist/dev-server.js +35 -23
- package/dist/dev-server.mjs +4 -4
- package/dist/envelope.js +27 -23
- package/dist/envelope.mjs +2 -2
- package/dist/index.js +35 -23
- package/dist/index.mjs +6 -6
- package/dist/project-compiler-NNK32MPG.mjs +10 -0
- package/dist/testing/index.js +27 -23
- package/dist/testing/index.mjs +1 -1
- package/dist/verify-BYHUKARQ.mjs +1833 -0
- package/dist/vite/index.js +27 -23
- package/dist/vite/index.mjs +2 -2
- package/package.json +5 -2
package/dist/vite/index.js
CHANGED
|
@@ -5996,8 +5996,12 @@ function extractStaticObj(obj) {
|
|
|
5996
5996
|
return result;
|
|
5997
5997
|
}
|
|
5998
5998
|
|
|
5999
|
-
//
|
|
6000
|
-
|
|
5999
|
+
// ../player-core/dist/index.mjs
|
|
6000
|
+
function normalizeCategory(primary, ...tags) {
|
|
6001
|
+
const uniqueTags = [...new Set(tags.filter((t22) => t22 !== primary))];
|
|
6002
|
+
uniqueTags.sort();
|
|
6003
|
+
return [primary, ...uniqueTags];
|
|
6004
|
+
}
|
|
6001
6005
|
|
|
6002
6006
|
// src/babel/emitters/experience-transform.ts
|
|
6003
6007
|
function transformToFrontend(node) {
|
|
@@ -6390,7 +6394,7 @@ function liftAction(action) {
|
|
|
6390
6394
|
}
|
|
6391
6395
|
return {
|
|
6392
6396
|
slug: action.id,
|
|
6393
|
-
category:
|
|
6397
|
+
category: normalizeCategory("expression", "mutation", action.type),
|
|
6394
6398
|
parts: parts.length > 0 ? parts : void 0
|
|
6395
6399
|
};
|
|
6396
6400
|
}
|
|
@@ -6420,7 +6424,7 @@ function liftSchedule(during) {
|
|
|
6420
6424
|
for (const action of during.actions) {
|
|
6421
6425
|
parts.push({
|
|
6422
6426
|
slug: "do",
|
|
6423
|
-
category:
|
|
6427
|
+
category: normalizeCategory("expression", "mutation", action.type),
|
|
6424
6428
|
parts: Object.entries(action.config || {}).map(([key, value]) => ({
|
|
6425
6429
|
slug: key,
|
|
6426
6430
|
category: ["atom"],
|
|
@@ -6430,7 +6434,7 @@ function liftSchedule(during) {
|
|
|
6430
6434
|
}
|
|
6431
6435
|
return {
|
|
6432
6436
|
slug: during.id,
|
|
6433
|
-
category:
|
|
6437
|
+
category: normalizeCategory("schedule", during.type),
|
|
6434
6438
|
parts
|
|
6435
6439
|
};
|
|
6436
6440
|
}
|
|
@@ -6443,14 +6447,14 @@ function liftState(state) {
|
|
|
6443
6447
|
if (state.on_enter && state.on_enter.length > 0) {
|
|
6444
6448
|
parts.push({
|
|
6445
6449
|
slug: "on_enter",
|
|
6446
|
-
category:
|
|
6450
|
+
category: normalizeCategory("expression", "sequence"),
|
|
6447
6451
|
parts: state.on_enter.map(liftAction)
|
|
6448
6452
|
});
|
|
6449
6453
|
}
|
|
6450
6454
|
if (state.on_exit && state.on_exit.length > 0) {
|
|
6451
6455
|
parts.push({
|
|
6452
6456
|
slug: "on_exit",
|
|
6453
|
-
category:
|
|
6457
|
+
category: normalizeCategory("expression", "sequence"),
|
|
6454
6458
|
parts: state.on_exit.map(liftAction)
|
|
6455
6459
|
});
|
|
6456
6460
|
}
|
|
@@ -6461,7 +6465,7 @@ function liftState(state) {
|
|
|
6461
6465
|
}
|
|
6462
6466
|
return {
|
|
6463
6467
|
slug: state.name,
|
|
6464
|
-
category:
|
|
6468
|
+
category: normalizeCategory("state", ...tags),
|
|
6465
6469
|
parts: parts.length > 0 ? parts : void 0
|
|
6466
6470
|
};
|
|
6467
6471
|
}
|
|
@@ -6484,17 +6488,17 @@ function liftTransition(transition) {
|
|
|
6484
6488
|
if (transition.actions && transition.actions.length > 0) {
|
|
6485
6489
|
parts.push({
|
|
6486
6490
|
slug: "actions",
|
|
6487
|
-
category:
|
|
6491
|
+
category: normalizeCategory("expression", "sequence"),
|
|
6488
6492
|
parts: transition.actions.map(liftAction)
|
|
6489
6493
|
});
|
|
6490
6494
|
}
|
|
6491
6495
|
if (transition.conditions && transition.conditions.length > 0) {
|
|
6492
6496
|
parts.push({
|
|
6493
6497
|
slug: "conditions",
|
|
6494
|
-
category:
|
|
6498
|
+
category: normalizeCategory("expression", "guard"),
|
|
6495
6499
|
parts: transition.conditions.map((c, i) => ({
|
|
6496
6500
|
slug: `condition_${i}`,
|
|
6497
|
-
category:
|
|
6501
|
+
category: normalizeCategory("expression", c.type || "condition"),
|
|
6498
6502
|
parts: c.expression ? [{ slug: c.expression, category: ["binding"] }] : void 0
|
|
6499
6503
|
}))
|
|
6500
6504
|
});
|
|
@@ -6533,7 +6537,7 @@ function liftField(field) {
|
|
|
6533
6537
|
}
|
|
6534
6538
|
return {
|
|
6535
6539
|
slug: field.name,
|
|
6536
|
-
category:
|
|
6540
|
+
category: normalizeCategory("field", field.type),
|
|
6537
6541
|
parts: parts.length > 0 ? parts : void 0
|
|
6538
6542
|
};
|
|
6539
6543
|
}
|
|
@@ -6556,20 +6560,20 @@ function liftView(node) {
|
|
|
6556
6560
|
if (match) {
|
|
6557
6561
|
parts.push({
|
|
6558
6562
|
slug: key,
|
|
6559
|
-
category:
|
|
6563
|
+
category: normalizeCategory("expression", "effect", "transition"),
|
|
6560
6564
|
parts: [{ slug: match[1], category: ["ref"] }]
|
|
6561
6565
|
});
|
|
6562
6566
|
} else {
|
|
6563
6567
|
parts.push({
|
|
6564
6568
|
slug: key,
|
|
6565
|
-
category:
|
|
6569
|
+
category: normalizeCategory("expression", "binding"),
|
|
6566
6570
|
parts: [{ slug: String(expr), category: ["binding"] }]
|
|
6567
6571
|
});
|
|
6568
6572
|
}
|
|
6569
6573
|
} else {
|
|
6570
6574
|
parts.push({
|
|
6571
6575
|
slug: key,
|
|
6572
|
-
category:
|
|
6576
|
+
category: normalizeCategory("expression", "binding"),
|
|
6573
6577
|
parts: [{ slug: String(expr), category: ["binding"] }]
|
|
6574
6578
|
});
|
|
6575
6579
|
}
|
|
@@ -6580,20 +6584,20 @@ function liftView(node) {
|
|
|
6580
6584
|
if (eqMatch) {
|
|
6581
6585
|
parts.push({
|
|
6582
6586
|
slug: "visible_when",
|
|
6583
|
-
category:
|
|
6587
|
+
category: normalizeCategory("expression", "guard"),
|
|
6584
6588
|
parts: [{
|
|
6585
6589
|
slug: "body",
|
|
6586
|
-
category:
|
|
6590
|
+
category: normalizeCategory("expression", "eq"),
|
|
6587
6591
|
parts: [
|
|
6588
|
-
{ slug: "lhs", category:
|
|
6589
|
-
{ slug: "rhs", category:
|
|
6592
|
+
{ slug: "lhs", category: normalizeCategory("expression", "path"), parts: [{ slug: eqMatch[1], category: ["binding"] }] },
|
|
6593
|
+
{ slug: "rhs", category: normalizeCategory("expression", "literal"), parts: [{ slug: eqMatch[2], category: ["literal"] }] }
|
|
6590
6594
|
]
|
|
6591
6595
|
}]
|
|
6592
6596
|
});
|
|
6593
6597
|
} else {
|
|
6594
6598
|
parts.push({
|
|
6595
6599
|
slug: "visible_when",
|
|
6596
|
-
category:
|
|
6600
|
+
category: normalizeCategory("expression", "guard"),
|
|
6597
6601
|
parts: [{ slug: node.visible_when, category: ["binding"] }]
|
|
6598
6602
|
});
|
|
6599
6603
|
}
|
|
@@ -6605,7 +6609,7 @@ function liftView(node) {
|
|
|
6605
6609
|
}
|
|
6606
6610
|
return {
|
|
6607
6611
|
slug: node.id,
|
|
6608
|
-
category:
|
|
6612
|
+
category: normalizeCategory("view", componentTag),
|
|
6609
6613
|
parts: parts.length > 0 ? parts : void 0
|
|
6610
6614
|
};
|
|
6611
6615
|
}
|
|
@@ -6626,7 +6630,7 @@ function emitCanonical(extracted, sourceFilename) {
|
|
|
6626
6630
|
}
|
|
6627
6631
|
parts.push({
|
|
6628
6632
|
slug: "manifest",
|
|
6629
|
-
category:
|
|
6633
|
+
category: normalizeCategory("meta", "manifest"),
|
|
6630
6634
|
parts: [
|
|
6631
6635
|
{
|
|
6632
6636
|
slug: "workflows",
|
|
@@ -6647,7 +6651,7 @@ function emitCanonical(extracted, sourceFilename) {
|
|
|
6647
6651
|
let categoryArray;
|
|
6648
6652
|
if (category.includes("/")) {
|
|
6649
6653
|
const [primary, ...tags] = category.split("/");
|
|
6650
|
-
categoryArray =
|
|
6654
|
+
categoryArray = normalizeCategory(primary, ...tags);
|
|
6651
6655
|
} else {
|
|
6652
6656
|
categoryArray = [category];
|
|
6653
6657
|
}
|
package/dist/vite/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mmapp/react-compiler",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.7",
|
|
4
4
|
"description": "Babel plugin + Vite integration for compiling React workflows to Pure Form IR",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -66,12 +66,15 @@
|
|
|
66
66
|
"@babel/plugin-syntax-typescript": "^7.24.0",
|
|
67
67
|
"@babel/traverse": "^7.24.0",
|
|
68
68
|
"@babel/types": "^7.24.0",
|
|
69
|
-
"@
|
|
69
|
+
"@mmapp/player-core": ">=0.1.0-alpha.1",
|
|
70
70
|
"glob": "^10.3.10"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"vite": ">=5.0.0"
|
|
74
74
|
},
|
|
75
|
+
"peerDependenciesMeta": {
|
|
76
|
+
"vite": { "optional": true }
|
|
77
|
+
},
|
|
75
78
|
"devDependencies": {
|
|
76
79
|
"@types/babel__core": "^7.20.5",
|
|
77
80
|
"@types/babel__generator": "^7.27.0",
|