|
1 | 1 | import { log, runCommand } from '@stacksjs/cli' |
2 | | -// generates the pkgx file based on the user configuration |
| 2 | +// generates the pantry file based on the user configuration |
3 | 3 | import { config } from '@stacksjs/config' |
4 | | - |
5 | | -// @ts-expect-error - no types |
6 | | -import data from '../../../../../pkgx.yaml' |
| 4 | +import data from '../../../../../pantry.yaml' |
7 | 5 |
|
8 | 6 | if (!data) |
9 | | - throw new Error('pkgx.yaml file not found') |
| 7 | + throw new Error('pantry.yaml file not found') |
10 | 8 |
|
11 | 9 | if (data.dependencies['aws.amazon.com/cdk'] === undefined) { |
12 | | - log.info('aws.amazon.com/cdk dependency not found in pkgx.yaml.') |
| 10 | + log.info('aws.amazon.com/cdk dependency not found in pantry.yaml.') |
13 | 11 | // throw an error unless its installed locally |
14 | 12 | const result = await runCommand('which cdk') |
15 | 13 | if (result.isErr()) |
16 | | - throw new Error('aws.amazon.com/cdk dependency not found in pkgx.yaml. To confirm, run `which cdk`') |
| 14 | + throw new Error('aws.amazon.com/cdk dependency not found in pantry.yaml. To confirm, run `which cdk`') |
17 | 15 | } |
18 | 16 |
|
19 | 17 | if (data.dependencies['aws.amazon.com/cli'] === undefined) { |
20 | | - log.info('aws.amazon.com/cli dependency not found in pkgx.yaml.') |
| 18 | + log.info('aws.amazon.com/cli dependency not found in pantry.yaml.') |
21 | 19 | const result = await runCommand('which aws') |
22 | 20 | if (result.isErr()) |
23 | | - throw new Error('aws.amazon.com/cli dependency not found in pkgx.yaml. To confirm, run `which aws`') |
| 21 | + throw new Error('aws.amazon.com/cli dependency not found in pantry.yaml. To confirm, run `which aws`') |
24 | 22 | } |
25 | 23 |
|
26 | 24 | if (data.dependencies['bun.sh'] === undefined) { |
27 | | - log.info('bun.sh dependency not found in pkgx.yaml.') |
| 25 | + log.info('bun.sh dependency not found in pantry.yaml.') |
28 | 26 | // throw an error unless its installed locally |
29 | 27 | const result = await runCommand('which aws') |
30 | 28 | if (result.isErr()) |
31 | | - throw new Error('bun.sh dependency not found in pkgx.yaml. To confirm, run `which bun`') |
| 29 | + throw new Error('bun.sh dependency not found in pantry.yaml. To confirm, run `which bun`') |
32 | 30 | } |
33 | 31 |
|
34 | 32 | if (data.dependencies['info-zip.org/zip'] === undefined) { |
35 | | - log.info('info-zip.org/zip dependency not found in pkgx.yaml.') |
| 33 | + log.info('info-zip.org/zip dependency not found in pantry.yaml.') |
36 | 34 | // throw an error unless its installed locally |
37 | 35 | const result = await runCommand('which zip') |
38 | 36 | if (result.isErr()) |
39 | | - throw new Error('info-zip.org/zip dependency not found in pkgx.yaml. To confirm, run `which zip`') |
| 37 | + throw new Error('info-zip.org/zip dependency not found in pantry.yaml. To confirm, run `which zip`') |
40 | 38 | } |
41 | 39 |
|
42 | 40 | if (data.dependencies['info-zip.org/unzip'] === undefined) { |
43 | | - log.info('info-zip.org/unzip dependency not found in pkgx.yaml.') |
| 41 | + log.info('info-zip.org/unzip dependency not found in pantry.yaml.') |
44 | 42 | // throw an error unless its installed locally |
45 | 43 | const result = await runCommand('which unzip') |
46 | 44 | if (result.isErr()) |
47 | | - throw new Error('info-zip.org/unzip dependency not found in pkgx.yaml. To confirm, run `which unzip`') |
| 45 | + throw new Error('info-zip.org/unzip dependency not found in pantry.yaml. To confirm, run `which unzip`') |
48 | 46 | } |
49 | 47 |
|
50 | 48 | if (data.dependencies['mailpit.axllent.org'] === undefined) { |
51 | | - log.info('mailpit.axllent.org dependency not found in pkgx.yaml.') |
| 49 | + log.info('mailpit.axllent.org dependency not found in pantry.yaml.') |
52 | 50 | // throw an error unless its installed locally |
53 | 51 | const result = await runCommand('which mailpit') |
54 | 52 | if (result.isErr()) |
55 | | - throw new Error('mailpit.axllent.org dependency not found in pkgx.yaml. To confirm, run `which mailpit`') |
| 53 | + throw new Error('mailpit.axllent.org dependency not found in pantry.yaml. To confirm, run `which mailpit`') |
56 | 54 | } |
57 | 55 |
|
58 | 56 | if (data.dependencies['redis.io'] === undefined) { |
59 | | - log.info('redis.io dependency not found in pkgx.yaml.') |
| 57 | + log.info('redis.io dependency not found in pantry.yaml.') |
60 | 58 | // throw an error unless its installed locally |
61 | 59 | const result = await runCommand('which redis') |
62 | 60 | if (result.isErr()) |
63 | | - throw new Error('redis.io dependency not found in pkgx.yaml. To confirm, run `which redis`') |
| 61 | + throw new Error('redis.io dependency not found in pantry.yaml. To confirm, run `which redis`') |
64 | 62 | } |
65 | 63 |
|
66 | 64 | if (config.database.default === 'sqlite' && data.dependencies['sqlite.org'] === undefined) { |
67 | | - log.info('sqlite.org dependency not found in pkgx.yaml.') |
| 65 | + log.info('sqlite.org dependency not found in pantry.yaml.') |
68 | 66 | // throw an error unless its installed locally |
69 | 67 | const result = await runCommand('which sqlite') |
70 | 68 | if (result.isErr()) |
71 | | - throw new Error('sqlite.org dependency not found in pkgx.yaml. To confirm, run `which sqlite`') |
| 69 | + throw new Error('sqlite.org dependency not found in pantry.yaml. To confirm, run `which sqlite`') |
72 | 70 | } |
0 commit comments