create-platformatic 1.8.0 → 1.9.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.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/src/ghaction.mjs +18 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-platformatic",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "Create platformatic-db interactive tool",
5
5
  "repository": {
6
6
  "type": "git",
@@ -35,7 +35,7 @@
35
35
  "strip-ansi": "^7.1.0",
36
36
  "undici": "^5.25.4",
37
37
  "which": "^3.0.1",
38
- "@platformatic/config": "1.8.0"
38
+ "@platformatic/config": "1.9.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "ajv": "^8.12.0",
@@ -48,8 +48,8 @@
48
48
  "tap": "^16.3.9",
49
49
  "typescript": "~5.2.2",
50
50
  "yaml": "^2.3.2",
51
- "@platformatic/db": "1.8.0",
52
- "@platformatic/service": "1.8.0"
51
+ "@platformatic/db": "1.9.0",
52
+ "@platformatic/service": "1.9.0"
53
53
  },
54
54
  "scripts": {
55
55
  "test:cli": "tap --no-coverage test/cli/*test.mjs -t120",
package/src/ghaction.mjs CHANGED
@@ -3,12 +3,12 @@ import { isFileAccessible, safeMkdir } from './utils.mjs'
3
3
  import { writeFile } from 'fs/promises'
4
4
  import columnify from 'columnify'
5
5
  function envAsString (env, indent) {
6
- const spaces = Array(indent * 2).join(' ')
6
+ const spaces = ' '.repeat(indent * 2)
7
7
  return Object.keys(env).reduce((acc, key) => {
8
8
  if (key.match('DATABASE_URL')) {
9
9
  acc += `${spaces}${key}: \${{ secrets.${key} }}\n`
10
10
  } else {
11
- acc += `${spaces}${key}: ${env[key]} \n`
11
+ acc += `${spaces}${key}: ${env[key]}\n`
12
12
  }
13
13
 
14
14
  return acc
@@ -32,7 +32,13 @@ function formatSecretsToAdd (secrets) {
32
32
  }
33
33
  export const dynamicWorkspaceGHTemplate = (env, config, buildTS = false) => {
34
34
  const envString = envAsString(env, 3)
35
-
35
+ let envBlock = ''
36
+ if (envString.length) {
37
+ envBlock = `
38
+ env:
39
+ ${envString}
40
+ `
41
+ }
36
42
  return `name: Deploy Platformatic application to the cloud
37
43
  on:
38
44
  pull_request:
@@ -52,8 +58,7 @@ jobs:
52
58
  contents: read
53
59
  pull-requests: write
54
60
  runs-on: ubuntu-latest
55
- env:
56
- ${envString}
61
+ ${envBlock}
57
62
  steps:
58
63
  - name: Checkout application project repository
59
64
  uses: actions/checkout@v3
@@ -94,6 +99,13 @@ ${envString}
94
99
 
95
100
  export const staticWorkspaceGHTemplate = (env, config, buildTS = false) => {
96
101
  const envString = envAsString(env, 3)
102
+ let envBlock = ''
103
+ if (envString.length) {
104
+ envBlock = `
105
+ env:
106
+ ${envString}
107
+ `
108
+ }
97
109
 
98
110
  return `name: Deploy Platformatic application to the cloud
99
111
  on:
@@ -111,8 +123,7 @@ jobs:
111
123
  permissions:
112
124
  contents: read
113
125
  runs-on: ubuntu-latest
114
- env:
115
- ${envString}
126
+ ${envBlock}
116
127
  steps:
117
128
  - name: Checkout application project repository
118
129
  uses: actions/checkout@v3