Skip to content

Commit

Permalink
fix: angular release process (#6468)
Browse files Browse the repository at this point in the history
RELEASE_ALL

* fix: make sure there is only one package.json after build

* fix: angular release

we cannot publish out of the build directory because pnpm doesn't see it as a workspace, so it won't replace workspace dependencies. To fix this, we:

- make the publish script point to the root directory (config.js)
- make sure our top-level package.json has types and exports and that they point to ./build
- make sure to remove the build/package.json after the build script ran

* chore: use rimraf

* chore: specify files to limit what we include

* chore: fix relative workspace dependencies

* chore: fix ci.json

* fix: package.json path
  • Loading branch information
TkDodo committed Dec 1, 2023
1 parent 3a60413 commit 4e8a6c5
Show file tree
Hide file tree
Showing 6 changed files with 332 additions and 117 deletions.
2 changes: 1 addition & 1 deletion .codesandbox/ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"/examples/svelte/basic",
"/examples/vue/basic"
],
"packages": ["packages/**", "!packages/angular*", "packages/angular-query-devtools-experimental/build", "packages/angular-query-experimental/build"],
"packages": ["packages/**"],
"node": "18"
}
4 changes: 2 additions & 2 deletions integrations/angular-cli-standalone-17/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"@angular/common": "^17.0.2",
"@angular/core": "^17.0.2",
"@angular/platform-browser": "^17.0.2",
"@tanstack/angular-query-experimental": "workspace:../../packages/angular-query-experimental/build",
"@tanstack/angular-query-devtools-experimental": "workspace:../../packages/angular-query-devtools-experimental/build",
"@tanstack/angular-query-experimental": "workspace:*",
"@tanstack/angular-query-devtools-experimental": "workspace:*",
"rxjs": "^7.8.1",
"tslib": "^2.6.2",
"zone.js": "^0.14.2"
Expand Down
21 changes: 19 additions & 2 deletions packages/angular-query-devtools-experimental/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@
},
"type": "module",
"sideEffects": false,
"files": [
"build",
"src"
],
"scripts": {
"clean": "rimraf ./build && rimraf ./coverage",
"test:eslint": "eslint --ext .ts,.tsx ./src",
"test:types": "tsc",
"test:build": "publint --strict",
"build": "ng-packagr -p ng-package.json -c tsconfig.build.json"
"build": "ng-packagr -p ng-package.json -c tsconfig.build.json && rimraf ./build/package.json"
},
"dependencies": {
"@tanstack/query-devtools": "workspace:*",
Expand All @@ -30,12 +34,25 @@
"devDependencies": {
"@angular/compiler-cli": "^17.0.2",
"@angular/core": "^17.0.2",
"@tanstack/angular-query-experimental": "workspace:../angular-query-experimental/build",
"@tanstack/angular-query-experimental": "workspace:*",
"ng-packagr": "^17.0.0",
"typescript": "5.2.2",
"zone.js": "^0.14.2"
},
"peerDependencies": {
"@angular/core": "^17"
},
"module": "build/fesm2022/tanstack-angular-query-devtools-experimental.mjs",
"types": "build/index.d.ts",
"exports": {
"./package.json": {
"default": "./package.json"
},
".": {
"types": "./build/index.d.ts",
"esm2022": "./build/esm2022/tanstack-angular-query-devtools-experimental.mjs",
"esm": "./build/esm2022/tanstack-angular-query-devtools-experimental.mjs",
"default": "./build/fesm2022/tanstack-angular-query-devtools-experimental.mjs"
}
}
}
19 changes: 18 additions & 1 deletion packages/angular-query-experimental/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@
},
"type": "module",
"sideEffects": false,
"files": [
"build",
"src"
],
"scripts": {
"clean": "rimraf ./build && rimraf ./coverage",
"test:eslint": "eslint --ext .ts,.tsx ./src",
"test:types": "tsc",
"test:lib": "vitest run --coverage",
"test:lib:dev": "vitest watch --coverage",
"test:build": "publint --strict",
"build": "ng-packagr -p ng-package.json -c tsconfig.build.json"
"build": "ng-packagr -p ng-package.json -c tsconfig.build.json && rimraf ./build/package.json"
},
"dependencies": {
"@tanstack/query-core": "workspace:*",
Expand All @@ -44,5 +48,18 @@
},
"peerDependencies": {
"@angular/core": "^17"
},
"module": "build/fesm2022/tanstack-angular-query-experimental.mjs",
"types": "build/index.d.ts",
"exports": {
"./package.json": {
"default": "./package.json"
},
".": {
"types": "./build/index.d.ts",
"esm2022": "./build/esm2022/tanstack-angular-query-experimental.mjs",
"esm": "./build/esm2022/tanstack-angular-query-experimental.mjs",
"default": "./build/fesm2022/tanstack-angular-query-experimental.mjs"
}
}
}

0 comments on commit 4e8a6c5

Please sign in to comment.