@sanity/pkg-utils 2.2.15 → 2.2.17
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/dist/_chunks/{build-ba8f4eab.cjs → build-45e5ded8.cjs} +3 -3
- package/dist/_chunks/build-45e5ded8.cjs.map +1 -0
- package/dist/_chunks/{buildAction-f35f5fe0.cjs → buildAction-afc0a1a6.cjs} +2 -2
- package/dist/_chunks/{buildAction-f35f5fe0.cjs.map → buildAction-afc0a1a6.cjs.map} +1 -1
- package/dist/_chunks/{check-c18ac13f.cjs → check-33e163bb.cjs} +10 -19
- package/dist/_chunks/check-33e163bb.cjs.map +1 -0
- package/dist/_chunks/{checkAction-be47c642.cjs → checkAction-6fd7b2bc.cjs} +2 -2
- package/dist/_chunks/{checkAction-be47c642.cjs.map → checkAction-6fd7b2bc.cjs.map} +1 -1
- package/dist/_chunks/{index-b295a336.cjs → index-f3c22a05.cjs} +4 -3
- package/dist/_chunks/index-f3c22a05.cjs.map +1 -0
- package/dist/_chunks/{resolveBuildContext-2239fc5e.cjs → resolveBuildContext-6666f1ab.cjs} +19 -17
- package/dist/_chunks/resolveBuildContext-6666f1ab.cjs.map +1 -0
- package/dist/_chunks/{watch-5bfb8b28.cjs → watch-2bff1357.cjs} +3 -3
- package/dist/_chunks/watch-2bff1357.cjs.map +1 -0
- package/dist/_chunks/{watchAction-788563ea.cjs → watchAction-39b0210b.cjs} +2 -2
- package/dist/_chunks/{watchAction-788563ea.cjs.map → watchAction-39b0210b.cjs.map} +1 -1
- package/dist/cli.cjs +7 -7
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.js +18 -26
- package/dist/index.js.map +1 -1
- package/package.json +102 -96
- package/src/cli/index.ts +4 -3
- package/src/node/build.ts +1 -1
- package/src/node/check.ts +4 -2
- package/src/node/core/config/findConfigFile.ts +6 -14
- package/src/node/core/config/index.ts +1 -1
- package/src/node/core/config/loadConfig.ts +2 -1
- package/src/node/core/contexts/buildContext.ts +2 -1
- package/src/node/core/findCommonPath.test.ts +1 -0
- package/src/node/core/index.ts +2 -2
- package/src/node/core/pkg/loadPkg.ts +1 -0
- package/src/node/core/pkg/loadPkgWithReporting.ts +1 -0
- package/src/node/core/pkg/validatePkg.ts +1 -0
- package/src/node/fileExists.ts +12 -0
- package/src/node/globFiles.ts +1 -1
- package/src/node/printExtractMessages.ts +2 -1
- package/src/node/printPackageTree.ts +4 -13
- package/src/node/resolveBuildContext.ts +5 -4
- package/src/node/resolveBuildTasks.ts +2 -1
- package/src/node/resolveWatchTasks.ts +3 -2
- package/src/node/tasks/dts/buildTypes.ts +1 -0
- package/src/node/tasks/dts/createApiExtractorConfig.ts +1 -1
- package/src/node/tasks/dts/createTSDocConfig.ts +1 -1
- package/src/node/tasks/dts/doExtract.ts +2 -1
- package/src/node/tasks/dts/dtsTask.ts +1 -0
- package/src/node/tasks/dts/dtsWatchTask.ts +1 -0
- package/src/node/tasks/dts/extractTypes.ts +4 -3
- package/src/node/tasks/dts/getExtractMessagesConfig.ts +2 -1
- package/src/node/tasks/dts/printDiagnostic.ts +2 -1
- package/src/node/tasks/index.ts +1 -1
- package/src/node/tasks/node/reexportCjsTask.ts +3 -2
- package/src/node/tasks/rollup/resolveRollupConfig.ts +2 -1
- package/src/node/tasks/rollup/rollupTask.ts +2 -1
- package/src/node/tasks/rollup/rollupWatchTask.ts +2 -1
- package/src/node/tasks/types.ts +2 -1
- package/src/node/watch.ts +2 -1
- package/src/node/watchConfigFiles.ts +1 -0
- package/dist/_chunks/build-ba8f4eab.cjs.map +0 -1
- package/dist/_chunks/check-c18ac13f.cjs.map +0 -1
- package/dist/_chunks/index-b295a336.cjs.map +0 -1
- package/dist/_chunks/resolveBuildContext-2239fc5e.cjs.map +0 -1
- package/dist/_chunks/watch-5bfb8b28.cjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"type": "module",
|
|
3
2
|
"name": "@sanity/pkg-utils",
|
|
4
|
-
"version": "2.2.
|
|
5
|
-
"author": "Sanity.io <hello@sanity.io>",
|
|
6
|
-
"license": "MIT",
|
|
3
|
+
"version": "2.2.17",
|
|
7
4
|
"description": "Simple utilities for modern npm packages.",
|
|
8
5
|
"keywords": [
|
|
9
6
|
"sanity-io",
|
|
@@ -14,10 +11,17 @@
|
|
|
14
11
|
"build",
|
|
15
12
|
"bundling"
|
|
16
13
|
],
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
"homepage": "https://github.com/sanity-io/pkg-utils#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/sanity-io/pkg-utils/issues"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+ssh://git@github.com/sanity-io/pkg-utils.git"
|
|
21
|
+
},
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"author": "Sanity.io <hello@sanity.io>",
|
|
24
|
+
"type": "module",
|
|
21
25
|
"exports": {
|
|
22
26
|
".": {
|
|
23
27
|
"types": "./dist/index.d.ts",
|
|
@@ -28,6 +32,10 @@
|
|
|
28
32
|
},
|
|
29
33
|
"./package.json": "./package.json"
|
|
30
34
|
},
|
|
35
|
+
"main": "./dist/index.cjs",
|
|
36
|
+
"module": "./dist/index.js",
|
|
37
|
+
"source": "./src/node/index.ts",
|
|
38
|
+
"types": "./dist/index.d.ts",
|
|
31
39
|
"bin": {
|
|
32
40
|
"pkg": "./bin/pkg-utils.cjs",
|
|
33
41
|
"pkg-utils": "./bin/pkg-utils.cjs"
|
|
@@ -46,7 +54,7 @@
|
|
|
46
54
|
"clean": "rimraf dist",
|
|
47
55
|
"commit": "cz",
|
|
48
56
|
"extract": "sanity-tsdoc etl --outDir etc/api/@sanity/pkg-utils --tsconfig tsconfig.dist.json",
|
|
49
|
-
"format": "prettier --write --cache --ignore-unknown .",
|
|
57
|
+
"format": "prettier --write --cache --ignore-unknown . && eslint . --ext .cjs,.js,.ts,.tsx --fix --quiet",
|
|
50
58
|
"lint": "eslint . --ext .cjs,.js,.ts,.tsx",
|
|
51
59
|
"playground:build": "pnpm --filter './playground/**' build",
|
|
52
60
|
"playground:clean": "pnpm --filter './playground/**' --silent clean",
|
|
@@ -55,145 +63,143 @@
|
|
|
55
63
|
"test": "run-s playground:clean && rimraf test/env/__tmp__ && vitest run",
|
|
56
64
|
"watch": "node --loader esbuild-register/loader -r esbuild-register scripts/watch"
|
|
57
65
|
},
|
|
66
|
+
"commitlint": {
|
|
67
|
+
"extends": [
|
|
68
|
+
"@commitlint/config-conventional"
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
"lint-staged": {
|
|
72
|
+
"*": [
|
|
73
|
+
"prettier --write --cache --ignore-unknown",
|
|
74
|
+
"eslint --ext .cjs,.js,.ts,.tsx --fix"
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
"prettier": {
|
|
78
|
+
"bracketSpacing": false,
|
|
79
|
+
"plugins": [
|
|
80
|
+
"prettier-plugin-packagejson"
|
|
81
|
+
],
|
|
82
|
+
"printWidth": 100,
|
|
83
|
+
"semi": false,
|
|
84
|
+
"singleQuote": true,
|
|
85
|
+
"tabWidth": 2,
|
|
86
|
+
"overrides": [
|
|
87
|
+
{
|
|
88
|
+
"files": [
|
|
89
|
+
"*.json5"
|
|
90
|
+
],
|
|
91
|
+
"options": {
|
|
92
|
+
"quoteProps": "preserve",
|
|
93
|
+
"singleQuote": false
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"files": [
|
|
98
|
+
"*.yml"
|
|
99
|
+
],
|
|
100
|
+
"options": {
|
|
101
|
+
"singleQuote": false
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
"release": {
|
|
107
|
+
"branches": [
|
|
108
|
+
"+([0-9])?(.{+([0-9]),x}).x",
|
|
109
|
+
"main",
|
|
110
|
+
"next",
|
|
111
|
+
{
|
|
112
|
+
"name": "beta",
|
|
113
|
+
"prerelease": true
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "alpha",
|
|
117
|
+
"prerelease": true
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
"extends": "@sanity/semantic-release-preset"
|
|
121
|
+
},
|
|
58
122
|
"dependencies": {
|
|
59
|
-
"@babel/core": "^7.
|
|
60
|
-
"@babel/preset-env": "^7.
|
|
61
|
-
"@babel/types": "^7.
|
|
62
|
-
"@microsoft/api-extractor": "^7.
|
|
123
|
+
"@babel/core": "^7.22.1",
|
|
124
|
+
"@babel/preset-env": "^7.22.2",
|
|
125
|
+
"@babel/types": "^7.22.3",
|
|
126
|
+
"@microsoft/api-extractor": "^7.35.0",
|
|
63
127
|
"@microsoft/tsdoc-config": "^0.16.2",
|
|
64
128
|
"@rollup/plugin-alias": "^5.0.0",
|
|
65
129
|
"@rollup/plugin-babel": "^6.0.3",
|
|
66
130
|
"@rollup/plugin-commonjs": "^25.0.0",
|
|
67
131
|
"@rollup/plugin-json": "^6.0.0",
|
|
68
|
-
"@rollup/plugin-node-resolve": "^15.0.
|
|
132
|
+
"@rollup/plugin-node-resolve": "^15.0.2",
|
|
69
133
|
"@rollup/plugin-replace": "^5.0.2",
|
|
70
|
-
"@rollup/plugin-terser": "^0.4.
|
|
71
|
-
"browserslist": "^4.21.
|
|
134
|
+
"@rollup/plugin-terser": "^0.4.3",
|
|
135
|
+
"browserslist": "^4.21.7",
|
|
72
136
|
"cac": "^6.7.14",
|
|
73
137
|
"chalk": "^4.1.2",
|
|
74
138
|
"chokidar": "^3.5.3",
|
|
75
|
-
"esbuild": "^0.17.
|
|
139
|
+
"esbuild": "^0.17.19",
|
|
76
140
|
"esbuild-register": "^3.4.2",
|
|
77
141
|
"find-config": "^1.0.0",
|
|
78
142
|
"globby": "^11.1.0",
|
|
79
143
|
"jsonc-parser": "^3.2.0",
|
|
80
|
-
"mkdirp": "^3.0.
|
|
144
|
+
"mkdirp": "^3.0.1",
|
|
81
145
|
"pkg-up": "^3.1.0",
|
|
82
|
-
"prettier": "^2.8.
|
|
146
|
+
"prettier": "^2.8.8",
|
|
83
147
|
"pretty-bytes": "^5.6.0",
|
|
84
|
-
"recast": "^0.23.
|
|
85
|
-
"rimraf": "^5.0.
|
|
86
|
-
"rollup": "^3.
|
|
148
|
+
"recast": "^0.23.2",
|
|
149
|
+
"rimraf": "^5.0.1",
|
|
150
|
+
"rollup": "^3.23.0",
|
|
87
151
|
"rollup-plugin-esbuild": "^5.0.0",
|
|
88
|
-
"rxjs": "^7.8.
|
|
152
|
+
"rxjs": "^7.8.1",
|
|
89
153
|
"treeify": "^1.1.0",
|
|
90
154
|
"uuid": "^9.0.0",
|
|
91
155
|
"zod": "^3.21.4"
|
|
92
156
|
},
|
|
93
157
|
"devDependencies": {
|
|
94
|
-
"@commitlint/cli": "^17.
|
|
95
|
-
"@commitlint/config-conventional": "^17.
|
|
158
|
+
"@commitlint/cli": "^17.6.3",
|
|
159
|
+
"@commitlint/config-conventional": "^17.6.3",
|
|
96
160
|
"@sanity/pkg-utils": "workspace:*",
|
|
97
161
|
"@sanity/semantic-release-preset": "4.1.1",
|
|
98
|
-
"@types/babel__core": "^7.20.
|
|
162
|
+
"@types/babel__core": "^7.20.1",
|
|
99
163
|
"@types/cpx": "^1.5.2",
|
|
100
164
|
"@types/find-config": "^1.0.1",
|
|
101
|
-
"@types/node": "^
|
|
165
|
+
"@types/node": "^20.2.5",
|
|
102
166
|
"@types/prettier": "^2.7.2",
|
|
103
167
|
"@types/treeify": "^1.0.0",
|
|
104
168
|
"@types/uuid": "^9.0.1",
|
|
105
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
106
|
-
"@typescript-eslint/parser": "^5.
|
|
169
|
+
"@typescript-eslint/eslint-plugin": "^5.59.7",
|
|
170
|
+
"@typescript-eslint/parser": "^5.59.7",
|
|
107
171
|
"commitizen": "^4.3.0",
|
|
108
172
|
"cpx": "^1.5.0",
|
|
109
173
|
"cz-conventional-changelog": "^3.3.0",
|
|
110
|
-
"eslint": "^8.
|
|
174
|
+
"eslint": "^8.41.0",
|
|
111
175
|
"eslint-config-prettier": "^8.8.0",
|
|
112
176
|
"eslint-plugin-import": "^2.27.5",
|
|
113
177
|
"eslint-plugin-prettier": "^4.2.1",
|
|
178
|
+
"eslint-plugin-simple-import-sort": "10.0.0",
|
|
114
179
|
"husky": "^8.0.3",
|
|
115
|
-
"lint-staged": "^13.2.
|
|
180
|
+
"lint-staged": "^13.2.2",
|
|
116
181
|
"npm-run-all": "^4.1.5",
|
|
117
182
|
"outdent": "^0.8.0",
|
|
183
|
+
"prettier-plugin-packagejson": "^2.4.3",
|
|
118
184
|
"rollup-plugin-visualizer": "^5.9.0",
|
|
119
|
-
"semantic-release": "^21.0.
|
|
185
|
+
"semantic-release": "^21.0.2",
|
|
120
186
|
"ts-node": "^10.9.1",
|
|
121
|
-
"typescript": "^5.0.
|
|
122
|
-
"vitest": "^0.31.
|
|
187
|
+
"typescript": "^5.0.4",
|
|
188
|
+
"vitest": "^0.31.1"
|
|
123
189
|
},
|
|
124
190
|
"peerDependencies": {
|
|
125
191
|
"typescript": "^4.7 || ^5"
|
|
126
192
|
},
|
|
193
|
+
"packageManager": "pnpm@8.6.0",
|
|
127
194
|
"engines": {
|
|
128
|
-
"node": ">=
|
|
129
|
-
},
|
|
130
|
-
"lint-staged": {
|
|
131
|
-
"*": [
|
|
132
|
-
"prettier --write --cache --ignore-unknown"
|
|
133
|
-
]
|
|
134
|
-
},
|
|
135
|
-
"repository": {
|
|
136
|
-
"type": "git",
|
|
137
|
-
"url": "git+ssh://git@github.com/sanity-io/pkg-utils.git"
|
|
138
|
-
},
|
|
139
|
-
"bugs": {
|
|
140
|
-
"url": "https://github.com/sanity-io/pkg-utils/issues"
|
|
141
|
-
},
|
|
142
|
-
"homepage": "https://github.com/sanity-io/pkg-utils#readme",
|
|
143
|
-
"commitlint": {
|
|
144
|
-
"extends": [
|
|
145
|
-
"@commitlint/config-conventional"
|
|
146
|
-
]
|
|
195
|
+
"node": ">=16.0.0"
|
|
147
196
|
},
|
|
148
197
|
"publishConfig": {
|
|
149
198
|
"access": "public"
|
|
150
199
|
},
|
|
151
|
-
"packageManager": "pnpm@7.32.4",
|
|
152
200
|
"pnpm": {
|
|
153
201
|
"overrides": {
|
|
154
202
|
"@sanity/pkg-utils": "workspace:*"
|
|
155
203
|
}
|
|
156
|
-
},
|
|
157
|
-
"prettier": {
|
|
158
|
-
"bracketSpacing": false,
|
|
159
|
-
"printWidth": 100,
|
|
160
|
-
"semi": false,
|
|
161
|
-
"singleQuote": true,
|
|
162
|
-
"tabWidth": 2,
|
|
163
|
-
"overrides": [
|
|
164
|
-
{
|
|
165
|
-
"files": [
|
|
166
|
-
"*.json5"
|
|
167
|
-
],
|
|
168
|
-
"options": {
|
|
169
|
-
"singleQuote": false,
|
|
170
|
-
"quoteProps": "preserve"
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
"files": [
|
|
175
|
-
"*.yml"
|
|
176
|
-
],
|
|
177
|
-
"options": {
|
|
178
|
-
"singleQuote": false
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
]
|
|
182
|
-
},
|
|
183
|
-
"release": {
|
|
184
|
-
"extends": "@sanity/semantic-release-preset",
|
|
185
|
-
"branches": [
|
|
186
|
-
"+([0-9])?(.{+([0-9]),x}).x",
|
|
187
|
-
"main",
|
|
188
|
-
"next",
|
|
189
|
-
{
|
|
190
|
-
"name": "beta",
|
|
191
|
-
"prerelease": true
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
"name": "alpha",
|
|
195
|
-
"prerelease": true
|
|
196
|
-
}
|
|
197
|
-
]
|
|
198
204
|
}
|
|
199
205
|
}
|
package/src/cli/index.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import cac from 'cac'
|
|
2
|
+
|
|
2
3
|
import {version} from '../../package.json'
|
|
3
4
|
|
|
4
5
|
const cli = cac()
|
|
5
6
|
|
|
6
|
-
// default commands checks package status
|
|
7
7
|
cli
|
|
8
8
|
.command('', 'Check')
|
|
9
|
+
.alias('check') // alias to align with the action name
|
|
9
10
|
.option('--strict', 'Strict mode')
|
|
10
11
|
.option('--tsconfig [tsconfig]', '[string] tsconfig.json')
|
|
11
12
|
.action(async (options) => {
|
|
12
|
-
const {checkAction
|
|
13
|
+
const {checkAction} = await import('./checkAction')
|
|
13
14
|
|
|
14
|
-
return
|
|
15
|
+
return checkAction(options)
|
|
15
16
|
})
|
|
16
17
|
|
|
17
18
|
cli
|
package/src/node/build.ts
CHANGED
|
@@ -3,7 +3,7 @@ import {createLogger} from './logger'
|
|
|
3
3
|
import {resolveBuildContext} from './resolveBuildContext'
|
|
4
4
|
import {resolveBuildTasks} from './resolveBuildTasks'
|
|
5
5
|
import {createSpinner} from './spinner'
|
|
6
|
-
import {BuildTask,
|
|
6
|
+
import {BuildTask, buildTaskHandlers, TaskHandler} from './tasks'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Build the distribution files of a npm package.
|
package/src/node/check.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import path from 'path'
|
|
2
1
|
import esbuild, {BuildFailure} from 'esbuild'
|
|
2
|
+
import path from 'path'
|
|
3
|
+
|
|
3
4
|
import {getPkgExtMap, loadConfig, loadPkgWithReporting} from './core'
|
|
5
|
+
import {fileExists} from './fileExists'
|
|
4
6
|
import {createLogger} from './logger'
|
|
5
|
-
import {
|
|
7
|
+
import {printPackageTree} from './printPackageTree'
|
|
6
8
|
import {resolveBuildContext} from './resolveBuildContext'
|
|
7
9
|
|
|
8
10
|
/** @public */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {stat} from 'fs/promises'
|
|
2
|
-
import path from 'path'
|
|
3
1
|
import findConfig from 'find-config'
|
|
2
|
+
import path from 'path'
|
|
3
|
+
|
|
4
|
+
import {fileExists} from '../../fileExists'
|
|
4
5
|
|
|
5
6
|
const CONFIG_FILE_NAMES = [
|
|
6
7
|
'package.config.ts',
|
|
@@ -9,7 +10,8 @@ const CONFIG_FILE_NAMES = [
|
|
|
9
10
|
'package.config.mjs',
|
|
10
11
|
]
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
/** @internal */
|
|
14
|
+
export function findConfigFile(cwd: string): string | undefined {
|
|
13
15
|
const pkgJsonPath = findConfig('package.json', {cwd})
|
|
14
16
|
|
|
15
17
|
if (!pkgJsonPath) return undefined
|
|
@@ -19,7 +21,7 @@ export async function findConfigFile(cwd: string): Promise<string | undefined> {
|
|
|
19
21
|
for (const fileName of CONFIG_FILE_NAMES) {
|
|
20
22
|
const configPath = path.resolve(pkgPath, fileName)
|
|
21
23
|
|
|
22
|
-
const exists =
|
|
24
|
+
const exists = fileExists(configPath)
|
|
23
25
|
|
|
24
26
|
if (exists) {
|
|
25
27
|
return configPath
|
|
@@ -28,13 +30,3 @@ export async function findConfigFile(cwd: string): Promise<string | undefined> {
|
|
|
28
30
|
|
|
29
31
|
return undefined
|
|
30
32
|
}
|
|
31
|
-
|
|
32
|
-
async function fileExists(filePath: string) {
|
|
33
|
-
try {
|
|
34
|
-
await stat(filePath)
|
|
35
|
-
|
|
36
|
-
return true
|
|
37
|
-
} catch (_) {
|
|
38
|
-
return false
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import ts from 'typescript'
|
|
2
|
+
|
|
2
3
|
import {Logger} from '../../logger'
|
|
3
|
-
import {PkgExports, PkgRuntime
|
|
4
|
+
import {PkgConfigOptions, PkgExports, PkgRuntime} from '../config'
|
|
4
5
|
import {PackageJSON, PkgExtMap} from '../pkg'
|
|
5
6
|
|
|
6
7
|
/** @internal */
|
package/src/node/core/index.ts
CHANGED
package/src/node/globFiles.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import path from 'path'
|
|
2
1
|
import {ExtractorMessage} from '@microsoft/api-extractor'
|
|
3
2
|
import chalk from 'chalk'
|
|
3
|
+
import path from 'path'
|
|
4
|
+
|
|
4
5
|
import {BuildContext} from './core'
|
|
5
6
|
|
|
6
7
|
export function printExtractMessages(ctx: BuildContext, messages: ExtractorMessage[]): void {
|
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
import fs from 'fs'
|
|
2
|
-
import path from 'path'
|
|
3
1
|
import chalk from 'chalk'
|
|
2
|
+
import path from 'path'
|
|
4
3
|
import treeify from 'treeify'
|
|
5
|
-
import {PkgExport, BuildContext} from './core'
|
|
6
|
-
import {getFilesize} from './getFilesize'
|
|
7
|
-
|
|
8
|
-
export function fileExists(file: string): boolean {
|
|
9
|
-
try {
|
|
10
|
-
fs.accessSync(file)
|
|
11
4
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
}
|
|
5
|
+
import {BuildContext, PkgExport} from './core'
|
|
6
|
+
import {fileExists} from './fileExists'
|
|
7
|
+
import {getFilesize} from './getFilesize'
|
|
17
8
|
|
|
18
9
|
function getFileInfo(cwd: string, filePath: string) {
|
|
19
10
|
const p = path.resolve(cwd, filePath)
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import path from 'path'
|
|
2
|
+
|
|
2
3
|
import {
|
|
3
|
-
PkgConfigOptions,
|
|
4
|
-
PkgExports,
|
|
5
|
-
PkgRuntime,
|
|
6
4
|
BuildContext,
|
|
7
5
|
DEFAULT_BROWSERSLIST_QUERY,
|
|
8
6
|
loadTSConfig,
|
|
9
7
|
PackageJSON,
|
|
10
8
|
parseExports,
|
|
11
|
-
|
|
9
|
+
PkgConfigOptions,
|
|
10
|
+
PkgExports,
|
|
12
11
|
PkgExtMap,
|
|
12
|
+
PkgRuntime,
|
|
13
|
+
resolveConfigProperty,
|
|
13
14
|
} from './core'
|
|
14
15
|
import {findCommonDirPath, pathContains} from './core/findCommonPath'
|
|
15
16
|
import {Logger} from './logger'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from 'fs'
|
|
2
2
|
import path from 'path'
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
import {BuildContext, PkgExport, PkgFormat, PkgRuntime} from './core'
|
|
4
5
|
import {BuildTask, DtsTask, NodeReExportFromCJSTask, RollupTask, RollupTaskEntry} from './tasks'
|
|
5
6
|
|
|
6
7
|
/** @internal */
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import fs from 'fs'
|
|
2
2
|
import path from 'path'
|
|
3
|
-
|
|
4
|
-
import {
|
|
3
|
+
|
|
4
|
+
import {BuildContext, PkgExport, PkgFormat, PkgRuntime} from './core'
|
|
5
|
+
import {DtsWatchTask, RollupTaskEntry, RollupWatchTask, WatchTask} from './tasks'
|
|
5
6
|
|
|
6
7
|
/** @internal */
|
|
7
8
|
export function resolveWatchTasks(ctx: BuildContext): WatchTask[] {
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import fs from 'fs/promises'
|
|
2
|
-
import path from 'path'
|
|
3
1
|
import {
|
|
4
2
|
Extractor,
|
|
5
3
|
ExtractorConfig,
|
|
6
4
|
ExtractorMessage,
|
|
7
5
|
ExtractorResult,
|
|
8
6
|
} from '@microsoft/api-extractor'
|
|
7
|
+
import fs from 'fs/promises'
|
|
9
8
|
import {mkdirp} from 'mkdirp'
|
|
9
|
+
import path from 'path'
|
|
10
10
|
import prettier from 'prettier'
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
import {BuildFile, PkgConfigOptions} from '../../core'
|
|
12
13
|
import {createApiExtractorConfig} from './createApiExtractorConfig'
|
|
13
14
|
import {createTSDocConfig} from './createTSDocConfig'
|
|
14
15
|
import {extractModuleBlocksFromTypes} from './extractModuleBlocks'
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {ExtractorLogLevel, IExtractorMessagesConfig} from '@microsoft/api-extractor'
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import {PkgConfigOptions, PkgRuleLevel} from '../../core'
|
|
3
4
|
|
|
4
5
|
const LOG_LEVELS: Record<PkgRuleLevel, ExtractorLogLevel> = {
|
|
5
6
|
error: 'error' as ExtractorLogLevel.Error,
|
package/src/node/tasks/index.ts
CHANGED
|
@@ -3,9 +3,9 @@ import {nodeReexportCjsTask} from './node/reexportCjsTask'
|
|
|
3
3
|
import {rollupTask, rollupWatchTask} from './rollup'
|
|
4
4
|
import {BuildTaskHandlers, WatchTaskHandlers} from './types'
|
|
5
5
|
|
|
6
|
-
export * from './types'
|
|
7
6
|
export * from './dts'
|
|
8
7
|
export * from './rollup'
|
|
8
|
+
export * from './types'
|
|
9
9
|
|
|
10
10
|
/** @internal */
|
|
11
11
|
export const buildTaskHandlers: BuildTaskHandlers = {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {writeFile} from 'fs/promises'
|
|
2
|
-
import path from 'path'
|
|
3
1
|
import chalk from 'chalk'
|
|
2
|
+
import {writeFile} from 'fs/promises'
|
|
4
3
|
import {mkdirp} from 'mkdirp'
|
|
4
|
+
import path from 'path'
|
|
5
5
|
import {from} from 'rxjs'
|
|
6
|
+
|
|
6
7
|
import {BuildContext} from '../../core'
|
|
7
8
|
import {NodeReExportFromCJSTask, TaskHandler} from '../types'
|
|
8
9
|
|