@express-zod-api/migration 24.0.1 → 25.0.0-beta.2
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/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +7 -13
- package/dist/index.cjs +0 -1
- package/dist/index.d.cts +0 -9
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ESLintUtils } from '@typescript-eslint/utils';
|
|
|
2
2
|
|
|
3
3
|
declare const _default: {
|
|
4
4
|
rules: {
|
|
5
|
-
|
|
5
|
+
v25: ESLintUtils.RuleModule<"change" | "add" | "move" | "remove", [], unknown, ESLintUtils.RuleListener>;
|
|
6
6
|
};
|
|
7
7
|
};
|
|
8
8
|
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ESLintUtils as
|
|
1
|
+
import{ESLintUtils as s,AST_NODE_TYPES as r}from"@typescript-eslint/utils";var o={zod:`${r.ImportDeclaration}[source.value='zod/v4']`,dateInOutExample:`${r.CallExpression}[callee.object.name='ez'][callee.property.name=/date(In|Out)/] >${r.ObjectExpression} > ${r.Property}[key.name='example']`,getExamples:`${r.CallExpression}[callee.name='getExamples']`},m=t=>Object.keys(t).reduce((e,a)=>Object.assign(e,{[o[a]]:t[a]}),{}),p=s.RuleCreator.withoutDocs({meta:{type:"problem",fixable:"code",schema:[],messages:{change:"change {{ subject }} from {{ from }} to {{ to }}",add:"add {{ subject }} to {{ to }}",move:"move {{ subject }} to {{ to }}",remove:"remove {{ subject }}"}},defaultOptions:[],create:t=>m({zod:e=>t.report({node:e.source,messageId:"change",data:{subject:"import",from:"zod/v4",to:"zod"},fix:a=>a.replaceText(e.source,'"zod"')}),dateInOutExample:e=>t.report({node:e,messageId:"change",data:{subject:"property",from:"example",to:"examples"},fix:a=>a.replaceText(e,`examples: [${t.sourceCode.getText(e.value)}]`)}),getExamples:e=>t.report({node:e,messageId:"change",data:{subject:"method",from:"getExamples()",to:".meta()?.examples || []"},fix:a=>a.replaceText(e,`(${t.sourceCode.getText(e.arguments[0])}.meta()?.examples || [])`)})})}),n={rules:{v25:p}};export{n as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@express-zod-api/migration",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.0.0-beta.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Migration scripts for express-zod-api",
|
|
6
6
|
"repository": {
|
|
@@ -15,19 +15,13 @@
|
|
|
15
15
|
"bugs": "https://github.com/RobinTail/express-zod-api/issues",
|
|
16
16
|
"funding": "https://github.com/sponsors/RobinTail",
|
|
17
17
|
"type": "module",
|
|
18
|
-
"main": "dist/index.
|
|
19
|
-
"types": "dist/index.d.
|
|
18
|
+
"main": "dist/index.js",
|
|
19
|
+
"types": "dist/index.d.ts",
|
|
20
20
|
"module": "dist/index.js",
|
|
21
21
|
"exports": {
|
|
22
22
|
".": {
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
"default": "./dist/index.js"
|
|
26
|
-
},
|
|
27
|
-
"require": {
|
|
28
|
-
"types": "./dist/index.d.cts",
|
|
29
|
-
"default": "./dist/index.cjs"
|
|
30
|
-
}
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"default": "./dist/index.js"
|
|
31
25
|
}
|
|
32
26
|
},
|
|
33
27
|
"files": [
|
|
@@ -39,12 +33,12 @@
|
|
|
39
33
|
"typescript-eslint": "^8.0.0"
|
|
40
34
|
},
|
|
41
35
|
"devDependencies": {
|
|
42
|
-
"@typescript-eslint/rule-tester": "^8.
|
|
36
|
+
"@typescript-eslint/rule-tester": "^8.35.1"
|
|
43
37
|
},
|
|
44
38
|
"scripts": {
|
|
45
39
|
"pretest": "tsc --noEmit",
|
|
46
40
|
"test": "vitest run --globals",
|
|
47
41
|
"build": "tsup",
|
|
48
|
-
"postbuild": "attw --pack"
|
|
42
|
+
"postbuild": "attw --pack --profile esm-only"
|
|
49
43
|
}
|
|
50
44
|
}
|
package/dist/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var i=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var f=(t,e)=>{for(var n in e)i(t,n,{get:e[n],enumerable:!0})},g=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of S(e))!d.call(t,o)&&o!==n&&i(t,o,{get:()=>e[o],enumerable:!(a=u(e,o))||a.enumerable});return t};var y=t=>g(i({},"__esModule",{value:!0}),t);var z={};f(z,{default:()=>b});module.exports=y(z);var r=require("@typescript-eslint/utils"),T={numericRange:`${r.AST_NODE_TYPES.NewExpression}[callee.name='Documentation'] > ${r.AST_NODE_TYPES.ObjectExpression} > ${r.AST_NODE_TYPES.Property}[key.name='numericRange']`,optionalPropStyle:`${r.AST_NODE_TYPES.NewExpression}[callee.name='Integration'] > ${r.AST_NODE_TYPES.ObjectExpression} > ${r.AST_NODE_TYPES.Property}[key.name='optionalPropStyle']`,depicter:`${r.AST_NODE_TYPES.VariableDeclarator}[id.typeAnnotation.typeAnnotation.typeName.name='Depicter'] > ${r.AST_NODE_TYPES.ArrowFunctionExpression}`,nextCall:`${r.AST_NODE_TYPES.VariableDeclarator}[id.typeAnnotation.typeAnnotation.typeName.name='Depicter'] > ${r.AST_NODE_TYPES.ArrowFunctionExpression} ${r.AST_NODE_TYPES.CallExpression}[callee.name='next']`,zod:`${r.AST_NODE_TYPES.ImportDeclaration}[source.value='zod']`,ezFile:`${r.AST_NODE_TYPES.CallExpression}[arguments.0.type='${r.AST_NODE_TYPES.Literal}']:has( ${r.AST_NODE_TYPES.MemberExpression}[object.name='ez'][property.name='file'] )`},E=t=>Object.keys(t).reduce((e,n)=>Object.assign(e,{[T[n]]:t[n]}),{}),l=(t,e)=>[t.range[0],t.range[1]+(e.sourceCode.getTokenAfter(t)?.value===","?1:0)],m=t=>e=>t.report({node:e,messageId:"remove",data:{subject:e.key.name},fix:n=>n.removeRange(l(e,t))}),x=r.ESLintUtils.RuleCreator.withoutDocs({meta:{type:"problem",fixable:"code",schema:[],messages:{change:"change {{ subject }} from {{ from }} to {{ to }}",add:"add {{ subject }} to {{ to }}",move:"move {{ subject }} to {{ to }}",remove:"remove {{ subject }}"}},defaultOptions:[],create:t=>E({numericRange:m(t),optionalPropStyle:m(t),depicter:e=>{let[n,a]=e.params;if(n?.type!==r.AST_NODE_TYPES.Identifier)return;let o=n.name;if(a?.type!==r.AST_NODE_TYPES.ObjectPattern)return;let p=a.properties.find(s=>s.type===r.AST_NODE_TYPES.Property&&s.key.type===r.AST_NODE_TYPES.Identifier&&s.key.name==="next");t.report({node:e,messageId:"change",data:{subject:"arguments",from:`[${o}, { next, ...rest }]`,to:`[{ zodSchema: ${o}, jsonSchema }, { ...rest }]`},fix:s=>{let c=[s.replaceText(n,`{ zodSchema: ${o}, jsonSchema }`)];return p&&c.push(s.removeRange(l(p,t))),c}})},nextCall:e=>t.report({node:e,messageId:"change",data:{subject:"statement",from:"next()",to:"jsonSchema"},fix:n=>n.replaceText(e,"jsonSchema")}),zod:e=>t.report({node:e.source,messageId:"change",data:{subject:"import",from:"zod",to:"zod/v4"},fix:n=>n.replaceText(e.source,'"zod/v4"')}),ezFile:e=>{let[n]=e.arguments,a=n.value==="buffer"?"ez.buffer()":n.value==="base64"?"z.base64()":n.value==="binary"?"ez.buffer().or(z.string())":"z.string()";t.report({node:e,messageId:"change",data:{subject:"schema",from:"ez.file()",to:a},fix:o=>o.replaceText(e,a)})}})}),b={rules:{v24:x}};
|
package/dist/index.d.cts
DELETED