@take-out/scripts 0.1.35 → 0.1.37

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/package.json +2 -2
  2. package/src/release.ts +27 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@take-out/scripts",
3
- "version": "0.1.35",
3
+ "version": "0.1.37",
4
4
  "type": "module",
5
5
  "main": "./src/run.ts",
6
6
  "sideEffects": false,
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "@clack/prompts": "^0.8.2",
32
32
  "@lydell/node-pty": "^1.2.0-beta.3",
33
- "@take-out/helpers": "0.1.35",
33
+ "@take-out/helpers": "0.1.37",
34
34
  "picocolors": "^1.1.1"
35
35
  },
36
36
  "peerDependencies": {
package/src/release.ts CHANGED
@@ -12,7 +12,8 @@ await cmd`publish takeout packages to npm`
12
12
  `--patch boolean --minor boolean --major boolean --canary boolean
13
13
  --rerun boolean --republish boolean --finish boolean --skip-finish boolean
14
14
  --dry-run boolean --skip-test boolean --skip-build boolean --skip-version boolean
15
- --dirty boolean --tamagui-git-user boolean --sync-on-zero boolean --skip-on-zero-sync boolean`
15
+ --dirty boolean --tamagui-git-user boolean --sync-on-zero boolean --skip-on-zero-sync boolean
16
+ --undocumented boolean --skip-all boolean`
16
17
  )
17
18
  .run(async ({ args, $, run, path, os }) => {
18
19
  const fs = (await import('fs-extra')).default
@@ -27,17 +28,23 @@ await cmd`publish takeout packages to npm`
27
28
  const reRun = args.rerun
28
29
  const rePublish = reRun || args.republish
29
30
  const finish = args.finish
30
- const skipFinish = args.skipFinish
31
+ const skipAll = args.skipAll
32
+ const undocumented = args.undocumented
33
+ const skipFinish = args.skipFinish || skipAll || undocumented
31
34
 
32
35
  const canary = args.canary
33
36
  const skipVersion = finish || rePublish || args.skipVersion
34
37
  const shouldMajor = args.major
35
38
  const shouldMinor = args.minor
36
39
  const shouldPatch = args.patch
37
- const dirty = finish || args.dirty
40
+ const dirty = finish || undocumented || args.dirty
38
41
  const skipTest =
39
- finish || rePublish || args.skipTest || process.argv.includes('--skip-tests')
40
- const skipBuild = finish || rePublish || args.skipBuild
42
+ finish ||
43
+ rePublish ||
44
+ skipAll ||
45
+ args.skipTest ||
46
+ process.argv.includes('--skip-tests')
47
+ const skipBuild = finish || rePublish || skipAll || args.skipBuild
41
48
  const dryRun = args.dryRun
42
49
  const tamaguiGitUser = args.tamaguiGitUser
43
50
  const syncOnZeroOnly = args.syncOnZero
@@ -231,7 +238,14 @@ await cmd`publish takeout packages to npm`
231
238
  const curVersion = fs.readJSONSync('./packages/helpers/package.json').version
232
239
 
233
240
  // must specify version (unless republishing):
234
- if (!rePublish && !skipVersion && !shouldPatch && !shouldMinor && !shouldMajor) {
241
+ if (
242
+ !rePublish &&
243
+ !skipVersion &&
244
+ !canary &&
245
+ !shouldPatch &&
246
+ !shouldMinor &&
247
+ !shouldMajor
248
+ ) {
235
249
  console.error(`Must specify one of --patch, --minor, or --major`)
236
250
  process.exit(1)
237
251
  }
@@ -458,6 +472,13 @@ await cmd`publish takeout packages to npm`
458
472
  await run(`git checkout -- packages/*/package.json`, { silent: true })
459
473
  console.info('Reverted version changes\n')
460
474
  }
475
+
476
+ // restore package.json files for undocumented releases (no git history)
477
+ if (undocumented) {
478
+ console.info('restoring package.json files...')
479
+ await run(`git checkout -- packages/*/package.json`, { silent: true })
480
+ console.info(`✅ restored package.json files (undocumented release)\n`)
481
+ }
461
482
  }
462
483
 
463
484
  if (!skipFinish && !dryRun) {