create-platformatic 0.14.0 → 0.15.1
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/package.json +4 -3
- package/src/ghaction.mjs +3 -0
- package/test/ghaction.test.mjs +8 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-platformatic",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"description": "Create platformatic-db interactive tool",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"commist": "^3.2.0",
|
|
19
19
|
"desm": "^1.3.0",
|
|
20
20
|
"es-main": "^1.2.0",
|
|
21
|
-
"execa": "^
|
|
21
|
+
"execa": "^7.0.0",
|
|
22
22
|
"fastify": "^4.10.2",
|
|
23
23
|
"help-me": "^4.2.0",
|
|
24
24
|
"inquirer": "^9.1.4",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"yaml": "^2.1.3"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
|
-
"test": "standard | snazzy && NODE_OPTIONS=--loader=esmock c8 --100 tap --no-coverage test/*test.mjs test/*/*test.mjs"
|
|
45
|
+
"test": "standard | snazzy && NODE_OPTIONS=--loader=esmock c8 --100 tap --no-coverage test/*test.mjs test/*/*test.mjs",
|
|
46
|
+
"lint": "standard | snazzy"
|
|
46
47
|
}
|
|
47
48
|
}
|
package/src/ghaction.mjs
CHANGED
package/test/ghaction.test.mjs
CHANGED
|
@@ -37,13 +37,16 @@ test('creates gh action', async ({ end, equal }) => {
|
|
|
37
37
|
equal(accessible, true)
|
|
38
38
|
const ghFile = await readFile(join(tmpDir, '.github/workflows/platformatic-deploy.yml'), 'utf8')
|
|
39
39
|
const ghAction = parse(ghFile)
|
|
40
|
-
const steps = ghAction.jobs.build_and_deploy
|
|
40
|
+
const { steps, permissions } = ghAction.jobs.build_and_deploy
|
|
41
41
|
equal(steps.length, 3)
|
|
42
42
|
equal(steps[0].name, 'Checkout application project repository')
|
|
43
43
|
equal(steps[1].name, 'npm install --omit=dev')
|
|
44
44
|
equal(steps[2].name, 'Deploy project')
|
|
45
45
|
equal(steps[2].env.DATABASE_URL, 'mydbconnectionstring')
|
|
46
46
|
equal(steps[2].env.PLT_SERVER_LOGGER_LEVEL, 'info')
|
|
47
|
+
|
|
48
|
+
equal(permissions.contents, 'read')
|
|
49
|
+
equal(permissions['pull-requests'], 'write')
|
|
47
50
|
})
|
|
48
51
|
|
|
49
52
|
test('creates gh action with TS build step', async ({ end, equal }) => {
|
|
@@ -53,7 +56,7 @@ test('creates gh action with TS build step', async ({ end, equal }) => {
|
|
|
53
56
|
equal(accessible, true)
|
|
54
57
|
const ghFile = await readFile(join(tmpDir, '.github/workflows/platformatic-deploy.yml'), 'utf8')
|
|
55
58
|
const ghAction = parse(ghFile)
|
|
56
|
-
const steps = ghAction.jobs.build_and_deploy
|
|
59
|
+
const { steps, permissions } = ghAction.jobs.build_and_deploy
|
|
57
60
|
equal(steps.length, 4)
|
|
58
61
|
equal(steps[0].name, 'Checkout application project repository')
|
|
59
62
|
equal(steps[1].name, 'npm install --omit=dev')
|
|
@@ -61,6 +64,9 @@ test('creates gh action with TS build step', async ({ end, equal }) => {
|
|
|
61
64
|
equal(steps[3].name, 'Deploy project')
|
|
62
65
|
equal(steps[3].env.DATABASE_URL, 'mydbconnectionstring')
|
|
63
66
|
equal(steps[3].env.PLT_SERVER_LOGGER_LEVEL, 'info')
|
|
67
|
+
|
|
68
|
+
equal(permissions.contents, 'read')
|
|
69
|
+
equal(permissions['pull-requests'], 'write')
|
|
64
70
|
})
|
|
65
71
|
|
|
66
72
|
test('do not create gitignore file because already present', async ({ end, equal }) => {
|