From 94716751dcc8b207e8a219b31e2da348a227d823 Mon Sep 17 00:00:00 2001 From: Louis Orleans Date: Thu, 30 Nov 2023 09:49:48 -0800 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20don't=20publish=20unnecess?= =?UTF-8?q?ary=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/generate.sh | 7 +++++++ template/package.mustache | 35 +++++++++++++++++++++++++++++++++++ template/template.patch | 14 ++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 template/package.mustache diff --git a/scripts/generate.sh b/scripts/generate.sh index e436177..bef74d1 100755 --- a/scripts/generate.sh +++ b/scripts/generate.sh @@ -91,6 +91,13 @@ function generate() { # copy auth files into generated output cp -R "$src_dir"/* "$output_dir/" + rm "$output_dir"/*.patch + + # copy other files into generated output + cp \ + "$root_dir/README.md" \ + "$root_dir/LICENSE" \ + "$output_dir/" # update package.json tmp_packagejson="$tmp_dir/package.json" diff --git a/template/package.mustache b/template/package.mustache new file mode 100644 index 0000000..92edf6b --- /dev/null +++ b/template/package.mustache @@ -0,0 +1,35 @@ +{ + "name": "{{npmName}}", + "version": "{{npmVersion}}", + "description": "OpenAPI client for {{npmName}}", + "author": "OpenAPI-Generator Contributors", + "keywords": [ + "axios", + "typescript", + "openapi-client", + "openapi-generator", + "{{npmName}}" + ], + "license": "Unlicense", + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "files": [ + "dist/" + ], + "scripts": { + "build": "tsc --outDir dist/", + "prepublishOnly": "npm run build" + }, + "dependencies": { + "axios": "^0.21.1" + }, + "devDependencies": { + "@types/node": "^12.11.5", + "typescript": "^3.6.4" + }{{#npmRepository}},{{/npmRepository}} +{{#npmRepository}} + "publishConfig": { + "registry": "{{npmRepository}}" + } +{{/npmRepository}} +} diff --git a/template/template.patch b/template/template.patch index c5d3a92..6890a60 100644 --- a/template/template.patch +++ b/template/template.patch @@ -277,6 +277,20 @@ index 999d88df..3d451772 100644 +/*.ts +/git_push.sh +.gitignore +diff --git a/src/main/resources/handlebars/typescript-axios/package.mustache b/src/main/resources/handlebars/typescript-axios/package.mustache +index 6c6114eb..92edf6bc 100644 +--- a/src/main/resources/handlebars/typescript-axios/package.mustache ++++ b/src/main/resources/handlebars/typescript-axios/package.mustache +@@ -13,6 +13,9 @@ + "license": "Unlicense", + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", ++ "files": [ ++ "dist/" ++ ], + "scripts": { + "build": "tsc --outDir dist/", + "prepublishOnly": "npm run build" diff --git a/src/main/resources/handlebars/typescript-axios/tsconfig.mustache b/src/main/resources/handlebars/typescript-axios/tsconfig.mustache index c4a4cc77..9a2ea934 100644 --- a/src/main/resources/handlebars/typescript-axios/tsconfig.mustache