@cap-js/cds-types 0.4.0 → 0.6.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cap-js/cds-types",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Type definitions for main packages of CAP, like `@sap/cds`",
5
5
  "repository": "github:cap-js/cds-types",
6
6
  "homepage": "https://cap.cloud.sap/",
@@ -14,21 +14,24 @@
14
14
  "typings": "dist/cds-types.d.ts",
15
15
  "files": [
16
16
  "dist/",
17
+ "scripts/",
17
18
  "LICENSE",
18
19
  "README.md"
19
20
  ],
20
21
  "scripts": {
21
22
  "test": "jest --silent",
23
+ "test:rollup": "npm run rollup; npm run rollup:on; npm run test; npm run rollup:off",
22
24
  "rollup": "rm -rf dist/ && mkdir -p etc/ && npx -y @microsoft/api-extractor run --local --verbose && .github/rollup-patch.js",
23
25
  "rollup:on": "npm pkg set typings=dist/cds-types.d.ts && [ -d 'apis' ] && mv -- apis -apis || true",
24
26
  "rollup:off": "npm pkg set typings=apis/cds.d.ts && [ -d '-apis' ] && mv -- -apis apis || true",
25
27
  "lint": "npx eslint .",
26
28
  "lint:fix": "npx eslint . --fix",
27
29
  "setup": "npm i && npm i file:. --no-save --force",
28
- "prerelease:ci-fix": ".github/prerelease-fix.js"
30
+ "prerelease:ci-fix": ".github/prerelease-fix.js",
31
+ "postinstall": "./scripts/postinstall.js"
29
32
  },
30
33
  "peerDependencies": {
31
- "@sap/cds": ">=7 || ^8.0.0-beta"
34
+ "@sap/cds": "^8.0.0"
32
35
  },
33
36
  "dependencies": {
34
37
  "@types/express": "^4.17.21"
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+
3
+ /* eslint-disable @typescript-eslint/no-var-requires*/
4
+ /* eslint-disable no-undef */
5
+ const fs = require('node:fs')
6
+ const { join } = require('node:path')
7
+
8
+ if (!process.env.INIT_CWD) return
9
+ // TODO: check if were in a local install
10
+ const nodeModules = join(process.env.INIT_CWD, 'node_modules')
11
+ if (!fs.existsSync(nodeModules)) return
12
+ const typesDir = join(nodeModules, '@types')
13
+ if (!fs.existsSync(typesDir)) fs.mkdirSync(typesDir)
14
+ fs.symlink(join(nodeModules, '@cap-js', 'cds-types'), join(typesDir, 'sap__cds'), () => {})