@uscreen.de/create-fastify-app 0.4.4 → 0.5.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/.eslintrc.cjs ADDED
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ extends: ['@uscreen.de/eslint-config-prettystandard-node']
3
+ }
package/README.md CHANGED
@@ -68,6 +68,11 @@ $ make logs
68
68
 
69
69
  ## Changelog
70
70
 
71
+ ### v0.5.0
72
+
73
+ - moved to esm
74
+ - upgraded to node 16.x (LTS)
75
+
71
76
  ### v0.4.0
72
77
 
73
78
  - upgraded to node 14.x (LTS)
package/bin/cli.js CHANGED
@@ -1,12 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const path = require('path')
4
- const cli = require('commander')
5
- const readPkgUp = require('read-pkg-up')
6
- const writePackage = require('write-pkg')
7
- const fs = require('fs-extra')
3
+ import path from 'path'
4
+ import { fileURLToPath } from 'url'
5
+ import { program } from 'commander'
6
+ import { readPackageUpSync } from 'read-pkg-up'
7
+ import { writePackage } from 'write-pkg'
8
+ import fs from 'fs-extra'
8
9
 
9
- const { spawn } = require('child_process')
10
+ import { spawn } from 'child_process'
11
+
12
+ const __filename = fileURLToPath(import.meta.url)
13
+ const __dirname = path.dirname(__filename)
10
14
 
11
15
  let root
12
16
  let skeleton
@@ -44,7 +48,7 @@ const initializeYarn = (path) =>
44
48
  * install extra dev packages from skeleleton
45
49
  */
46
50
  const installDevPackages = (appPath, skelPath) => {
47
- const skelPack = readPkgUp.sync({ cwd: skelPath })
51
+ const skelPack = readPackageUpSync({ cwd: skelPath })
48
52
  const devDependencies = Object.keys(skelPack.packageJson.devDependencies)
49
53
  return new Promise((resolve, reject) => {
50
54
  const yarn = spawn('yarn', ['add', ...devDependencies, '-D'], {
@@ -63,7 +67,7 @@ const installDevPackages = (appPath, skelPath) => {
63
67
  * install extra prod packages from skeleleton
64
68
  */
65
69
  const installPackages = (appPath, skelPath) => {
66
- const skelPack = readPkgUp.sync({ cwd: skelPath })
70
+ const skelPack = readPackageUpSync({ cwd: skelPath })
67
71
  const dependencies = Object.keys(skelPack.packageJson.dependencies)
68
72
  return new Promise((resolve, reject) => {
69
73
  const yarn = spawn('yarn', ['add', ...dependencies], {
@@ -82,8 +86,8 @@ const installPackages = (appPath, skelPath) => {
82
86
  * configure package.json to use linting, testing, stuff
83
87
  */
84
88
  const addPackageConfig = (path, skelPath) => {
85
- const skelPack = readPkgUp.sync({ cwd: skelPath })
86
- const pack = readPkgUp.sync({ cwd: path })
89
+ const skelPack = readPackageUpSync({ cwd: skelPath })
90
+ const pack = readPackageUpSync({ cwd: path })
87
91
  delete pack.packageJson._id
88
92
  delete pack.packageJson.readme
89
93
 
@@ -132,7 +136,7 @@ const copyEnv = (appPath, skelPath) => {
132
136
  /**
133
137
  * define the command
134
138
  */
135
- cli
139
+ program
136
140
  .version('0.1.0')
137
141
  .arguments('<name> [opt]')
138
142
  .action(async (name, opt) => {
@@ -166,11 +170,11 @@ cli
166
170
  /**
167
171
  * read args
168
172
  */
169
- cli.parse(process.argv)
173
+ program.parse(process.argv)
170
174
 
171
175
  /**
172
176
  * output help as default
173
177
  */
174
178
  if (!process.argv.slice(2).length) {
175
- cli.help()
179
+ program.help()
176
180
  }
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@uscreen.de/create-fastify-app",
3
- "version": "0.4.4",
3
+ "version": "0.5.1",
4
4
  "description": "cli to create a new @uscreen.de/fastify-app",
5
5
  "main": "index.js",
6
+ "type": "module",
6
7
  "repository": "git@gitlab.uscreen.net:uscreen/npm/create-fastify-app.git",
7
8
  "author": "Marcus Spiegel <spiegel@uscreen.de>",
8
9
  "license": "MIT",
@@ -14,15 +15,15 @@
14
15
  "prepare": "husky install"
15
16
  },
16
17
  "dependencies": {
17
- "commander": "^8.3.0",
18
- "fs-extra": "^10.0.0",
19
- "read-pkg-up": "^7.0.1",
20
- "write-pkg": "^4.0.0"
18
+ "commander": "^9.0.0",
19
+ "fs-extra": "^10.0.1",
20
+ "read-pkg-up": "^9.1.0",
21
+ "write-pkg": "^5.0.0"
21
22
  },
22
23
  "devDependencies": {
23
24
  "@uscreen.de/eslint-config-prettystandard-node": "^0.2.2",
24
25
  "husky": ">=6",
25
- "lint-staged": ">=12.3.2"
26
+ "lint-staged": ">=12.3.4"
26
27
  },
27
28
  "lint-staged": {
28
29
  "*.js": "eslint --cache --fix"
package/skeleton/.nvmrc CHANGED
@@ -1 +1 @@
1
- 14
1
+ 16
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  const fp = require('fastify-plugin')
4
- const S = require('fluent-schema')
4
+ const S = require('fluent-json-schema')
5
5
 
6
6
  /**
7
7
  * Usage of the Globaly Shared Schema feature
@@ -3,20 +3,20 @@
3
3
  "version": "0.0.0",
4
4
  "main": "app/server.js",
5
5
  "dependencies": {
6
- "@uscreen.de/fastify-app": "^0.7.0",
7
- "env-schema": "^2.0.1",
8
- "fastify": "^3.2.0",
6
+ "@uscreen.de/fastify-app": "^0.8.0",
7
+ "env-schema": "^3.5.2",
8
+ "fastify": "^3.27.2",
9
9
  "fastify-plugin": "^3.0.0",
10
- "fluent-schema": "^1.0.4",
11
- "hyperid": "^2.0.5"
10
+ "fluent-json-schema": "^3.0.1",
11
+ "hyperid": "^3.0.1"
12
12
  },
13
13
  "devDependencies": {
14
- "@uscreen.de/eslint-config-prettystandard-node": "^0.1.0",
15
- "lint-staged": "^10.2.11",
16
- "pino-pretty": "^4.1.0",
17
- "pm2": "^4.4.0",
14
+ "@uscreen.de/eslint-config-prettystandard-node": "^0.2.2",
15
+ "lint-staged": "^12.3.4",
16
+ "pino-pretty": "^7.5.1",
17
+ "pm2": "^5.2.0",
18
18
  "prettier": "^2.0.5",
19
- "tap": "^14.6.9",
19
+ "tap": "^15.1.6",
20
20
  "yorkie": "^2.0.0"
21
21
  },
22
22
  "scripts": {