@@ -97,12 +97,6 @@ async function main() {
97
97
await fs . mkdir ( sizeDir , { recursive : true } )
98
98
}
99
99
100
- // const rtsCachePath = path.resolve(__dirname, './node_modules/.rts2_cache')
101
- // if (isRelease && existsSync(rtsCachePath)) {
102
- // // remove build cache for release builds to avoid outdated enum values
103
- // await fs.rm(rtsCachePath, { recursive: true })
104
- // }
105
-
106
100
const resolvedTargets = targets . length
107
101
? await fuzzyMatchTarget ( targets , buildAllMatching )
108
102
: await allTargets ( )
@@ -175,109 +169,6 @@ async function main() {
175
169
prodOnly,
176
170
sourceMap
177
171
} )
178
- // const env =
179
- // (pkg.buildOptions && pkg.buildOptions.env) ||
180
- // (devOnly ? 'development' : 'production')
181
- // await execa(
182
- // 'rollup',
183
- // [
184
- // '-c',
185
- // '--environment',
186
- // [
187
- // `COMMIT:${commit}`,
188
- // `NODE_ENV:${env}`,
189
- // `TARGET:${target}`,
190
- // formats ? `FORMATS:${formats}` : ``,
191
- // buildTypes ? `TYPES:true` : ``,
192
- // prodOnly ? `PROD_ONLY:true` : ``,
193
- // sourceMap ? `SOURCE_MAP:true` : ``
194
- // ]
195
- // .filter(Boolean)
196
- // .join(',')
197
- // ],
198
- // { stdio: 'inherit' }
199
- // )
200
-
201
- /*
202
- if (buildTypes && pkg.types) {
203
- console.log()
204
- console.log(
205
- pc.bold(pc.yellow(`Rolling up type definitions for ${target}...`))
206
- )
207
-
208
- // build types
209
- const extractorConfigPath = path.resolve(pkgDir, `api-extractor.json`)
210
- const extractorConfig =
211
- ExtractorConfig.loadFileAndPrepare(extractorConfigPath)
212
- const extractorResult = Extractor.invoke(extractorConfig, {
213
- localBuild: true,
214
- showVerboseMessages: true
215
- })
216
-
217
- if (extractorResult.succeeded) {
218
- // concat additional d.ts to rolled-up dts
219
- const typesDir = path.resolve(pkgDir, 'types')
220
- if (existsSync(typesDir)) {
221
- const dtsPath = path.resolve(pkgDir, pkg.types)
222
- const existing = await fs.readFile(dtsPath, 'utf-8')
223
- const typeFiles = await fs.readdir(typesDir)
224
- const toAdd = await Promise.all(
225
- typeFiles.map(file =>
226
- fs.readFile(path.resolve(typesDir, file), 'utf-8')
227
- )
228
- )
229
- await fs.writeFile(dtsPath, existing + '\n' + toAdd.join('\n'))
230
- }
231
- console.log(pc.bold(pc.green(`API Extractor completed successfully.`)))
232
- } else {
233
- console.error(
234
- `API Extractor completed with ${extractorResult.errorCount} errors` +
235
- ` and ${extractorResult.warningCount} warnings`
236
- )
237
- process.exitCode = 1
238
- }
239
-
240
- if (['vue-i18n', 'petite-vue-i18n'].includes(target)) {
241
- console.log()
242
- console.log(
243
- pc.bold(pc.yellow(`Appending Vue type definitions for ${target}...`))
244
- )
245
-
246
- let content = ''
247
-
248
- try {
249
- content = await fs.readFile(
250
- path.resolve(pkgDir, 'src/vue.d.ts'),
251
- 'utf-8'
252
- )
253
- } catch (e) {
254
- console.error(
255
- `Failed in opening Vue type definition file with error code: ${(e as NodeJS.ErrnoException).code}`
256
- )
257
- process.exitCode = 1
258
- }
259
-
260
- try {
261
- const marker =
262
- '// --- THE CONTENT BELOW THIS LINE WILL BE APPENDED TO DTS FILE IN DIST DIRECTORY --- //'
263
- const data = content.slice(content.indexOf(marker) + marker.length)
264
-
265
- await fs.appendFile(path.resolve(pkgDir, `dist/${target}.d.ts`), data)
266
- } catch (e) {
267
- console.error('Failed in appending Vue type definitions', e)
268
- process.exitCode = 1
269
- }
270
-
271
- console.log(
272
- pc.bold(
273
- pc.green(`Appending Vue type definitions completed successfully.`)
274
- )
275
- )
276
- }
277
-
278
- await fs.rm(`${pkgDir}/dist/packages`, { recursive: true })
279
- }
280
- */
281
172
}
282
173
283
174
async function checkAllSizes ( targets : string [ ] ) {
0 commit comments