How ot update:
-
rename "package_use_to_generate_code.json" to "package.json" (don't forget before publish do rollback)
-
run: packages\api2dat5> yarn generateServices
-
check: src\generatedSRC and restore all imports like was before update
-
check all tsc errors example:
// getCalculatedSparePartsResponse // getCalculatedSparePartsResponse export interface getCalculatedSparePartsResponse { spareParts?: ns1.spareParts; }
rename to (as was before)
// getCalculatedSparePartsResponse
// getCalculatedSparePartsResponse
export interface getCalculatedSparePartsResponse {
spareParts?: ns1.MaterialPositions; // undefined
}
- change package version
- update change log in readme.md
rollup -c rollup.config.js
npm publish
package use:
- npm
To run some live request tests and debug you need to add file in "src" folder (this folder is included in ".gitignore" and will not be in git repository)
"src/testAuthData/testAuthData.ts"
export const testAuthData = {
customerNumber: '3451429',
customerLogin: 'xxxxx',
customerPassword: 'xxxxx'
};
"scripts": {
"lint": "yarn run -T eslint src/**/*.{ts,tsx}",
"generateServices": "npm run downloadWsdlFromConfig && npm run generateByWSDL && npm run downloadXSDFileByWsdl && npm run formatGeneratedSRC && npm run formatWsdlXsdDownloadedFiles",
"downloadWsdlFromConfig": "ts-node ./scripts/downloadWsdlFromConfig.ts ./WsdlXsdDownloadedFiles",
"_generateDescJsonByWSDL": "ts-node ./scripts/generateDescJsonByWSDL.ts ./WsdlXsdDownloadedFiles",
"generateByWSDL": "ts-node ./scripts/generateByWSDL.ts ./WsdlXsdDownloadedFiles ./src/generatedSRC",
"downloadXSDFileByWsdl": "ts-node ./scripts/downloadXSDFileByWsdl.ts ./WsdlXsdDownloadedFiles ./src/generatedSRC",
"downloadAndParseForTSCheck": "ts-node ./src/servicesTests/typeCheckScript/downloadAndParseForTSCheck.ts",
"formatGeneratedSRC": "prettier --write ./src/generatedSRC/**/*.*",
"formatWsdlXsdDownloadedFiles": "prettier --write ./WsdlXsdDownloadedFiles/**/*.*",
"formatTypeCheckScriptFolder": "prettier --write ./src/servicesTests/typeCheckScript/**/*.*",
"formatAll": "prettier --write .",
"formatXML": "prettier --write **/*.xml",
"build:esm": "npx tsc --esModuleInterop --module ESNext --outdir dist/esm --declaration"
}