create-backurus-app 1.0.1 → 1.0.5
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/bin/index.js +5 -1
- package/package.json +2 -2
- package/template/.env +18 -0
- package/template/.env.example +16 -0
- package/template/README.md +3 -1
- package/template/artisan.js +2 -1
- package/template/backurus-register.mjs +1 -1
- package/template/index.js +2 -1
- package/template/urus +2 -1
package/bin/index.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import fs from "fs-extra"
|
|
4
|
+
import { fileURLToPath } from "url"
|
|
4
5
|
import path from "path"
|
|
5
6
|
import inquirer from "inquirer"
|
|
6
7
|
import chalk from "chalk"
|
|
7
8
|
import { execSync } from "child_process"
|
|
8
9
|
|
|
9
|
-
const
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
11
|
+
const __dirname = path.dirname(__filename)
|
|
12
|
+
|
|
13
|
+
const templateDir = path.join(__dirname, "../template")
|
|
10
14
|
|
|
11
15
|
async function run() {
|
|
12
16
|
|
package/package.json
CHANGED
package/template/.env
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
APP_NAME=Backurus
|
|
2
|
+
APP_PORT=3000
|
|
3
|
+
APP_ENV=development
|
|
4
|
+
|
|
5
|
+
DB_CONNECTION=mysql
|
|
6
|
+
DB_HOST=127.0.0.1
|
|
7
|
+
DB_PORT=3306
|
|
8
|
+
DB_DATABASE=
|
|
9
|
+
DB_USERNAME=root
|
|
10
|
+
DB_PASSWORD=
|
|
11
|
+
JWT_SECRET=supersecretkey
|
|
12
|
+
|
|
13
|
+
REDIS_HOST=127.0.0.1
|
|
14
|
+
REDIS_PORT=6379
|
|
15
|
+
|
|
16
|
+
QUEUE_CONNECTION=sync
|
|
17
|
+
RATE_LIMIT_MAX=100
|
|
18
|
+
RATE_LIMIT_WINDOW_MS=60000
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
APP_NAME=Backurus
|
|
2
|
+
APP_PORT=3000
|
|
3
|
+
APP_ENV=development
|
|
4
|
+
|
|
5
|
+
DB_CONNECTION=mysql
|
|
6
|
+
DB_HOST=localhost
|
|
7
|
+
DB_PORT=3306
|
|
8
|
+
DB_DATABASE=mydb
|
|
9
|
+
DB_USERNAME=root
|
|
10
|
+
DB_PASSWORD=password
|
|
11
|
+
JWT_SECRET=supersecretkey
|
|
12
|
+
|
|
13
|
+
REDIS_HOST=127.0.0.1
|
|
14
|
+
REDIS_PORT=6379
|
|
15
|
+
|
|
16
|
+
QUEUE_CONNECTION=redis
|
package/template/README.md
CHANGED
package/template/artisan.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import path from 'node:path'
|
|
2
2
|
import { spawn } from 'node:child_process'
|
|
3
|
+
import { pathToFileURL } from 'node:url'
|
|
3
4
|
|
|
4
|
-
const registerFile = path.resolve(process.cwd(), 'backurus-register.mjs')
|
|
5
|
+
const registerFile = pathToFileURL(path.resolve(process.cwd(), 'backurus-register.mjs')).href
|
|
5
6
|
|
|
6
7
|
if (!process.execArgv.includes('--import')) {
|
|
7
8
|
const child = spawn(process.execPath, ['--import', registerFile, process.argv[1], ...process.argv.slice(2)], {
|
package/template/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import path from 'node:path'
|
|
2
2
|
import { spawn } from 'node:child_process'
|
|
3
|
+
import { pathToFileURL } from 'node:url'
|
|
3
4
|
|
|
4
|
-
const registerFile = path.resolve(process.cwd(), 'backurus-register.mjs')
|
|
5
|
+
const registerFile = pathToFileURL(path.resolve(process.cwd(), 'backurus-register.mjs')).href
|
|
5
6
|
|
|
6
7
|
if (!process.execArgv.includes('--import')) {
|
|
7
8
|
const child = spawn(process.execPath, ['--import', registerFile, process.argv[1], ...process.argv.slice(2)], {
|
package/template/urus
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import path from 'node:path'
|
|
2
2
|
import { spawn } from 'node:child_process'
|
|
3
|
+
import { pathToFileURL } from 'node:url'
|
|
3
4
|
|
|
4
|
-
const registerFile = path.resolve(process.cwd(), 'backurus-register.mjs')
|
|
5
|
+
const registerFile = pathToFileURL(path.resolve(process.cwd(), 'backurus-register.mjs')).href
|
|
5
6
|
|
|
6
7
|
if (!process.execArgv.includes('--import')) {
|
|
7
8
|
const child = spawn(process.execPath, ['--import', registerFile, process.argv[1], ...process.argv.slice(2)], {
|