create-platformatic 0.38.1 → 0.39.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-platformatic",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.0",
|
|
4
4
|
"description": "Create platformatic-db interactive tool",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"semver": "^7.5.1",
|
|
35
35
|
"undici": "^5.22.1",
|
|
36
36
|
"which": "^3.0.1",
|
|
37
|
-
"@platformatic/config": "0.
|
|
37
|
+
"@platformatic/config": "0.39.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"ajv": "^8.12.0",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"tap": "^16.3.6",
|
|
48
48
|
"typescript": "~5.2.0",
|
|
49
49
|
"yaml": "^2.3.1",
|
|
50
|
-
"@platformatic/db": "0.
|
|
51
|
-
"@platformatic/service": "0.
|
|
50
|
+
"@platformatic/db": "0.39.0",
|
|
51
|
+
"@platformatic/service": "0.39.0"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"test": "standard | snazzy && cross-env NODE_OPTIONS=\"--loader=esmock --no-warnings\" c8 tap --no-coverage test/*test.mjs test/*/*test.mjs",
|
package/src/ghaction.mjs
CHANGED
|
@@ -113,7 +113,7 @@ export const createDynamicWorkspaceGHAction = async (logger, env, config, projec
|
|
|
113
113
|
if (!isGithubActionExists) {
|
|
114
114
|
await mkdir(join(projectDir, '.github', 'workflows'), { recursive: true })
|
|
115
115
|
await writeFile(ghActionFilePath, dynamicWorkspaceGHTemplate(env, config, buildTS))
|
|
116
|
-
logger.info('Github action successfully created, please add the following secrets as repository secrets: ')
|
|
116
|
+
logger.info('PR Previews are enabled for your app and the Github action was successfully created, please add the following secrets as repository secrets: ')
|
|
117
117
|
const secretsString = formatSecretsToAdd({
|
|
118
118
|
PLATFORMATIC_DYNAMIC_WORKSPACE_ID: 'your workspace id',
|
|
119
119
|
PLATFORMATIC_DYNAMIC_WORKSPACE_API_KEY: 'your workspace API key',
|
|
@@ -135,7 +135,7 @@ export const askDynamicWorkspaceCreateGHAction = async (logger, env, type, build
|
|
|
135
135
|
{
|
|
136
136
|
type: 'list',
|
|
137
137
|
name: 'githubAction',
|
|
138
|
-
message: 'Do you want to
|
|
138
|
+
message: 'Do you want to enable PR Previews in your application?',
|
|
139
139
|
default: true,
|
|
140
140
|
choices: [{ name: 'yes', value: true }, { name: 'no', value: false }]
|
|
141
141
|
}
|
|
@@ -31,7 +31,7 @@ const env = {
|
|
|
31
31
|
|
|
32
32
|
test('creates gh action', async ({ equal, match }) => {
|
|
33
33
|
await createDynamicWorkspaceGHAction(fakeLogger, env, 'db', tmpDir, false)
|
|
34
|
-
equal(log[0], 'Github action successfully created, please add the following secrets as repository secrets: ')
|
|
34
|
+
equal(log[0], 'PR Previews are enabled for your app and the Github action was successfully created, please add the following secrets as repository secrets: ')
|
|
35
35
|
const accessible = await isFileAccessible(join(tmpDir, '.github/workflows/platformatic-dynamic-workspace-deploy.yml'))
|
|
36
36
|
equal(accessible, true)
|
|
37
37
|
const ghFile = await readFile(join(tmpDir, '.github/workflows/platformatic-dynamic-workspace-deploy.yml'), 'utf8')
|
|
@@ -50,7 +50,7 @@ test('creates gh action', async ({ equal, match }) => {
|
|
|
50
50
|
|
|
51
51
|
test('creates gh action with TS build step', async ({ equal, match }) => {
|
|
52
52
|
await createDynamicWorkspaceGHAction(fakeLogger, env, 'db', tmpDir, true)
|
|
53
|
-
equal(log[0], 'Github action successfully created, please add the following secrets as repository secrets: ')
|
|
53
|
+
equal(log[0], 'PR Previews are enabled for your app and the Github action was successfully created, please add the following secrets as repository secrets: ')
|
|
54
54
|
const accessible = await isFileAccessible(join(tmpDir, '.github/workflows/platformatic-dynamic-workspace-deploy.yml'))
|
|
55
55
|
equal(accessible, true)
|
|
56
56
|
const ghFile = await readFile(join(tmpDir, '.github/workflows/platformatic-dynamic-workspace-deploy.yml'), 'utf8')
|
|
@@ -78,7 +78,7 @@ test('do not create gitignore file because already present', async ({ end, equal
|
|
|
78
78
|
|
|
79
79
|
test('creates gh action with a warn if a .git folder is not present', async ({ end, equal }) => {
|
|
80
80
|
await createDynamicWorkspaceGHAction(fakeLogger, env, 'db', tmpDir)
|
|
81
|
-
equal(log[0], 'Github action successfully created, please add the following secrets as repository secrets: ')
|
|
81
|
+
equal(log[0], 'PR Previews are enabled for your app and the Github action was successfully created, please add the following secrets as repository secrets: ')
|
|
82
82
|
const accessible = await isFileAccessible(join(tmpDir, '.github/workflows/platformatic-dynamic-workspace-deploy.yml'))
|
|
83
83
|
equal(accessible, true)
|
|
84
84
|
const secretsLogLine = log[1].split('\n')
|
|
@@ -91,7 +91,7 @@ test('creates gh action with a warn if a .git folder is not present', async ({ e
|
|
|
91
91
|
test('creates gh action without a warn if a .git folder is present', async ({ end, equal }) => {
|
|
92
92
|
await mkdir(join(tmpDir, '.git'), { recursive: true })
|
|
93
93
|
await createDynamicWorkspaceGHAction(fakeLogger, env, 'db', tmpDir)
|
|
94
|
-
equal(log[0], 'Github action successfully created, please add the following secrets as repository secrets: ')
|
|
94
|
+
equal(log[0], 'PR Previews are enabled for your app and the Github action was successfully created, please add the following secrets as repository secrets: ')
|
|
95
95
|
const accessible = await isFileAccessible(join(tmpDir, '.github/workflows/platformatic-dynamic-workspace-deploy.yml'))
|
|
96
96
|
equal(accessible, true)
|
|
97
97
|
equal(log.length, 2)
|