pwi-plata-type 0.2.18 → 0.2.21
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.
|
@@ -36,7 +36,11 @@ export async function h() {
|
|
|
36
36
|
console.log('CLUSTER AINDA NÃO CRIANDO AINDA')
|
|
37
37
|
break;
|
|
38
38
|
case 'route':
|
|
39
|
-
const
|
|
39
|
+
const r = `${args.shift()}/`.replace(/:(.*?)(?:\/|$)/g, (_, parm) => {
|
|
40
|
+
return parm[parm.length - 1] !== '?' ? `{${parm}}/` : `[${parm.slice(0, -1)}]/`
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
const routeArg = r.slice(0, -1).split('/')
|
|
40
44
|
|
|
41
45
|
const routeFileName = routeArg[routeArg.length - 1] === '' ? 'index' : routeArg.pop()
|
|
42
46
|
const routeFilePath = path.join('routes', ...routeArg.filter(v => v !== ''))
|
package/libs/routes.ts
CHANGED
package/package.json
CHANGED
package/postinstall-tools.mjs
CHANGED
|
@@ -104,5 +104,12 @@ export function tools(dirs) {
|
|
|
104
104
|
await tools.copyFile(templateFile, destination)
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
tools.copyFileToProject = async (file) => {
|
|
108
|
+
const templateFile = path.join(dirs.templateDir, file)
|
|
109
|
+
const destination = path.join(dirs.projectDir, file)
|
|
110
|
+
|
|
111
|
+
await tools.copyFileIfNotExists(templateFile, destination)
|
|
112
|
+
}
|
|
113
|
+
|
|
107
114
|
return tools
|
|
108
115
|
}
|
|
@@ -15,7 +15,7 @@ export async function install({ dirs, projectPackageJson }) {
|
|
|
15
15
|
promises.push(t.copyFolderToProject('envs'))
|
|
16
16
|
promises.push(t.syncFolderProject('.vscode'))
|
|
17
17
|
|
|
18
|
-
promises.push(t.
|
|
18
|
+
promises.push(t.copyFileToProject('Dockerfile'))
|
|
19
19
|
promises.push(t.syncFileToProject('tsconfig.json'))
|
|
20
20
|
|
|
21
21
|
projectPackageJson.type = "module"
|