@pixpilot/scaffoldfy-configs 0.45.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,11 @@
1
1
  # @pixpilot/scaffoldfy-configs
2
2
 
3
+ ## 0.46.0
4
+
5
+ ### Minor Changes
6
+
7
+ - add CLI flags for answering prompts
8
+
3
9
  ## 0.45.0
4
10
 
5
11
  ### 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.45.0",
4
+ "version": "0.46.0",
5
5
  "author": "PixPilot <m.doaie@hotmail.com>",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -33,7 +33,7 @@
33
33
  "@internal/tsdown-config": "0.1.0",
34
34
  "@internal/prettier-config": "0.0.1",
35
35
  "@internal/vitest-config": "0.1.0",
36
- "@pixpilot/scaffoldfy": "0.56.0"
36
+ "@pixpilot/scaffoldfy": "0.57.0"
37
37
  },
38
38
  "prettier": "@internal/prettier-config",
39
39
  "publishConfig": {
@@ -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
+ });