create-platformatic 0.34.0 → 0.35.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.34.0",
3
+ "version": "0.35.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.34.0"
37
+ "@platformatic/config": "0.35.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.1.6",
49
49
  "yaml": "^2.3.1",
50
- "@platformatic/db": "0.34.0",
51
- "@platformatic/service": "0.34.0"
50
+ "@platformatic/db": "0.35.0",
51
+ "@platformatic/service": "0.35.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",
@@ -148,7 +148,7 @@ export async function createDB ({ hostname, database = 'sqlite', port, migration
148
148
  const env = generateEnv(hostname, port, connectionString, typescript)
149
149
  const envFileExists = await isFileAccessible('.env', currentDir)
150
150
  await appendFile(join(currentDir, '.env'), env)
151
- await writeFile(join(currentDir, '.env.sample'), env)
151
+ await writeFile(join(currentDir, '.env.sample'), generateEnv(hostname, port, getConnectionString(database), typescript))
152
152
  /* c8 ignore next 5 */
153
153
  if (envFileExists) {
154
154
  logger.info('Environment file .env found, appending new environment variables to existing .env file.')
@@ -94,7 +94,8 @@ test('creates project with no typescript and no plugin', async ({ equal }) => {
94
94
  const params = {
95
95
  hostname: 'myhost',
96
96
  port: 6666,
97
- plugin: false
97
+ plugin: false,
98
+ connectionString: 'sqlite://./custom/path/to/db.sqlite'
98
99
  }
99
100
 
100
101
  await createDB(params, fakeLogger, tmpDir)
@@ -116,7 +117,7 @@ test('creates project with no typescript and no plugin', async ({ equal }) => {
116
117
  dotenv.config({ path: pathToDbEnvFile })
117
118
  equal(process.env.PLT_SERVER_HOSTNAME, 'myhost')
118
119
  equal(process.env.PORT, '6666')
119
- equal(process.env.DATABASE_URL, 'sqlite://./db.sqlite')
120
+ equal(process.env.DATABASE_URL, 'sqlite://./custom/path/to/db.sqlite')
120
121
  process.env = {}
121
122
 
122
123
  const pathToDbEnvSampleFile = join(tmpDir, '.env.sample')