Skip to content

Commit

Permalink
Fix type generation for packages
Browse files Browse the repository at this point in the history
  • Loading branch information
smaye81 committed Aug 1, 2023
1 parent f732bd7 commit 8f02ba2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ GOOGLE_PROTOBUF_VERSION = 23.4
BAZEL_VERSION = 5.4.0
TS_VERSIONS = 4.1.2 4.2.4 4.3.5 4.4.4 4.5.2 4.6.4 4.7.4 4.8.4 4.9.5 5.0.4

# test

node_modules: package-lock.json
npm ci

Expand Down
2 changes: 1 addition & 1 deletion packages/protobuf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"sideEffects": false,
"scripts": {
"clean": "rm -rf ./dist/cjs/* ./dist/esm/* ./dist/types/*",
"clean": "rm -rf ./dist/cjs/* ./dist/esm/*",
"build": "npm run build:cjs && npm run build:esm",
"build:cjs": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module commonjs --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module ES2015 --verbatimModuleSyntax --outDir ./dist/esm --declaration --declarationDir ./dist/esm",
Expand Down
20 changes: 10 additions & 10 deletions packages/protoplugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,40 @@
},
"sideEffects": false,
"scripts": {
"clean": "rm -rf ./dist/cjs/* ./dist/esm/* ./dist/types/*",
"build": "npm run build:cjs && npm run build:esm+types",
"build:cjs": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module commonjs --outDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm+types": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module ES2015 --outDir ./dist/esm --declaration --declarationDir ./dist/types && cp ./dist/types/index.d.ts ./dist/types/index.d.cts && cp ./dist/types/ecmascript/index.d.ts ./dist/types/ecmascript/index.d.cts",
"clean": "rm -rf ./dist/cjs/* ./dist/esm/*",
"build": "npm run build:cjs && npm run build:esm",
"build:cjs": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module commonjs --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module ES2015 --outDir ./dist/esm --declaration --declarationDir ./dist/esm",
"lint:types": "attw --pack"
},
"type": "module",
"exports": {
".": {
"import": {
"types": "./dist/types/index.d.ts",
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/types/index.d.cts",
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.js"
}
},
"./ecmascript": {
"import": {
"types": "./dist/types/ecmascript/index.d.ts",
"types": "./dist/esm/ecmascript/index.d.ts",
"default": "./dist/esm/ecmascript/index.js"
},
"require": {
"types": "./dist/types/ecmascript/index.d.cts",
"types": "./dist/cjs/ecmascript/index.d.ts",
"default": "./dist/cjs/ecmascript/index.js"
}
}
},
"types": "./dist/types/index.d.ts",
"types": "./dist/esm/index.d.ts",
"typesVersions": {
"*": {
"ecmascript": [
"./dist/types/ecmascript/index.d.ts"
"./dist/esm/ecmascript/index.d.ts"
]
}
},
Expand Down

0 comments on commit 8f02ba2

Please sign in to comment.