@openapi-typescript-infra/service 6.3.3 → 6.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/Makefile +17 -4
  2. package/package.json +1 -1
package/Makefile CHANGED
@@ -26,21 +26,34 @@ endif
26
26
 
27
27
  build_dir := $(shell node -e "console.log(require('./package.json').exports.replace(/^.\//, '').split('/')[0])")
28
28
  src_files := $(shell find src -name '*.ts')
29
- build_files := $(patsubst src/%.ts,$(build_dir)/%.js,$(src_files))
29
+ ts_sources := $(shell find src -name '*.ts' -not -name '*.d.ts')
30
+ build_files := $(patsubst src/%.ts,$(build_dir)/%.js,$(ts_sources))
31
+ build_dts := $(patsubst src/%.ts,$(build_dir)/%.d.ts,$(ts_sources))
32
+ build_maps := $(patsubst src/%.ts,$(build_dir)/%.js.map,$(ts_sources))
33
+ ts_outputs := $(build_files) $(build_dts) $(build_maps)
34
+ ts_build_stamp := $(build_dir)/.tsbuild.stamp
35
+ missing_ts_outputs := $(filter-out $(wildcard $(ts_outputs)), $(ts_outputs))
30
36
  camel_case_name := $(shell echo $(SERVICE_NAME) | awk -F- '{result=""; for(i=1; i<=NF; i++) result = result toupper(substr($$i,1,1)) substr($$i,2); print result}' | tr -d '\n')
31
37
  # tsgo is pretty cool. Maybe you should try it?
32
38
  TSC ?= tsc
33
39
 
34
- ts: $(word 1, $(build_files))
40
+ ts: $(ts_build_stamp)
35
41
 
36
42
  clean:
37
43
  yarn dlx rimraf ./$(build_dir) src/generated tsconfig.build.tsbuildinfo
38
44
 
39
- $(word 1, $(build_files)): $(src_files)
40
- yarn $(TSC) -p tsconfig.build.json
45
+ $(ts_build_stamp): $(src_files) tsconfig.build.json tsconfig.json $(if $(missing_ts_outputs),FORCE,)
46
+ yarn $(TSC) -p tsconfig.build.json --noEmitOnError
41
47
  @if yarn info tsc-alias name > /dev/null 2>&1; then \
42
48
  yarn tsc-alias -f --project tsconfig.build.json; \
43
49
  fi
50
+ @mkdir -p $(build_dir)
51
+ @touch $@
52
+
53
+ $(ts_outputs): $(ts_build_stamp)
54
+
55
+ .PHONY: FORCE
56
+ FORCE:
44
57
 
45
58
  service: src/generated/service/index.ts
46
59
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openapi-typescript-infra/service",
3
- "version": "6.3.3",
3
+ "version": "6.4.1",
4
4
  "description": "An opinionated framework for building configuration driven services - web, api, or ob. Uses OpenAPI, pino logging, express, confit, Typescript and vitest.",
5
5
  "exports": {
6
6
  ".": {