diff --git a/package-lock.json b/package-lock.json index 8f19ed5f..39e13f26 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,9 @@ "name": "root", "license": "(Apache-2.0 AND BSD-3-Clause)", "devDependencies": { - "lerna": "^3.22.1" + "@types/jasmine": "^3.5.10", + "lerna": "^3.22.1", + "typescript": ">=3.8.3 <4" } }, "node_modules/@babel/code-frame": { @@ -1341,6 +1343,12 @@ "@types/node": "*" } }, + "node_modules/@types/jasmine": { + "version": "3.5.11", + "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.5.11.tgz", + "integrity": "sha512-fg1rOd/DehQTIJTifGqGVY6q92lDgnLfs7C6t1ccSwQrMyoTGSoH6wWzhJDZb6ezhsdwAX4EIBLe8w5fXWmEng==", + "dev": true + }, "node_modules/@types/minimatch": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", @@ -7887,6 +7895,19 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, + "node_modules/typescript": { + "version": "3.9.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.6.tgz", + "integrity": "sha512-Pspx3oKAPJtjNwE92YS05HQoY7z2SFyOpHo9MqJor3BXAGNaPUs83CuVp9VISFkSjyRfiTpmKuAYGJB7S7hOxw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, "node_modules/uglify-js": { "version": "3.10.0", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.0.tgz", @@ -9584,6 +9605,12 @@ "@types/node": "*" } }, + "@types/jasmine": { + "version": "3.5.11", + "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.5.11.tgz", + "integrity": "sha512-fg1rOd/DehQTIJTifGqGVY6q92lDgnLfs7C6t1ccSwQrMyoTGSoH6wWzhJDZb6ezhsdwAX4EIBLe8w5fXWmEng==", + "dev": true + }, "@types/minimatch": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", @@ -14890,6 +14917,12 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, + "typescript": { + "version": "3.9.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.6.tgz", + "integrity": "sha512-Pspx3oKAPJtjNwE92YS05HQoY7z2SFyOpHo9MqJor3BXAGNaPUs83CuVp9VISFkSjyRfiTpmKuAYGJB7S7hOxw==", + "dev": true + }, "uglify-js": { "version": "3.10.0", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.0.tgz", diff --git a/package.json b/package.json index 17012f97..7177d2e8 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,9 @@ "name": "root", "private": true, "devDependencies": { - "lerna": "^3.22.1" + "@types/jasmine": "^3.5.10", + "lerna": "^3.22.1", + "typescript": ">=3.8.3 <4" }, "license": "(Apache-2.0 AND BSD-3-Clause)" } diff --git a/packages/grpc-backend/Makefile b/packages/grpc-backend/Makefile index edff9195..0dc5d84f 100644 --- a/packages/grpc-backend/Makefile +++ b/packages/grpc-backend/Makefile @@ -5,9 +5,9 @@ SPECS := $(shell find spec -name '*.spec.ts') default: clean build test build: - @./node_modules/.bin/tsc --project tsconfig.json --module es2015 --outDir build/es2015; + @./node_modules/.bin/tsc --project tsconfig.build.json --module es2015 --outDir build/es2015; @echo "es6 done" - @./node_modules/.bin/tsc --project tsconfig.json --module commonjs --outDir build/commonjs \ + @./node_modules/.bin/tsc --project tsconfig.build.json --module commonjs --outDir build/commonjs \ --declaration --declarationDir build/types; @echo "cjs done" diff --git a/packages/grpc-backend/tsconfig.build.json b/packages/grpc-backend/tsconfig.build.json new file mode 100644 index 00000000..f5c51096 --- /dev/null +++ b/packages/grpc-backend/tsconfig.build.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "paths": {}, + } +} diff --git a/packages/grpc-backend/tsconfig.json b/packages/grpc-backend/tsconfig.json index 1389e998..c42de84a 100644 --- a/packages/grpc-backend/tsconfig.json +++ b/packages/grpc-backend/tsconfig.json @@ -11,6 +11,9 @@ "moduleResolution": "node", "forceConsistentCasingInFileNames": true, "skipLibCheck": false, + "paths": { + "@protobuf-ts/*": ["../*/src"] + }, "lib": [ "es2017", "dom" diff --git a/packages/grpc-backend/tsconfig.test.json b/packages/grpc-backend/tsconfig.test.json index 864575dc..437d99e0 100644 --- a/packages/grpc-backend/tsconfig.test.json +++ b/packages/grpc-backend/tsconfig.test.json @@ -7,6 +7,6 @@ "compilerOptions": { "module": "CommonJS", "declaration": false, - "paths": {} + "sourceMap": true } } diff --git a/packages/grpc-transport/Makefile b/packages/grpc-transport/Makefile index edff9195..0dc5d84f 100644 --- a/packages/grpc-transport/Makefile +++ b/packages/grpc-transport/Makefile @@ -5,9 +5,9 @@ SPECS := $(shell find spec -name '*.spec.ts') default: clean build test build: - @./node_modules/.bin/tsc --project tsconfig.json --module es2015 --outDir build/es2015; + @./node_modules/.bin/tsc --project tsconfig.build.json --module es2015 --outDir build/es2015; @echo "es6 done" - @./node_modules/.bin/tsc --project tsconfig.json --module commonjs --outDir build/commonjs \ + @./node_modules/.bin/tsc --project tsconfig.build.json --module commonjs --outDir build/commonjs \ --declaration --declarationDir build/types; @echo "cjs done" diff --git a/packages/grpc-transport/tsconfig.build.json b/packages/grpc-transport/tsconfig.build.json new file mode 100644 index 00000000..f5c51096 --- /dev/null +++ b/packages/grpc-transport/tsconfig.build.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "paths": {}, + } +} diff --git a/packages/grpc-transport/tsconfig.json b/packages/grpc-transport/tsconfig.json index 1389e998..c42de84a 100644 --- a/packages/grpc-transport/tsconfig.json +++ b/packages/grpc-transport/tsconfig.json @@ -11,6 +11,9 @@ "moduleResolution": "node", "forceConsistentCasingInFileNames": true, "skipLibCheck": false, + "paths": { + "@protobuf-ts/*": ["../*/src"] + }, "lib": [ "es2017", "dom" diff --git a/packages/grpc-transport/tsconfig.test.json b/packages/grpc-transport/tsconfig.test.json index 864575dc..437d99e0 100644 --- a/packages/grpc-transport/tsconfig.test.json +++ b/packages/grpc-transport/tsconfig.test.json @@ -7,6 +7,6 @@ "compilerOptions": { "module": "CommonJS", "declaration": false, - "paths": {} + "sourceMap": true } } diff --git a/packages/grpcweb-transport/Makefile b/packages/grpcweb-transport/Makefile index 358c2f06..140e804f 100644 --- a/packages/grpcweb-transport/Makefile +++ b/packages/grpcweb-transport/Makefile @@ -5,9 +5,9 @@ SPECS := $(shell find spec -name '*.spec.ts') default: clean build test build: - @./node_modules/.bin/tsc --project tsconfig.json --module es2015 --outDir build/es2015; + @./node_modules/.bin/tsc --project tsconfig.build.json --module es2015 --outDir build/es2015; @echo "es6 done" - @./node_modules/.bin/tsc --project tsconfig.json --module commonjs --outDir build/commonjs \ + @./node_modules/.bin/tsc --project tsconfig.build.json --module commonjs --outDir build/commonjs \ --declaration --declarationDir build/types; @echo "cjs done" diff --git a/packages/grpcweb-transport/karma.conf.js b/packages/grpcweb-transport/karma.conf.js index 21205dfe..6afbd45a 100644 --- a/packages/grpcweb-transport/karma.conf.js +++ b/packages/grpcweb-transport/karma.conf.js @@ -21,6 +21,11 @@ module.exports = function (config) { browsers: ["ChromeHeadless"], singleRun: true, karmaTypescriptConfig: { + coverageOptions: { + exclude: [ + /(^|\/)spec\//i, + ] + }, tsconfig: './tsconfig.test.json' }, client: { diff --git a/packages/grpcweb-transport/tsconfig.build.json b/packages/grpcweb-transport/tsconfig.build.json new file mode 100644 index 00000000..f5c51096 --- /dev/null +++ b/packages/grpcweb-transport/tsconfig.build.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "paths": {}, + } +} diff --git a/packages/grpcweb-transport/tsconfig.json b/packages/grpcweb-transport/tsconfig.json index 1389e998..c42de84a 100644 --- a/packages/grpcweb-transport/tsconfig.json +++ b/packages/grpcweb-transport/tsconfig.json @@ -11,6 +11,9 @@ "moduleResolution": "node", "forceConsistentCasingInFileNames": true, "skipLibCheck": false, + "paths": { + "@protobuf-ts/*": ["../*/src"] + }, "lib": [ "es2017", "dom" diff --git a/packages/grpcweb-transport/tsconfig.test.json b/packages/grpcweb-transport/tsconfig.test.json index 993b2e1a..de4ea76b 100644 --- a/packages/grpcweb-transport/tsconfig.test.json +++ b/packages/grpcweb-transport/tsconfig.test.json @@ -7,7 +7,6 @@ "compilerOptions": { "sourceMap": true, "module": "CommonJS", - "declaration": false, - "paths": {} + "declaration": false } } diff --git a/packages/plugin-framework/Makefile b/packages/plugin-framework/Makefile index ae742de1..75e7026b 100644 --- a/packages/plugin-framework/Makefile +++ b/packages/plugin-framework/Makefile @@ -7,9 +7,9 @@ SPECS := $(shell find spec -name '*.spec.ts') default: clean build test build: - @./node_modules/.bin/tsc --project tsconfig.json --module es2015 --outDir build/es2015; + @./node_modules/.bin/tsc --project tsconfig.build.json --module es2015 --outDir build/es2015; @echo "es6 done" - @./node_modules/.bin/tsc --project tsconfig.json --module commonjs --outDir build/commonjs \ + @./node_modules/.bin/tsc --project tsconfig.build.json --module commonjs --outDir build/commonjs \ --declaration --declarationDir build/types; @echo "cjs done" diff --git a/packages/plugin-framework/tsconfig.build.json b/packages/plugin-framework/tsconfig.build.json new file mode 100644 index 00000000..f5c51096 --- /dev/null +++ b/packages/plugin-framework/tsconfig.build.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "paths": {}, + } +} diff --git a/packages/plugin-framework/tsconfig.json b/packages/plugin-framework/tsconfig.json index 1389e998..c42de84a 100644 --- a/packages/plugin-framework/tsconfig.json +++ b/packages/plugin-framework/tsconfig.json @@ -11,6 +11,9 @@ "moduleResolution": "node", "forceConsistentCasingInFileNames": true, "skipLibCheck": false, + "paths": { + "@protobuf-ts/*": ["../*/src"] + }, "lib": [ "es2017", "dom" diff --git a/packages/plugin-framework/tsconfig.test.json b/packages/plugin-framework/tsconfig.test.json index 54f71afd..3fc2de49 100644 --- a/packages/plugin-framework/tsconfig.test.json +++ b/packages/plugin-framework/tsconfig.test.json @@ -7,10 +7,7 @@ "compilerOptions": { "module": "CommonJS", "declaration": false, - "paths": { - "@protobuf-ts/runtime": [ - "../runtime" - ] - } + "sourceMap": true, + "paths": {} } } diff --git a/packages/plugin/spec/protobufts-plugin-long.spec.ts b/packages/plugin/spec/protobufts-plugin-long.spec.ts index cac19d2d..073d3734 100644 --- a/packages/plugin/spec/protobufts-plugin-long.spec.ts +++ b/packages/plugin/spec/protobufts-plugin-long.spec.ts @@ -1,6 +1,6 @@ import {getCodeGeneratorRequest} from "./support/helpers"; import {ProtobuftsPlugin} from "../src/protobufts-plugin"; -import {GeneratedFile} from "@protobuf-ts/plugin-framework/src"; +import {GeneratedFile} from "@protobuf-ts/plugin-framework"; const stringSnippets = [ // Message diff --git a/packages/plugin/tsconfig.build.json b/packages/plugin/tsconfig.build.json index 793add63..53da35b9 100644 --- a/packages/plugin/tsconfig.build.json +++ b/packages/plugin/tsconfig.build.json @@ -4,6 +4,9 @@ "src/protobufts-plugin.ts", "src/dump-plugin.ts" ], + "compilerOptions": { + "paths": {}, + }, "include": [ "src/**/*.d.ts" ], diff --git a/packages/plugin/tsconfig.json b/packages/plugin/tsconfig.json index 5655ddae..5032eff5 100644 --- a/packages/plugin/tsconfig.json +++ b/packages/plugin/tsconfig.json @@ -12,6 +12,9 @@ "resolveJsonModule": true, "forceConsistentCasingInFileNames": true, "skipLibCheck": false, + "paths": { + "@protobuf-ts/*": ["../*/src"] + }, "lib": [ "es2017", "dom" diff --git a/packages/plugin/tsconfig.test.json b/packages/plugin/tsconfig.test.json index 51ba865c..3ac880fe 100644 --- a/packages/plugin/tsconfig.test.json +++ b/packages/plugin/tsconfig.test.json @@ -5,11 +5,11 @@ "spec/support/*.ts" ], "compilerOptions": { + "skipLibCheck": true, + "sourceMap": true, "outDir": "/tmp", "paths": { - "@protobuf-ts/runtime": [ - "../runtime" - ] - } + "@protobuf-ts/*": ["../*/src"] + }, } } diff --git a/packages/runtime-rpc/Makefile b/packages/runtime-rpc/Makefile index 358c2f06..140e804f 100644 --- a/packages/runtime-rpc/Makefile +++ b/packages/runtime-rpc/Makefile @@ -5,9 +5,9 @@ SPECS := $(shell find spec -name '*.spec.ts') default: clean build test build: - @./node_modules/.bin/tsc --project tsconfig.json --module es2015 --outDir build/es2015; + @./node_modules/.bin/tsc --project tsconfig.build.json --module es2015 --outDir build/es2015; @echo "es6 done" - @./node_modules/.bin/tsc --project tsconfig.json --module commonjs --outDir build/commonjs \ + @./node_modules/.bin/tsc --project tsconfig.build.json --module commonjs --outDir build/commonjs \ --declaration --declarationDir build/types; @echo "cjs done" diff --git a/packages/runtime-rpc/karma.conf.js b/packages/runtime-rpc/karma.conf.js index 21205dfe..6afbd45a 100644 --- a/packages/runtime-rpc/karma.conf.js +++ b/packages/runtime-rpc/karma.conf.js @@ -21,6 +21,11 @@ module.exports = function (config) { browsers: ["ChromeHeadless"], singleRun: true, karmaTypescriptConfig: { + coverageOptions: { + exclude: [ + /(^|\/)spec\//i, + ] + }, tsconfig: './tsconfig.test.json' }, client: { diff --git a/packages/runtime-rpc/tsconfig.build.json b/packages/runtime-rpc/tsconfig.build.json new file mode 100644 index 00000000..f5c51096 --- /dev/null +++ b/packages/runtime-rpc/tsconfig.build.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "paths": {}, + } +} diff --git a/packages/runtime-rpc/tsconfig.json b/packages/runtime-rpc/tsconfig.json index 479014a1..70df6efc 100644 --- a/packages/runtime-rpc/tsconfig.json +++ b/packages/runtime-rpc/tsconfig.json @@ -17,6 +17,9 @@ // svelte requires this option "importsNotUsedAsValues": "error", + "paths": { + "@protobuf-ts/*": ["../*/src"] + }, "lib": [ "es2017", "dom", diff --git a/packages/runtime-rpc/tsconfig.test.json b/packages/runtime-rpc/tsconfig.test.json index 864575dc..437d99e0 100644 --- a/packages/runtime-rpc/tsconfig.test.json +++ b/packages/runtime-rpc/tsconfig.test.json @@ -7,6 +7,6 @@ "compilerOptions": { "module": "CommonJS", "declaration": false, - "paths": {} + "sourceMap": true } } diff --git a/packages/runtime/karma.conf.js b/packages/runtime/karma.conf.js index 21205dfe..6afbd45a 100644 --- a/packages/runtime/karma.conf.js +++ b/packages/runtime/karma.conf.js @@ -21,6 +21,11 @@ module.exports = function (config) { browsers: ["ChromeHeadless"], singleRun: true, karmaTypescriptConfig: { + coverageOptions: { + exclude: [ + /(^|\/)spec\//i, + ] + }, tsconfig: './tsconfig.test.json' }, client: { diff --git a/packages/runtime/tsconfig.base.json b/packages/runtime/tsconfig.base.json index af849bf4..7fd83a58 100644 --- a/packages/runtime/tsconfig.base.json +++ b/packages/runtime/tsconfig.base.json @@ -19,10 +19,8 @@ ], "paths": { - "@protobuf-ts/runtime": [ - "./src" - ] - } + "@protobuf-ts/*": ["../*/src"] + }, } } diff --git a/packages/runtime/tsconfig.build.json b/packages/runtime/tsconfig.build.json index d9c3c433..2cc5415d 100644 --- a/packages/runtime/tsconfig.build.json +++ b/packages/runtime/tsconfig.build.json @@ -5,5 +5,6 @@ ], "include": [], "compilerOptions": { + "paths": {}, } } diff --git a/packages/runtime/tsconfig.test.json b/packages/runtime/tsconfig.test.json index 577a70d4..e6a812a1 100644 --- a/packages/runtime/tsconfig.test.json +++ b/packages/runtime/tsconfig.test.json @@ -6,6 +6,7 @@ "spec/**/*.ts" ], "compilerOptions": { + "sourceMap": true, "module": "CommonJS" } } diff --git a/packages/test-generated/Makefile b/packages/test-generated/Makefile index e2e32a05..367da588 100644 --- a/packages/test-generated/Makefile +++ b/packages/test-generated/Makefile @@ -19,7 +19,7 @@ clean: test-spec: @./node_modules/.bin/ts-node \ - --project tsconfig.json \ + --project tsconfig.test.json \ --require tsconfig-paths/register \ ./node_modules/.bin/jasmine --helper="spec/support/reporter.ts" \ $(SPECS) diff --git a/packages/test-generated/tsconfig.bigint.json b/packages/test-generated/tsconfig.bigint.json index cfe24a0a..205aed5c 100644 --- a/packages/test-generated/tsconfig.bigint.json +++ b/packages/test-generated/tsconfig.bigint.json @@ -1,5 +1,5 @@ { - "extends": "./tsconfig.json", + "extends": "./tsconfig.test.json", "compilerOptions": { // compiler requires this target for bigint diff --git a/packages/test-generated/tsconfig.json b/packages/test-generated/tsconfig.json index c51b7bbc..08309f4d 100644 --- a/packages/test-generated/tsconfig.json +++ b/packages/test-generated/tsconfig.json @@ -9,18 +9,6 @@ "module": "CommonJS", "target": "ES2015", "baseUrl": "./", - - - // activated for issue #3 - // react sets this option, breaking const enum - "isolatedModules": true, - - - // activated for issue #94 - // svelte requires this option - "importsNotUsedAsValues": "error", - - "strict": true, "lib": [ "es2017", @@ -28,9 +16,7 @@ "es2020.bigint" ], "paths": { - "@protobuf-ts/runtime": [ - "../runtime" - ] - } + "@protobuf-ts/*": ["../*/src"] + }, } } diff --git a/packages/test-generated/tsconfig.test.json b/packages/test-generated/tsconfig.test.json new file mode 100644 index 00000000..83e16a80 --- /dev/null +++ b/packages/test-generated/tsconfig.test.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + // activated for issue #3 + // react sets this option, breaking const enum + "isolatedModules": true, + + + // activated for issue #94 + // svelte requires this option + "importsNotUsedAsValues": "error", + "paths": {}, + } +} diff --git a/packages/twirp-transport/Makefile b/packages/twirp-transport/Makefile index 3f77faba..b5f6b174 100644 --- a/packages/twirp-transport/Makefile +++ b/packages/twirp-transport/Makefile @@ -5,9 +5,9 @@ SPECS := $(shell find spec -name '*.spec.ts') default: clean build test clientcompat build: - @./node_modules/.bin/tsc --project tsconfig.json --module es2015 --outDir build/es2015; + @./node_modules/.bin/tsc --project tsconfig.build.json --module es2015 --outDir build/es2015; @echo "es6 done" - @./node_modules/.bin/tsc --project tsconfig.json --module commonjs --outDir build/commonjs \ + @./node_modules/.bin/tsc --project tsconfig.build.json --module commonjs --outDir build/commonjs \ --declaration --declarationDir build/types; @echo "cjs done" diff --git a/packages/twirp-transport/karma.conf.js b/packages/twirp-transport/karma.conf.js index 21205dfe..6afbd45a 100644 --- a/packages/twirp-transport/karma.conf.js +++ b/packages/twirp-transport/karma.conf.js @@ -21,6 +21,11 @@ module.exports = function (config) { browsers: ["ChromeHeadless"], singleRun: true, karmaTypescriptConfig: { + coverageOptions: { + exclude: [ + /(^|\/)spec\//i, + ] + }, tsconfig: './tsconfig.test.json' }, client: { diff --git a/packages/twirp-transport/tsconfig.build.json b/packages/twirp-transport/tsconfig.build.json new file mode 100644 index 00000000..f5c51096 --- /dev/null +++ b/packages/twirp-transport/tsconfig.build.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "paths": {}, + } +} diff --git a/packages/twirp-transport/tsconfig.json b/packages/twirp-transport/tsconfig.json index 732607f9..52eefa85 100644 --- a/packages/twirp-transport/tsconfig.json +++ b/packages/twirp-transport/tsconfig.json @@ -11,6 +11,9 @@ "moduleResolution": "node", "forceConsistentCasingInFileNames": true, "skipLibCheck": false, + "paths": { + "@protobuf-ts/*": ["../*/src"] + }, "lib": [ "es2017", "es2015.collection", diff --git a/packages/twirp-transport/tsconfig.test.json b/packages/twirp-transport/tsconfig.test.json index 864575dc..437d99e0 100644 --- a/packages/twirp-transport/tsconfig.test.json +++ b/packages/twirp-transport/tsconfig.test.json @@ -7,6 +7,6 @@ "compilerOptions": { "module": "CommonJS", "declaration": false, - "paths": {} + "sourceMap": true } }