create-sprint 0.0.118 → 0.0.122
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/dist/index.js +1 -1
- package/dist/templates/docker.js +3 -0
- package/dist/templates/middlewares.js +2 -4
- package/dist/templates/packageJson.js +2 -2
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/templates/docker.ts +3 -0
- package/src/templates/middlewares.ts +2 -4
- package/src/templates/packageJson.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { validateProjectName } from "./validators.js";
|
|
|
8
8
|
import { getTypeScriptPackageJson, getJavaScriptPackageJson, getTsConfig, getMainFile, getHomeRoute, getAdminRoute, getHomeController, getAdminController, getEnvExample, getInternalAuthMiddleware, getUserAuthMiddleware, getHomeSchema, getAdminSchema, getDockerfile, getDockerCompose, getGitignore, getDockerIgnore, getSprintConfigFile, getEnvDevelopment, getEnvProduction, getExampleCronJob, getGraphQLFiles } from "./generators.js";
|
|
9
9
|
export async function writeFile(path, content, options) {
|
|
10
10
|
if (typeof content === "string")
|
|
11
|
-
content = content.
|
|
11
|
+
content = content.trim();
|
|
12
12
|
await fsWriteFile(path, content, options);
|
|
13
13
|
}
|
|
14
14
|
;
|
package/dist/templates/docker.js
CHANGED
|
@@ -22,6 +22,7 @@ COPY package*.json ./
|
|
|
22
22
|
RUN npm ci --omit=dev
|
|
23
23
|
|
|
24
24
|
COPY --from=builder /app/dist ./dist
|
|
25
|
+
COPY --from=builder /app/.env.production ./
|
|
25
26
|
|
|
26
27
|
EXPOSE 5000
|
|
27
28
|
|
|
@@ -51,6 +52,8 @@ services:
|
|
|
51
52
|
build: .
|
|
52
53
|
ports:
|
|
53
54
|
- "5000:5000"
|
|
55
|
+
env_file:
|
|
56
|
+
- .env.production
|
|
54
57
|
environment:
|
|
55
58
|
- NODE_ENV=production
|
|
56
59
|
- PORT=5000
|
|
@@ -13,8 +13,7 @@ export default defineMiddleware({
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
handler: (req: SprintRequest, res: SprintResponse, next: NextFunction) => {
|
|
16
|
-
const auth = req.sprint.authorization
|
|
17
|
-
if (!auth) return res.status(401).json({ error: "No authorization header" });
|
|
16
|
+
const auth = req.sprint.authorization!;
|
|
18
17
|
|
|
19
18
|
const token = auth.replace("Bearer ", "");
|
|
20
19
|
|
|
@@ -38,8 +37,7 @@ export default defineMiddleware({
|
|
|
38
37
|
}
|
|
39
38
|
},
|
|
40
39
|
handler: (req, res, next) => {
|
|
41
|
-
const auth = req.sprint.authorization
|
|
42
|
-
if (!auth) return res.status(401).json({ error: "No authorization header" });
|
|
40
|
+
const auth = req.sprint.authorization!;
|
|
43
41
|
|
|
44
42
|
const token = auth.replace("Bearer ", "");
|
|
45
43
|
|
|
@@ -10,7 +10,7 @@ export function generateJWTKeys() {
|
|
|
10
10
|
;
|
|
11
11
|
export function getTypeScriptPackageJson(name, telemetry, swagger, graphql) {
|
|
12
12
|
const deps = {
|
|
13
|
-
"sprint-es": "^0.0.
|
|
13
|
+
"sprint-es": "^0.0.147"
|
|
14
14
|
};
|
|
15
15
|
const devDeps = {
|
|
16
16
|
"@types/node": "^22.0.0",
|
|
@@ -66,7 +66,7 @@ export function getTypeScriptPackageJson(name, telemetry, swagger, graphql) {
|
|
|
66
66
|
;
|
|
67
67
|
export function getJavaScriptPackageJson(name, telemetry, swagger, graphql) {
|
|
68
68
|
const deps = {
|
|
69
|
-
"sprint-es": "^0.0.
|
|
69
|
+
"sprint-es": "^0.0.147"
|
|
70
70
|
};
|
|
71
71
|
if (telemetry === "sentry" || telemetry === "glitchtip")
|
|
72
72
|
deps["@sentry/node"] = "^8.0.0";
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -21,7 +21,7 @@ export interface CLIOptions {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export async function writeFile(path: string, content: string, options?: any) {
|
|
24
|
-
if (typeof content === "string") content = content.
|
|
24
|
+
if (typeof content === "string") content = content.trim();
|
|
25
25
|
await fsWriteFile(path, content, options);
|
|
26
26
|
};
|
|
27
27
|
|
package/src/templates/docker.ts
CHANGED
|
@@ -22,6 +22,7 @@ COPY package*.json ./
|
|
|
22
22
|
RUN npm ci --omit=dev
|
|
23
23
|
|
|
24
24
|
COPY --from=builder /app/dist ./dist
|
|
25
|
+
COPY --from=builder /app/.env.production ./
|
|
25
26
|
|
|
26
27
|
EXPOSE 5000
|
|
27
28
|
|
|
@@ -51,6 +52,8 @@ services:
|
|
|
51
52
|
build: .
|
|
52
53
|
ports:
|
|
53
54
|
- "5000:5000"
|
|
55
|
+
env_file:
|
|
56
|
+
- .env.production
|
|
54
57
|
environment:
|
|
55
58
|
- NODE_ENV=production
|
|
56
59
|
- PORT=5000
|
|
@@ -13,8 +13,7 @@ export default defineMiddleware({
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
handler: (req: SprintRequest, res: SprintResponse, next: NextFunction) => {
|
|
16
|
-
const auth = req.sprint.authorization
|
|
17
|
-
if (!auth) return res.status(401).json({ error: "No authorization header" });
|
|
16
|
+
const auth = req.sprint.authorization!;
|
|
18
17
|
|
|
19
18
|
const token = auth.replace("Bearer ", "");
|
|
20
19
|
|
|
@@ -38,8 +37,7 @@ export default defineMiddleware({
|
|
|
38
37
|
}
|
|
39
38
|
},
|
|
40
39
|
handler: (req, res, next) => {
|
|
41
|
-
const auth = req.sprint.authorization
|
|
42
|
-
if (!auth) return res.status(401).json({ error: "No authorization header" });
|
|
40
|
+
const auth = req.sprint.authorization!;
|
|
43
41
|
|
|
44
42
|
const token = auth.replace("Bearer ", "");
|
|
45
43
|
|
|
@@ -16,7 +16,7 @@ export function generateJWTKeys(): JWTKeys {
|
|
|
16
16
|
|
|
17
17
|
export function getTypeScriptPackageJson(name: string, telemetry: string, swagger: boolean, graphql: boolean) {
|
|
18
18
|
const deps: Record<string, string> = {
|
|
19
|
-
"sprint-es": "^0.0.
|
|
19
|
+
"sprint-es": "^0.0.147"
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
const devDeps: Record<string, string> = {
|
|
@@ -73,7 +73,7 @@ export function getTypeScriptPackageJson(name: string, telemetry: string, swagge
|
|
|
73
73
|
|
|
74
74
|
export function getJavaScriptPackageJson(name: string, telemetry: string, swagger: boolean, graphql: boolean) {
|
|
75
75
|
const deps: Record<string, string> = {
|
|
76
|
-
"sprint-es": "^0.0.
|
|
76
|
+
"sprint-es": "^0.0.147"
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
if (telemetry === "sentry" || telemetry === "glitchtip") deps["@sentry/node"] = "^8.0.0";
|