Skip to content

Commit

Permalink
⚡️ don't publish unnecessary files
Browse files Browse the repository at this point in the history
  • Loading branch information
dudeofawesome committed Nov 30, 2023
1 parent a27ba52 commit 9471675
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
35 changes: 35 additions & 0 deletions template/package.mustache
Original file line number Diff line number Diff line change
@@ -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}}
}
14 changes: 14 additions & 0 deletions template/template.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9471675

Please sign in to comment.