@pixpilot/scaffoldfy-configs 0.44.0 → 0.46.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @pixpilot/scaffoldfy-configs
2
2
 
3
+ ## 0.46.0
4
+
5
+ ### Minor Changes
6
+
7
+ - add CLI flags for answering prompts
8
+
9
+ ## 0.45.0
10
+
11
+ ### Minor Changes
12
+
13
+ - enhance release workflow outputs
14
+
3
15
  ## 0.44.0
4
16
 
5
17
  ### Minor Changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pixpilot/scaffoldfy-configs",
3
3
  "type": "module",
4
- "version": "0.44.0",
4
+ "version": "0.46.0",
5
5
  "author": "PixPilot <m.doaie@hotmail.com>",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -30,10 +30,10 @@
30
30
  "@types/node": "^22.18.11",
31
31
  "eslint": "^9.38.0",
32
32
  "@internal/eslint-config": "0.3.0",
33
- "@internal/prettier-config": "0.0.1",
34
- "@pixpilot/scaffoldfy": "0.56.0",
35
33
  "@internal/tsdown-config": "0.1.0",
36
- "@internal/vitest-config": "0.1.0"
34
+ "@internal/prettier-config": "0.0.1",
35
+ "@internal/vitest-config": "0.1.0",
36
+ "@pixpilot/scaffoldfy": "0.57.0"
37
37
  },
38
38
  "prettier": "@internal/prettier-config",
39
39
  "publishConfig": {
@@ -24,6 +24,10 @@ jobs:
24
24
  # Publishing targets GitHub Packages (publishConfig.registry in each package.json),
25
25
  # which authenticates with a token rather than npm OIDC trusted publishing.
26
26
  packages: write
27
+ outputs:
28
+ published: ${{ steps.release.outputs.published }}
29
+ published-versions: ${{ steps.release.outputs.published-versions }}
30
+ release-summary: ${{ steps.release.outputs.release-summary }}
27
31
 
28
32
  steps:
29
33
  - name: Generate bot app token
@@ -51,6 +55,7 @@ jobs:
51
55
  build: 'false'
52
56
 
53
57
  - name: Release
58
+ id: release
54
59
  uses: pixpilot/changesets-autopilot@v1
55
60
  with:
56
61
  GITHUB_TOKEN: ${{ steps.app_token.outputs.token }}
@@ -73,5 +78,9 @@ jobs:
73
78
  with:
74
79
  status: ${{ contains(needs.*.result, 'failure') && 'failure' || contains(needs.*.result, 'cancelled') && 'cancelled' || 'success' }}
75
80
  notify-on: any
81
+ # Names the released versions; an empty title falls back to the generated one.
82
+ title: ${{ needs.release.outputs.published == 'true' && format('Released {0} ({1})', needs.release.outputs.published-versions, github.repository) || '' }}
83
+ # Published packages, why nothing was published, or why the release failed.
84
+ message: ${{ needs.release.outputs.release-summary }}
76
85
  telegram-bot-token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
77
86
  telegram-chat-id: ${{ secrets.TELEGRAM_CHAT_ID }}
@@ -22,6 +22,10 @@ jobs:
22
22
  contents: write
23
23
  pull-requests: write
24
24
  id-token: write
25
+ outputs:
26
+ published: ${{ steps.release.outputs.published }}
27
+ published-versions: ${{ steps.release.outputs.published-versions }}
28
+ release-summary: ${{ steps.release.outputs.release-summary }}
25
29
 
26
30
  steps:
27
31
  - name: Generate bot app token
@@ -44,6 +48,7 @@ jobs:
44
48
  build: 'false'
45
49
 
46
50
  - name: Release
51
+ id: release
47
52
  uses: pixpilot/changesets-autopilot@v1
48
53
  with:
49
54
  GITHUB_TOKEN: ${{ steps.app_token.outputs.token }}
@@ -61,5 +66,9 @@ jobs:
61
66
  with:
62
67
  status: ${{ contains(needs.*.result, 'failure') && 'failure' || contains(needs.*.result, 'cancelled') && 'cancelled' || 'success' }}
63
68
  notify-on: any
69
+ # Names the released versions; an empty title falls back to the generated one.
70
+ title: ${{ needs.release.outputs.published == 'true' && format('Released {0} ({1})', needs.release.outputs.published-versions, github.repository) || '' }}
71
+ # Published packages, why nothing was published, or why the release failed.
72
+ message: ${{ needs.release.outputs.release-summary }}
64
73
  telegram-bot-token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
65
74
  telegram-chat-id: ${{ secrets.TELEGRAM_CHAT_ID }}
@@ -0,0 +1,46 @@
1
+ import path from 'node:path';
2
+ import {
3
+ loadTasksWithInheritance,
4
+ parseAnswerFlags,
5
+ resolveAnswerFlags,
6
+ } from '@pixpilot/scaffoldfy';
7
+ import { describe, expect, it } from 'vitest';
8
+
9
+ const configPath = path.join(__dirname, '..', 'workspace-initializer', 'scaffoldfy.json');
10
+
11
+ describe('workspace-initializer answer flags', () => {
12
+ it('should answer its own and extended prompts with flags', async () => {
13
+ const { configs = [] } = await loadTasksWithInheritance(configPath, {
14
+ sequential: true,
15
+ });
16
+ const prompts = configs.flatMap((config) => config.prompts ?? []);
17
+
18
+ const answers = resolveAnswerFlags(
19
+ parseAnswerFlags([
20
+ // workspace-initializer/scaffoldfy.json
21
+ '--keepExamplePackages',
22
+ '--no-create-first-package-prompt',
23
+ // extends ../pixpilot-changesets-release/scaffoldfy.json
24
+ '--release-to-github-packages=false',
25
+ // extends ../license-file/scaffoldfy.json
26
+ '--license-type',
27
+ 'MIT',
28
+ // extends ../security-policy/scaffoldfy.json
29
+ '--no-add-security-file',
30
+ // extends ../project-info/scaffoldfy.json, which extends ./project-name-info.json
31
+ '--project-name',
32
+ 'my-app',
33
+ ]),
34
+ prompts,
35
+ );
36
+
37
+ expect(answers).toEqual({
38
+ keepExamplePackages: 'true',
39
+ createFirstPackagePrompt: 'false',
40
+ releaseToGitHubPackages: 'false',
41
+ licenseType: 'MIT',
42
+ addSecurityFile: 'false',
43
+ projectName: 'my-app',
44
+ });
45
+ });
46
+ });