@express-zod-api/migration 24.1.0 → 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 +6 -12
- 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": [
|
|
@@ -45,6 +39,6 @@
|
|
|
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 S=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var T=(t,e)=>{for(var n in e)i(t,n,{get:e[n],enumerable:!0})},E=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of g(e))!y.call(t,o)&&o!==n&&i(t,o,{get:()=>e[o],enumerable:!(a=S(e,o))||a.enumerable});return t};var x=t=>E(i({},"__esModule",{value:!0}),t);var L={};T(L,{default:()=>$});module.exports=x(L);var b=()=>typeof document>"u"?new URL(`file:${__filename}`).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href,m=b();var r=require("@typescript-eslint/utils"),u=require("node:fs"),d=require("node:url"),h={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'] )`},j=t=>Object.keys(t).reduce((e,n)=>Object.assign(e,{[h[n]]:t[n]}),{}),f=(t,e)=>[t.range[0],t.range[1]+(e.sourceCode.getTokenAfter(t)?.value===","?1:0)],l=t=>e=>t.report({node:e,messageId:"remove",data:{subject:e.key.name},fix:n=>n.removeRange(f(e,t))}),z=()=>{try{let t=(0,d.fileURLToPath)(new URL("zod/package.json",m)),e=JSON.parse((0,u.readFileSync)(t,"utf8"));if(typeof e=="object"&&e!==null&&"version"in e&&typeof e.version=="string")return e.version}catch{}},v=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=>j({numericRange:l(t),optionalPropStyle:l(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 c=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 p=[s.replaceText(n,`{ zodSchema: ${o}, jsonSchema }`)];return c&&p.push(s.removeRange(f(c,t))),p}})},nextCall:e=>t.report({node:e,messageId:"change",data:{subject:"statement",from:"next()",to:"jsonSchema"},fix:n=>n.replaceText(e,"jsonSchema")}),zod:e=>{z()?.startsWith("4.")||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)})}})}),$={rules:{v24:v}};
|
package/dist/index.d.cts
DELETED