@mastra/codemod 0.0.0-scorers-logs-20251208123838 → 0.0.0-top-level-fix-20251211103030
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/CHANGELOG.md +9 -1
- package/dist/codemods/v1/not-implemented/mastra-required-id.js +49 -66
- package/dist/codemods/v1/not-implemented/mastra-required-id.js.map +1 -1
- package/dist/codemods/v1/workflow-stream-vnext.js +1 -0
- package/dist/codemods/v1/workflow-stream-vnext.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @mastra/codemod
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-top-level-fix-20251211103030
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
### Patch Changes
|
|
10
10
|
|
|
11
|
+
- Fixed a bug where `[native code]` was incorrectly added to the output ([#10971](https://github.com/mastra-ai/mastra/pull/10971))
|
|
12
|
+
|
|
11
13
|
- Add `v1/workflow-stream-vnext` codemod. This codemod renames `streamVNext()`, `resumeStreamVNext()`, and `observeStreamVNext()` to their "non-VNext" counterparts. ([#10802](https://github.com/mastra-ai/mastra/pull/10802))
|
|
12
14
|
|
|
13
15
|
- Fix `mastra-required-id`, `mcp-get-toolsets`, and `mcp-get-tools` codemods to add missing imports and instances. ([#10221](https://github.com/mastra-ai/mastra/pull/10221))
|
|
@@ -16,6 +18,12 @@
|
|
|
16
18
|
- Make package ESM-only
|
|
17
19
|
- Add new codemods
|
|
18
20
|
|
|
21
|
+
## 0.1.0-beta.4
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Fixed a bug where `[native code]` was incorrectly added to the output ([#10971](https://github.com/mastra-ai/mastra/pull/10971))
|
|
26
|
+
|
|
19
27
|
## 0.1.0-beta.3
|
|
20
28
|
|
|
21
29
|
### Patch Changes
|
|
@@ -9,6 +9,14 @@ import {
|
|
|
9
9
|
var mastra_required_id_default = createTransformer((fileInfo, api, options, context) => {
|
|
10
10
|
const { j, root } = context;
|
|
11
11
|
const COMMENT_MESSAGE = "FIXME(mastra): Add a unique `id` parameter. See: https://mastra.ai/guides/v1/migrations/upgrade-to-v1/mastra#required-id-parameter-for-all-mastra-primitives";
|
|
12
|
+
const STATEMENT_TYPES = /* @__PURE__ */ new Set([
|
|
13
|
+
"VariableDeclaration",
|
|
14
|
+
"ExpressionStatement",
|
|
15
|
+
"ReturnStatement",
|
|
16
|
+
"ExportDefaultDeclaration",
|
|
17
|
+
"ExportNamedDeclaration",
|
|
18
|
+
"Program"
|
|
19
|
+
]);
|
|
12
20
|
const storageClasses = [
|
|
13
21
|
"LibSQLStore",
|
|
14
22
|
"PostgresStore",
|
|
@@ -25,81 +33,56 @@ var mastra_required_id_default = createTransformer((fileInfo, api, options, cont
|
|
|
25
33
|
"MCPServer"
|
|
26
34
|
];
|
|
27
35
|
const createFunctions = ["createWorkflow", "createTool", "createScorer"];
|
|
36
|
+
function hasIdProperty(args) {
|
|
37
|
+
return args.some((arg) => {
|
|
38
|
+
if (arg.type === "ObjectExpression") {
|
|
39
|
+
return arg.properties?.some(
|
|
40
|
+
(prop) => (prop.type === "Property" || prop.type === "ObjectProperty") && prop.key?.type === "Identifier" && prop.key.name === "id"
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
return false;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function addCommentToAppropriateNode(path) {
|
|
47
|
+
let parent = path.parent;
|
|
48
|
+
if (parent?.value && (parent.value.type === "Property" || parent.value.type === "ObjectProperty")) {
|
|
49
|
+
if (insertCommentOnce(parent.value, j, COMMENT_MESSAGE)) {
|
|
50
|
+
context.hasChanges = true;
|
|
51
|
+
}
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (parent?.value?.type === "ArrayExpression") {
|
|
55
|
+
if (insertCommentOnce(path.value, j, COMMENT_MESSAGE)) {
|
|
56
|
+
context.hasChanges = true;
|
|
57
|
+
}
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
while (parent && !STATEMENT_TYPES.has(parent.value.type)) {
|
|
61
|
+
parent = parent.parent;
|
|
62
|
+
}
|
|
63
|
+
if (parent?.value) {
|
|
64
|
+
let targetNode = parent.value;
|
|
65
|
+
if (targetNode.type !== "ExportDefaultDeclaration" && targetNode.type !== "ExportNamedDeclaration" && parent.parent && (parent.parent.value.type === "ExportDefaultDeclaration" || parent.parent.value.type === "ExportNamedDeclaration")) {
|
|
66
|
+
targetNode = parent.parent.value;
|
|
67
|
+
}
|
|
68
|
+
if (insertCommentOnce(targetNode, j, COMMENT_MESSAGE)) {
|
|
69
|
+
context.hasChanges = true;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
28
73
|
root.find(j.NewExpression).forEach((path) => {
|
|
29
74
|
if (path.value.callee.type === "Identifier") {
|
|
30
75
|
const className = path.value.callee.name;
|
|
31
|
-
if (storageClasses.includes(className)) {
|
|
32
|
-
|
|
33
|
-
if (arg.type === "ObjectExpression") {
|
|
34
|
-
return arg.properties?.some(
|
|
35
|
-
(prop) => (prop.type === "Property" || prop.type === "ObjectProperty") && prop.key?.type === "Identifier" && prop.key.name === "id"
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
return false;
|
|
39
|
-
});
|
|
40
|
-
if (!hasId) {
|
|
41
|
-
let parent = path.parent;
|
|
42
|
-
const statementTypes = /* @__PURE__ */ new Set([
|
|
43
|
-
"VariableDeclaration",
|
|
44
|
-
"ExpressionStatement",
|
|
45
|
-
"ReturnStatement",
|
|
46
|
-
"ExportDefaultDeclaration",
|
|
47
|
-
"ExportNamedDeclaration",
|
|
48
|
-
"Program"
|
|
49
|
-
]);
|
|
50
|
-
while (parent && !statementTypes.has(parent.value.type)) {
|
|
51
|
-
parent = parent.parent;
|
|
52
|
-
}
|
|
53
|
-
if (parent && parent.value) {
|
|
54
|
-
let targetNode = parent.value;
|
|
55
|
-
if (targetNode.type !== "ExportDefaultDeclaration" && targetNode.type !== "ExportNamedDeclaration" && parent.parent && (parent.parent.value.type === "ExportDefaultDeclaration" || parent.parent.value.type === "ExportNamedDeclaration")) {
|
|
56
|
-
targetNode = parent.parent.value;
|
|
57
|
-
}
|
|
58
|
-
const added = insertCommentOnce(targetNode, j, COMMENT_MESSAGE);
|
|
59
|
-
if (added) {
|
|
60
|
-
context.hasChanges = true;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
76
|
+
if (storageClasses.includes(className) && !hasIdProperty(path.value.arguments)) {
|
|
77
|
+
addCommentToAppropriateNode(path);
|
|
64
78
|
}
|
|
65
79
|
}
|
|
66
80
|
});
|
|
67
81
|
root.find(j.CallExpression).forEach((path) => {
|
|
68
82
|
if (path.value.callee.type === "Identifier") {
|
|
69
83
|
const functionName = path.value.callee.name;
|
|
70
|
-
if (createFunctions.includes(functionName)) {
|
|
71
|
-
|
|
72
|
-
if (arg.type === "ObjectExpression") {
|
|
73
|
-
return arg.properties?.some(
|
|
74
|
-
(prop) => (prop.type === "Property" || prop.type === "ObjectProperty") && prop.key?.type === "Identifier" && prop.key.name === "id"
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
return false;
|
|
78
|
-
});
|
|
79
|
-
if (!hasId) {
|
|
80
|
-
let parent = path.parent;
|
|
81
|
-
const statementTypes = /* @__PURE__ */ new Set([
|
|
82
|
-
"VariableDeclaration",
|
|
83
|
-
"ExpressionStatement",
|
|
84
|
-
"ReturnStatement",
|
|
85
|
-
"ExportDefaultDeclaration",
|
|
86
|
-
"ExportNamedDeclaration",
|
|
87
|
-
"Program"
|
|
88
|
-
]);
|
|
89
|
-
while (parent && !statementTypes.has(parent.value.type)) {
|
|
90
|
-
parent = parent.parent;
|
|
91
|
-
}
|
|
92
|
-
if (parent && parent.value) {
|
|
93
|
-
let targetNode = parent.value;
|
|
94
|
-
if (targetNode.type !== "ExportDefaultDeclaration" && targetNode.type !== "ExportNamedDeclaration" && parent.parent && (parent.parent.value.type === "ExportDefaultDeclaration" || parent.parent.value.type === "ExportNamedDeclaration")) {
|
|
95
|
-
targetNode = parent.parent.value;
|
|
96
|
-
}
|
|
97
|
-
const added = insertCommentOnce(targetNode, j, COMMENT_MESSAGE);
|
|
98
|
-
if (added) {
|
|
99
|
-
context.hasChanges = true;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
84
|
+
if (createFunctions.includes(functionName) && !hasIdProperty(path.value.arguments)) {
|
|
85
|
+
addCommentToAppropriateNode(path);
|
|
103
86
|
}
|
|
104
87
|
}
|
|
105
88
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/codemods/v1/not-implemented/mastra-required-id.ts"],"sourcesContent":["/* eslint-disable no-warning-comments */\nimport { insertCommentOnce } from '../../lib/add-comment';\nimport { createTransformer } from '../../lib/create-transformer';\n\n/**\n * Adds FIXME comments to Mastra primitives that now require an `id` parameter.\n * This includes storages, vector stores, agents, workflows, tools, scorers, and MCP servers.\n *\n * Before:\n * const agent = new Agent({ name: 'Support Agent' });\n * const tool = createTool({ description: 'Get weather' });\n *\n * After:\n * /* FIXME(mastra): Add a unique `id` parameter. See: ... *\\/\n * const agent = new Agent({ name: 'Support Agent' });\n * /* FIXME(mastra): Add a unique `id` parameter. See: ... *\\/\n * const tool = createTool({ description: 'Get weather' });\n */\nexport default createTransformer((fileInfo, api, options, context) => {\n const { j, root } = context;\n\n const COMMENT_MESSAGE =\n 'FIXME(mastra): Add a unique `id` parameter. See: https://mastra.ai/guides/v1/migrations/upgrade-to-v1/mastra#required-id-parameter-for-all-mastra-primitives';\n\n // List of class names that require id\n const storageClasses = [\n 'LibSQLStore',\n 'PostgresStore',\n 'D1Store',\n 'MongoDBStore',\n 'DynamoDBStore',\n 'LibSQLVector',\n 'PgVector',\n 'ChromaVector',\n 'PineconeVector',\n 'QdrantVector',\n 'LanceVector',\n 'Agent',\n 'MCPServer',\n ];\n\n // List of function names that require id\n const createFunctions = ['createWorkflow', 'createTool', 'createScorer'];\n\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/codemods/v1/not-implemented/mastra-required-id.ts"],"sourcesContent":["/* eslint-disable no-warning-comments */\nimport type { ASTPath } from 'jscodeshift';\n\nimport { insertCommentOnce } from '../../lib/add-comment';\nimport { createTransformer } from '../../lib/create-transformer';\n\n/**\n * Adds FIXME comments to Mastra primitives that now require an `id` parameter.\n * This includes storages, vector stores, agents, workflows, tools, scorers, and MCP servers.\n *\n * Before:\n * const agent = new Agent({ name: 'Support Agent' });\n * const tool = createTool({ description: 'Get weather' });\n *\n * After:\n * /* FIXME(mastra): Add a unique `id` parameter. See: ... *\\/\n * const agent = new Agent({ name: 'Support Agent' });\n * /* FIXME(mastra): Add a unique `id` parameter. See: ... *\\/\n * const tool = createTool({ description: 'Get weather' });\n */\nexport default createTransformer((fileInfo, api, options, context) => {\n const { j, root } = context;\n\n const COMMENT_MESSAGE =\n 'FIXME(mastra): Add a unique `id` parameter. See: https://mastra.ai/guides/v1/migrations/upgrade-to-v1/mastra#required-id-parameter-for-all-mastra-primitives';\n\n const STATEMENT_TYPES = new Set([\n 'VariableDeclaration',\n 'ExpressionStatement',\n 'ReturnStatement',\n 'ExportDefaultDeclaration',\n 'ExportNamedDeclaration',\n 'Program',\n ]);\n\n // List of class names that require id\n const storageClasses = [\n 'LibSQLStore',\n 'PostgresStore',\n 'D1Store',\n 'MongoDBStore',\n 'DynamoDBStore',\n 'LibSQLVector',\n 'PgVector',\n 'ChromaVector',\n 'PineconeVector',\n 'QdrantVector',\n 'LanceVector',\n 'Agent',\n 'MCPServer',\n ];\n\n // List of function names that require id\n const createFunctions = ['createWorkflow', 'createTool', 'createScorer'];\n\n /**\n * Checks if an expression's arguments contain an object with an 'id' property\n */\n function hasIdProperty(args: ASTPath<any>['value']['arguments']): boolean {\n return args.some((arg: ASTPath<any>['value']) => {\n if (arg.type === 'ObjectExpression') {\n return arg.properties?.some(\n (prop: ASTPath<any>['value']) =>\n (prop.type === 'Property' || prop.type === 'ObjectProperty') &&\n prop.key?.type === 'Identifier' &&\n prop.key.name === 'id',\n );\n }\n return false;\n });\n }\n\n /**\n * Adds a FIXME comment to the appropriate node based on the expression's context.\n * - If nested in an object property, adds comment to the property\n * - If nested in an array, adds comment to the expression itself\n * - Otherwise, walks up to find the parent statement and adds comment there\n */\n function addCommentToAppropriateNode(path: ASTPath<any>): void {\n let parent = path.parent;\n\n // If the direct parent is an object property, add comment to that property\n if (parent?.value && (parent.value.type === 'Property' || parent.value.type === 'ObjectProperty')) {\n if (insertCommentOnce(parent.value, j, COMMENT_MESSAGE)) {\n context.hasChanges = true;\n }\n return;\n }\n\n // If the parent is an array, add comment directly to the expression\n if (parent?.value?.type === 'ArrayExpression') {\n if (insertCommentOnce(path.value, j, COMMENT_MESSAGE)) {\n context.hasChanges = true;\n }\n return;\n }\n\n // Find the parent statement to add comment\n while (parent && !STATEMENT_TYPES.has(parent.value.type)) {\n parent = parent.parent;\n }\n\n if (parent?.value) {\n // For export declarations, add comment to the export itself\n let targetNode = parent.value;\n if (\n targetNode.type !== 'ExportDefaultDeclaration' &&\n targetNode.type !== 'ExportNamedDeclaration' &&\n parent.parent &&\n (parent.parent.value.type === 'ExportDefaultDeclaration' ||\n parent.parent.value.type === 'ExportNamedDeclaration')\n ) {\n targetNode = parent.parent.value;\n }\n\n if (insertCommentOnce(targetNode, j, COMMENT_MESSAGE)) {\n context.hasChanges = true;\n }\n }\n }\n\n // Find NewExpression for classes\n root.find(j.NewExpression).forEach(path => {\n if (path.value.callee.type === 'Identifier') {\n const className = path.value.callee.name;\n\n if (storageClasses.includes(className) && !hasIdProperty(path.value.arguments)) {\n addCommentToAppropriateNode(path);\n }\n }\n });\n\n // Find CallExpression for create functions\n root.find(j.CallExpression).forEach(path => {\n if (path.value.callee.type === 'Identifier') {\n const functionName = path.value.callee.name;\n\n if (createFunctions.includes(functionName) && !hasIdProperty(path.value.arguments)) {\n addCommentToAppropriateNode(path);\n }\n }\n });\n\n if (context.hasChanges) {\n context.messages.push(`Not Implemented ${fileInfo.path}: Mastra primitives now require a unique id parameter.`);\n }\n});\n"],"mappings":";;;;;;;;AAoBA,IAAO,6BAAQ,kBAAkB,CAAC,UAAU,KAAK,SAAS,YAAY;AACpE,QAAM,EAAE,GAAG,KAAK,IAAI;AAEpB,QAAM,kBACJ;AAEF,QAAM,kBAAkB,oBAAI,IAAI;AAAA,IAC9B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAGD,QAAM,iBAAiB;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAGA,QAAM,kBAAkB,CAAC,kBAAkB,cAAc,cAAc;AAKvE,WAAS,cAAc,MAAmD;AACxE,WAAO,KAAK,KAAK,CAAC,QAA+B;AAC/C,UAAI,IAAI,SAAS,oBAAoB;AACnC,eAAO,IAAI,YAAY;AAAA,UACrB,CAAC,UACE,KAAK,SAAS,cAAc,KAAK,SAAS,qBAC3C,KAAK,KAAK,SAAS,gBACnB,KAAK,IAAI,SAAS;AAAA,QACtB;AAAA,MACF;AACA,aAAO;AAAA,IACT,CAAC;AAAA,EACH;AAQA,WAAS,4BAA4B,MAA0B;AAC7D,QAAI,SAAS,KAAK;AAGlB,QAAI,QAAQ,UAAU,OAAO,MAAM,SAAS,cAAc,OAAO,MAAM,SAAS,mBAAmB;AACjG,UAAI,kBAAkB,OAAO,OAAO,GAAG,eAAe,GAAG;AACvD,gBAAQ,aAAa;AAAA,MACvB;AACA;AAAA,IACF;AAGA,QAAI,QAAQ,OAAO,SAAS,mBAAmB;AAC7C,UAAI,kBAAkB,KAAK,OAAO,GAAG,eAAe,GAAG;AACrD,gBAAQ,aAAa;AAAA,MACvB;AACA;AAAA,IACF;AAGA,WAAO,UAAU,CAAC,gBAAgB,IAAI,OAAO,MAAM,IAAI,GAAG;AACxD,eAAS,OAAO;AAAA,IAClB;AAEA,QAAI,QAAQ,OAAO;AAEjB,UAAI,aAAa,OAAO;AACxB,UACE,WAAW,SAAS,8BACpB,WAAW,SAAS,4BACpB,OAAO,WACN,OAAO,OAAO,MAAM,SAAS,8BAC5B,OAAO,OAAO,MAAM,SAAS,2BAC/B;AACA,qBAAa,OAAO,OAAO;AAAA,MAC7B;AAEA,UAAI,kBAAkB,YAAY,GAAG,eAAe,GAAG;AACrD,gBAAQ,aAAa;AAAA,MACvB;AAAA,IACF;AAAA,EACF;AAGA,OAAK,KAAK,EAAE,aAAa,EAAE,QAAQ,UAAQ;AACzC,QAAI,KAAK,MAAM,OAAO,SAAS,cAAc;AAC3C,YAAM,YAAY,KAAK,MAAM,OAAO;AAEpC,UAAI,eAAe,SAAS,SAAS,KAAK,CAAC,cAAc,KAAK,MAAM,SAAS,GAAG;AAC9E,oCAA4B,IAAI;AAAA,MAClC;AAAA,IACF;AAAA,EACF,CAAC;AAGD,OAAK,KAAK,EAAE,cAAc,EAAE,QAAQ,UAAQ;AAC1C,QAAI,KAAK,MAAM,OAAO,SAAS,cAAc;AAC3C,YAAM,eAAe,KAAK,MAAM,OAAO;AAEvC,UAAI,gBAAgB,SAAS,YAAY,KAAK,CAAC,cAAc,KAAK,MAAM,SAAS,GAAG;AAClF,oCAA4B,IAAI;AAAA,MAClC;AAAA,IACF;AAAA,EACF,CAAC;AAED,MAAI,QAAQ,YAAY;AACtB,YAAQ,SAAS,KAAK,mBAAmB,SAAS,IAAI,wDAAwD;AAAA,EAChH;AACF,CAAC;","names":[]}
|
|
@@ -16,6 +16,7 @@ var workflow_stream_vnext_default = createTransformer((fileInfo, api, options, c
|
|
|
16
16
|
if (callee.type !== "MemberExpression") return;
|
|
17
17
|
if (callee.property.type !== "Identifier") return;
|
|
18
18
|
const oldName = callee.property.name;
|
|
19
|
+
if (!Object.hasOwn(methodRenames, oldName)) return;
|
|
19
20
|
const newName = methodRenames[oldName];
|
|
20
21
|
if (newName) {
|
|
21
22
|
callee.property.name = newName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/codemods/v1/workflow-stream-vnext.ts"],"sourcesContent":["import { createTransformer } from '../lib/create-transformer';\n\n/**\n * Transforms workflow run VNext methods to their standard names:\n * - run.streamVNext() → run.stream()\n * - run.resumeStreamVNext() → run.resumeStream()\n * - run.observeStreamVNext() → run.observeStream()\n *\n * These methods are called on the result of workflow.createRun().\n */\nexport default createTransformer((fileInfo, api, options, context) => {\n const { j, root } = context;\n\n // Map of old method names to new method names\n const methodRenames: Record<string, string> = {\n streamVNext: 'stream',\n resumeStreamVNext: 'resumeStream',\n observeStreamVNext: 'observeStream',\n };\n\n let count = 0;\n\n // Find all call expressions and rename VNext methods\n // These method names are unique enough to Mastra workflow runs\n // that we can safely rename them globally\n root.find(j.CallExpression).forEach(path => {\n const { callee } = path.value;\n if (callee.type !== 'MemberExpression') return;\n if (callee.property.type !== 'Identifier') return;\n\n const oldName = callee.property.name;\n const newName = methodRenames[oldName];\n
|
|
1
|
+
{"version":3,"sources":["../../../src/codemods/v1/workflow-stream-vnext.ts"],"sourcesContent":["import { createTransformer } from '../lib/create-transformer';\n\n/**\n * Transforms workflow run VNext methods to their standard names:\n * - run.streamVNext() → run.stream()\n * - run.resumeStreamVNext() → run.resumeStream()\n * - run.observeStreamVNext() → run.observeStream()\n *\n * These methods are called on the result of workflow.createRun().\n */\nexport default createTransformer((fileInfo, api, options, context) => {\n const { j, root } = context;\n\n // Map of old method names to new method names\n const methodRenames: Record<string, string> = {\n streamVNext: 'stream',\n resumeStreamVNext: 'resumeStream',\n observeStreamVNext: 'observeStream',\n };\n\n let count = 0;\n\n // Find all call expressions and rename VNext methods\n // These method names are unique enough to Mastra workflow runs\n // that we can safely rename them globally\n root.find(j.CallExpression).forEach(path => {\n const { callee } = path.value;\n if (callee.type !== 'MemberExpression') return;\n if (callee.property.type !== 'Identifier') return;\n\n const oldName = callee.property.name;\n if (!Object.hasOwn(methodRenames, oldName)) return;\n\n const newName = methodRenames[oldName];\n if (newName) {\n callee.property.name = newName;\n count++;\n }\n });\n\n if (count > 0) {\n context.hasChanges = true;\n context.messages.push(\n `Renamed workflow run VNext methods: streamVNext/resumeStreamVNext/observeStreamVNext → stream/resumeStream/observeStream`,\n );\n }\n});\n"],"mappings":";;;;;AAUA,IAAO,gCAAQ,kBAAkB,CAAC,UAAU,KAAK,SAAS,YAAY;AACpE,QAAM,EAAE,GAAG,KAAK,IAAI;AAGpB,QAAM,gBAAwC;AAAA,IAC5C,aAAa;AAAA,IACb,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,EACtB;AAEA,MAAI,QAAQ;AAKZ,OAAK,KAAK,EAAE,cAAc,EAAE,QAAQ,UAAQ;AAC1C,UAAM,EAAE,OAAO,IAAI,KAAK;AACxB,QAAI,OAAO,SAAS,mBAAoB;AACxC,QAAI,OAAO,SAAS,SAAS,aAAc;AAE3C,UAAM,UAAU,OAAO,SAAS;AAChC,QAAI,CAAC,OAAO,OAAO,eAAe,OAAO,EAAG;AAE5C,UAAM,UAAU,cAAc,OAAO;AACrC,QAAI,SAAS;AACX,aAAO,SAAS,OAAO;AACvB;AAAA,IACF;AAAA,EACF,CAAC;AAED,MAAI,QAAQ,GAAG;AACb,YAAQ,aAAa;AACrB,YAAQ,SAAS;AAAA,MACf;AAAA,IACF;AAAA,EACF;AACF,CAAC;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/codemod",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-top-level-fix-20251211103030",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "Codemod CLI for Mastra",
|
|
7
7
|
"bin": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"tsup": "^8.5.0",
|
|
35
35
|
"typescript": "^5.8.3",
|
|
36
36
|
"vitest": "4.0.12",
|
|
37
|
-
"@internal/lint": "0.0.0-
|
|
37
|
+
"@internal/lint": "0.0.0-top-level-fix-20251211103030"
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://mastra.ai",
|
|
40
40
|
"repository": {
|