Skip to content

Commit 4a5f12b

Browse files
authored
Merge pull request #1 from WSH032/refactor/template
refactor: simplify questionnaire and standardize project structure
2 parents 7e2aad5 + 6871afe commit 4a5f12b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1784
-379
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
**/__pycache__/
2+
3+
**/node_modules/
4+
target/
5+
.venv/

.idea/.gitignore

Lines changed: 0 additions & 8 deletions
This file was deleted.

.idea/create-pytauri.iml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.idea/misc.xml

Lines changed: 0 additions & 7 deletions
This file was deleted.

.idea/modules.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.idea/vcs.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@ uvx copier copy https://github.com/ISOR3X/create-pytauri project_name
1616
## To do
1717

1818
1. Create a venv, install the python package as a dependency (maybe as a separate command?)
19-
2. Add example GUI (see [pytauri-vue-starter](https://github.com/ISOR3X/pytauri-vue-starter))
19+
2. Add example GUI (see [pytauri-vue-starter](https://github.com/ISOR3X/pytauri-vue-starter))
20+
21+
## Refer
22+
23+
<https://github.com/orgs/copier-org/discussions/2121>

copier.yaml

Lines changed: 32 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,41 @@
11
_subdirectory: "templates/"
22

3-
# pytauri-app
43
project_name:
5-
type: str
6-
help: Project name
7-
default: pytauri-app
4+
type: str
5+
help: Project name
6+
default: pytauri-app
87

98
package_name:
10-
type: str
11-
default: "{{ project_name | replace('-', '_')}}"
12-
when: false
9+
type: str
10+
default: "{{ project_name | replace('-', '_')}}"
11+
when: false
1312

14-
package_type:
15-
type: str
16-
help: Package type
17-
choices:
18-
- wheel
19-
- complete
20-
default: wheel
21-
22-
23-
# com.identifier.app
2413
identifier:
25-
type: str
26-
help: Identifier
27-
default: "com.{{ project_name }}.app"
28-
29-
package_manager:
30-
type: str
31-
help: Choose your package manager
32-
choices:
33-
- pnpm
34-
# - yarn
35-
- npm
36-
# - deno
37-
# - bun
38-
39-
ui_template:
40-
type: str
41-
help: Choose your ui template
42-
choices:
43-
# - Vanilla
44-
- Vue
45-
# - Svelte
46-
- React
47-
# - Solid
48-
# - Angular
49-
# - Preact
50-
default:
51-
Vue
52-
53-
# We force TypeScript for now.
54-
#ui_flavor:
55-
# type: str
56-
# help: Choose your ui flavor
57-
# choices:
58-
# - TypeScript
59-
# - JavaScript
14+
type: str
15+
help: Identifier
16+
default: "com.{{ project_name }}.app"
17+
18+
template:
19+
type: str
20+
help: Choose your UI template
21+
choices:
22+
Vue: vue
23+
React: react
24+
default: vue
6025

6126
_message_after_copy: |
62-
Done. Now run:
63-
64-
cd {{ project_name }}
65-
uv venv --python-preference only-system
66-
.venv\Scripts\activate
67-
uv pip install -e src-tauri\src-python
68-
69-
70-
## TODO: Only execute init.py on complete package_type.
71-
## TODO: Remove scripts directory after copying.
72-
#_tasks:
73-
# - ["{{ _copier_python }}", scripts/init.py]
74-
## - "rmdir {{ project_name }}/scripts"
27+
Template created! To get started run:
28+
cd {{ project_name }}
29+
pnpm install
30+
uv venv --python-preference only-system
31+
{%- if _copier_conf.os == "windows" %}
32+
.venv\Scripts\activate
33+
{%- else %}
34+
source .venv/bin/activate
35+
{%- endif %}
36+
uv sync
37+
38+
For Desktop development, run:
39+
pnpm tauri dev
40+
41+
For building a standalone app, see the `scripts/` folder.

package.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "create-pytauri",
3+
"private": true,
4+
"version": "0.1.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "vue-tsc --noEmit && vite build",
9+
"preview": "vite preview",
10+
"tauri": "tauri"
11+
},
12+
"dependencies": {
13+
"vue": "^3.5.13",
14+
"@tauri-apps/api": "^2",
15+
"@tauri-apps/plugin-opener": "^2",
16+
"tauri-plugin-pytauri-api": "^0.5.0"
17+
},
18+
"devDependencies": {
19+
"@vitejs/plugin-vue": "^5.2.1",
20+
"typescript": "~5.6.2",
21+
"vite": "^6.0.3",
22+
"vue-tsc": "^2.1.10",
23+
"@tauri-apps/cli": "^2"
24+
}
25+
}

0 commit comments

Comments
 (0)