create-idp 0.1.0 → 0.2.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/README.md +88 -127
- package/dist/index.js +86 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/django/README.md +27 -0
- package/templates/django/_gitignore +20 -0
- package/templates/django/_template.json +14 -0
- package/templates/django/manage.py +22 -0
- package/templates/django/project_name/__init__.py +1 -0
- package/templates/django/project_name/asgi.py +11 -0
- package/templates/django/project_name/settings.py +75 -0
- package/templates/django/project_name/urls.py +16 -0
- package/templates/django/project_name/wsgi.py +11 -0
- package/templates/django/pyproject.toml +20 -0
- package/templates/express-ts/README.md +27 -0
- package/templates/express-ts/_gitignore +7 -0
- package/templates/express-ts/_template.json +13 -0
- package/templates/express-ts/package.json +23 -0
- package/templates/express-ts/src/index.ts +17 -0
- package/templates/express-ts/src/middleware/error-handler.ts +14 -0
- package/templates/express-ts/src/routes/index.ts +11 -0
- package/templates/express-ts/tsconfig.json +17 -0
- package/templates/express-ts/tsup.config.ts +9 -0
- package/templates/fastapi/README.md +21 -0
- package/templates/fastapi/_gitignore +16 -0
- package/templates/fastapi/_template.json +14 -0
- package/templates/fastapi/pyproject.toml +21 -0
- package/templates/fastapi/src/project_name/__init__.py +1 -0
- package/templates/fastapi/src/project_name/main.py +20 -0
- package/templates/fastapi/src/project_name/routes/__init__.py +8 -0
- package/templates/flask/README.md +15 -0
- package/templates/flask/_gitignore +17 -0
- package/templates/flask/_template.json +14 -0
- package/templates/flask/pyproject.toml +19 -0
- package/templates/flask/src/project_name/__init__.py +1 -0
- package/templates/flask/src/project_name/app.py +15 -0
- package/templates/flask/src/project_name/routes/__init__.py +8 -0
- package/templates/fullstack-react-node/README.md +35 -0
- package/templates/fullstack-react-node/_gitignore +7 -0
- package/templates/fullstack-react-node/_template.json +14 -0
- package/templates/fullstack-react-node/backend/package.json +22 -0
- package/templates/fullstack-react-node/backend/src/index.ts +20 -0
- package/templates/fullstack-react-node/backend/tsconfig.json +17 -0
- package/templates/fullstack-react-node/backend/tsup.config.ts +9 -0
- package/templates/fullstack-react-node/frontend/index.html +12 -0
- package/templates/fullstack-react-node/frontend/package.json +22 -0
- package/templates/fullstack-react-node/frontend/src/App.css +16 -0
- package/templates/fullstack-react-node/frontend/src/App.tsx +22 -0
- package/templates/fullstack-react-node/frontend/src/main.tsx +9 -0
- package/templates/fullstack-react-node/frontend/tsconfig.json +20 -0
- package/templates/fullstack-react-node/frontend/vite.config.ts +14 -0
- package/templates/fullstack-react-node/package.json +10 -0
- package/templates/fullstack-react-node/pnpm-workspace.yaml +3 -0
- package/templates/fullstack-react-python/Makefile +35 -0
- package/templates/fullstack-react-python/README.md +43 -0
- package/templates/fullstack-react-python/_gitignore +18 -0
- package/templates/fullstack-react-python/_template.json +25 -0
- package/templates/fullstack-react-python/backend/pyproject.toml +21 -0
- package/templates/fullstack-react-python/backend/src/project_name/__init__.py +1 -0
- package/templates/fullstack-react-python/backend/src/project_name/main.py +29 -0
- package/templates/fullstack-react-python/backend/src/project_name/routes/__init__.py +8 -0
- package/templates/fullstack-react-python/frontend/index.html +12 -0
- package/templates/fullstack-react-python/frontend/package.json +22 -0
- package/templates/fullstack-react-python/frontend/src/App.css +16 -0
- package/templates/fullstack-react-python/frontend/src/App.tsx +22 -0
- package/templates/fullstack-react-python/frontend/src/main.tsx +9 -0
- package/templates/fullstack-react-python/frontend/tsconfig.json +20 -0
- package/templates/fullstack-react-python/frontend/vite.config.ts +14 -0
- package/templates/fullstack-vue-node/README.md +35 -0
- package/templates/fullstack-vue-node/_gitignore +7 -0
- package/templates/fullstack-vue-node/_template.json +14 -0
- package/templates/fullstack-vue-node/backend/package.json +22 -0
- package/templates/fullstack-vue-node/backend/src/index.ts +20 -0
- package/templates/fullstack-vue-node/backend/tsconfig.json +17 -0
- package/templates/fullstack-vue-node/backend/tsup.config.ts +9 -0
- package/templates/fullstack-vue-node/frontend/index.html +12 -0
- package/templates/fullstack-vue-node/frontend/package.json +20 -0
- package/templates/fullstack-vue-node/frontend/src/App.vue +41 -0
- package/templates/fullstack-vue-node/frontend/src/main.ts +4 -0
- package/templates/fullstack-vue-node/frontend/src/vite-env.d.ts +1 -0
- package/templates/fullstack-vue-node/frontend/tsconfig.json +20 -0
- package/templates/fullstack-vue-node/frontend/vite.config.ts +14 -0
- package/templates/fullstack-vue-node/package.json +10 -0
- package/templates/fullstack-vue-node/pnpm-workspace.yaml +3 -0
- package/templates/next-ts/README.md +26 -0
- package/templates/next-ts/_gitignore +34 -0
- package/templates/next-ts/_template.json +13 -0
- package/templates/next-ts/next.config.ts +7 -0
- package/templates/next-ts/package.json +22 -0
- package/templates/next-ts/src/app/globals.css +21 -0
- package/templates/next-ts/src/app/layout.tsx +19 -0
- package/templates/next-ts/src/app/page.tsx +10 -0
- package/templates/next-ts/tsconfig.json +27 -0
- package/templates/springboot/.mvn/wrapper/maven-wrapper.properties +2 -0
- package/templates/springboot/README.md +27 -0
- package/templates/springboot/_gitignore +36 -0
- package/templates/springboot/_template.json +14 -0
- package/templates/springboot/mvnw +19 -0
- package/templates/springboot/mvnw.cmd +13 -0
- package/templates/springboot/pom.xml +46 -0
- package/templates/springboot/src/main/java/com/example/project_name/Application.java +12 -0
- package/templates/springboot/src/main/java/com/example/project_name/controller/HelloController.java +25 -0
- package/templates/springboot/src/main/resources/application.yml +6 -0
- package/templates/springboot/src/test/java/com/example/project_name/ApplicationTests.java +12 -0
- package/templates/template.config.json +78 -10
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Spring Boot 项目模板",
|
|
3
|
+
"packageManager": "maven",
|
|
4
|
+
"postInit": [
|
|
5
|
+
{
|
|
6
|
+
"command": "./mvnw dependency:resolve",
|
|
7
|
+
"description": "下载依赖"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"fileRenames": {
|
|
11
|
+
"_gitignore": ".gitignore",
|
|
12
|
+
"project_name": "{{projectName}}"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Maven Wrapper script
|
|
3
|
+
|
|
4
|
+
set -e
|
|
5
|
+
|
|
6
|
+
MAVEN_PROJECTBASEDIR="${MAVEN_BASEDIR:-$(cd "$(dirname "$0")" && pwd)}"
|
|
7
|
+
MAVEN_OPTS="${MAVEN_OPTS:-"-Xmx64m"}"
|
|
8
|
+
|
|
9
|
+
# Download maven-wrapper.jar if not present
|
|
10
|
+
WRAPPER_JAR="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar"
|
|
11
|
+
if [ ! -f "$WRAPPER_JAR" ]; then
|
|
12
|
+
echo "Downloading Maven Wrapper..."
|
|
13
|
+
mkdir -p "$MAVEN_PROJECTBASEDIR/.mvn/wrapper"
|
|
14
|
+
curl -sL https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar -o "$WRAPPER_JAR"
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
exec java $MAVEN_OPTS \
|
|
18
|
+
-classpath "$WRAPPER_JAR" \
|
|
19
|
+
org.apache.maven.wrapper.MavenWrapperMain "$@"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
@REM Maven Wrapper script for Windows
|
|
3
|
+
|
|
4
|
+
set MAVEN_PROJECTBASEDIR=%~dp0
|
|
5
|
+
set WRAPPER_JAR=%MAVEN_PROJECTBASEDIR%.mvn\wrapper\maven-wrapper.jar
|
|
6
|
+
|
|
7
|
+
if not exist "%WRAPPER_JAR%" (
|
|
8
|
+
echo Downloading Maven Wrapper...
|
|
9
|
+
mkdir "%MAVEN_PROJECTBASEDIR%.mvn\wrapper" 2>NUL
|
|
10
|
+
powershell -Command "Invoke-WebRequest -Uri 'https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar' -OutFile '%WRAPPER_JAR%'"
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
java %MAVEN_OPTS% -classpath "%WRAPPER_JAR%" org.apache.maven.wrapper.MavenWrapperMain %*
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
3
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
4
|
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
|
5
|
+
https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
6
|
+
<modelVersion>4.0.0</modelVersion>
|
|
7
|
+
|
|
8
|
+
<parent>
|
|
9
|
+
<groupId>org.springframework.boot</groupId>
|
|
10
|
+
<artifactId>spring-boot-starter-parent</artifactId>
|
|
11
|
+
<version>3.4.2</version>
|
|
12
|
+
<relativePath/>
|
|
13
|
+
</parent>
|
|
14
|
+
|
|
15
|
+
<groupId>com.example</groupId>
|
|
16
|
+
<artifactId>{{projectName}}</artifactId>
|
|
17
|
+
<version>0.1.0</version>
|
|
18
|
+
<name>{{projectName}}</name>
|
|
19
|
+
<description>Spring Boot project</description>
|
|
20
|
+
|
|
21
|
+
<properties>
|
|
22
|
+
<java.version>21</java.version>
|
|
23
|
+
</properties>
|
|
24
|
+
|
|
25
|
+
<dependencies>
|
|
26
|
+
<dependency>
|
|
27
|
+
<groupId>org.springframework.boot</groupId>
|
|
28
|
+
<artifactId>spring-boot-starter-web</artifactId>
|
|
29
|
+
</dependency>
|
|
30
|
+
|
|
31
|
+
<dependency>
|
|
32
|
+
<groupId>org.springframework.boot</groupId>
|
|
33
|
+
<artifactId>spring-boot-starter-test</artifactId>
|
|
34
|
+
<scope>test</scope>
|
|
35
|
+
</dependency>
|
|
36
|
+
</dependencies>
|
|
37
|
+
|
|
38
|
+
<build>
|
|
39
|
+
<plugins>
|
|
40
|
+
<plugin>
|
|
41
|
+
<groupId>org.springframework.boot</groupId>
|
|
42
|
+
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
43
|
+
</plugin>
|
|
44
|
+
</plugins>
|
|
45
|
+
</build>
|
|
46
|
+
</project>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
package com.example.{{projectName}};
|
|
2
|
+
|
|
3
|
+
import org.springframework.boot.SpringApplication;
|
|
4
|
+
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
5
|
+
|
|
6
|
+
@SpringBootApplication
|
|
7
|
+
public class Application {
|
|
8
|
+
|
|
9
|
+
public static void main(String[] args) {
|
|
10
|
+
SpringApplication.run(Application.class, args);
|
|
11
|
+
}
|
|
12
|
+
}
|
package/templates/springboot/src/main/java/com/example/project_name/controller/HelloController.java
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
package com.example.{{projectName}}.controller;
|
|
2
|
+
|
|
3
|
+
import org.springframework.web.bind.annotation.GetMapping;
|
|
4
|
+
import org.springframework.web.bind.annotation.RestController;
|
|
5
|
+
|
|
6
|
+
import java.util.Map;
|
|
7
|
+
|
|
8
|
+
@RestController
|
|
9
|
+
public class HelloController {
|
|
10
|
+
|
|
11
|
+
@GetMapping("/")
|
|
12
|
+
public Map<String, String> index() {
|
|
13
|
+
return Map.of("message", "Welcome to {{projectName}}");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@GetMapping("/health")
|
|
17
|
+
public Map<String, String> health() {
|
|
18
|
+
return Map.of("status", "ok");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@GetMapping("/api/hello")
|
|
22
|
+
public Map<String, String> hello() {
|
|
23
|
+
return Map.of("message", "Hello, World!");
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -1,34 +1,102 @@
|
|
|
1
1
|
{
|
|
2
2
|
"templates": [
|
|
3
|
-
{
|
|
4
|
-
"name": "empty",
|
|
5
|
-
"displayName": "空项目",
|
|
6
|
-
"description": "仅包含基础配置的空项目",
|
|
7
|
-
"dir": "empty"
|
|
8
|
-
},
|
|
9
3
|
{
|
|
10
4
|
"name": "node-ts",
|
|
11
5
|
"displayName": "Node.js + TypeScript",
|
|
12
6
|
"description": "Node.js 项目,使用 TypeScript 和 pnpm",
|
|
13
|
-
"dir": "node-ts"
|
|
7
|
+
"dir": "node-ts",
|
|
8
|
+
"category": "single"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "express-ts",
|
|
12
|
+
"displayName": "Express + TypeScript API",
|
|
13
|
+
"description": "Express.js API 项目,使用 TypeScript",
|
|
14
|
+
"dir": "express-ts",
|
|
15
|
+
"category": "single"
|
|
14
16
|
},
|
|
15
17
|
{
|
|
16
18
|
"name": "react-ts",
|
|
17
19
|
"displayName": "React + TypeScript",
|
|
18
20
|
"description": "React 18 项目,使用 Vite 和 TypeScript",
|
|
19
|
-
"dir": "react-ts"
|
|
21
|
+
"dir": "react-ts",
|
|
22
|
+
"category": "single"
|
|
20
23
|
},
|
|
21
24
|
{
|
|
22
25
|
"name": "vue-ts",
|
|
23
26
|
"displayName": "Vue + TypeScript",
|
|
24
27
|
"description": "Vue 3 项目,使用 Vite 和 TypeScript",
|
|
25
|
-
"dir": "vue-ts"
|
|
28
|
+
"dir": "vue-ts",
|
|
29
|
+
"category": "single"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "next-ts",
|
|
33
|
+
"displayName": "Next.js 全栈",
|
|
34
|
+
"description": "Next.js 14 全栈项目,使用 App Router 和 TypeScript",
|
|
35
|
+
"dir": "next-ts",
|
|
36
|
+
"category": "single"
|
|
26
37
|
},
|
|
27
38
|
{
|
|
28
39
|
"name": "python-uv",
|
|
29
40
|
"displayName": "Python (uv)",
|
|
30
41
|
"description": "Python 项目,使用 uv 包管理器",
|
|
31
|
-
"dir": "python-uv"
|
|
42
|
+
"dir": "python-uv",
|
|
43
|
+
"category": "single"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "fastapi",
|
|
47
|
+
"displayName": "FastAPI",
|
|
48
|
+
"description": "FastAPI 项目,使用 uv 包管理器",
|
|
49
|
+
"dir": "fastapi",
|
|
50
|
+
"category": "single"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "django",
|
|
54
|
+
"displayName": "Django",
|
|
55
|
+
"description": "Django 项目,使用 uv 包管理器",
|
|
56
|
+
"dir": "django",
|
|
57
|
+
"category": "single"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "flask",
|
|
61
|
+
"displayName": "Flask",
|
|
62
|
+
"description": "Flask 项目,使用 uv 包管理器",
|
|
63
|
+
"dir": "flask",
|
|
64
|
+
"category": "single"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "springboot",
|
|
68
|
+
"displayName": "Spring Boot",
|
|
69
|
+
"description": "Spring Boot 3.x 项目,使用 Maven",
|
|
70
|
+
"dir": "springboot",
|
|
71
|
+
"category": "single"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "empty",
|
|
75
|
+
"displayName": "空项目",
|
|
76
|
+
"description": "仅包含基础配置的空项目",
|
|
77
|
+
"dir": "empty",
|
|
78
|
+
"category": "single"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "fullstack-react-node",
|
|
82
|
+
"displayName": "React + Node.js 全栈",
|
|
83
|
+
"description": "前后端分离项目,pnpm workspace",
|
|
84
|
+
"dir": "fullstack-react-node",
|
|
85
|
+
"category": "fullstack"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"name": "fullstack-vue-node",
|
|
89
|
+
"displayName": "Vue + Node.js 全栈",
|
|
90
|
+
"description": "前后端分离项目,pnpm workspace",
|
|
91
|
+
"dir": "fullstack-vue-node",
|
|
92
|
+
"category": "fullstack"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "fullstack-react-python",
|
|
96
|
+
"displayName": "React + Python 全栈",
|
|
97
|
+
"description": "前后端分离项目,React + FastAPI",
|
|
98
|
+
"dir": "fullstack-react-python",
|
|
99
|
+
"category": "fullstack"
|
|
32
100
|
}
|
|
33
101
|
]
|
|
34
102
|
}
|