Skip to content

Commit 0f778e2

Browse files
feat: add preact and preact-tS templates (#145)
1 parent 27f31ae commit 0f778e2

42 files changed

Lines changed: 403 additions & 36 deletions

File tree

Some content is hidden

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

.changes/preact.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"create-tauri-app": "patch"
3+
"create-tauri-app-js": "patch"
4+
---
5+
6+
Add `preact` and `preact-ts` templates.

.github/CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ A template is a just combination of two fragments, [`fragment-base`](../packages
6565
- Add a directory in `<repo-root>/packages/cli/fragments` and name `fragment-template` where `template` is the name of the template and add all the files you need there as they should appear after the template is created.
6666
- In `<repo-root>/packages/cli/src/template.rs`, add an entry in the `Template` enum, modify `post_init_info` if needed and modify `FromStr` and `Display` implementation
6767
- In `<repo-root>/packages/cli/src/package_manager.rs` add your new template to the appropraite package manager in the `templates` method
68+
- Modify `<repo-root>/.scripts/generate-templates-matrix.js` and append the template name inside the template list for the appropriate package manager so the CI would run tests for it.
6869

6970
## Financial Contribution
7071

.scripts/generate-templates-matrix.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ const nodeJsTemplates = [
1212
"vanilla",
1313
"next",
1414
"next-ts",
15+
"preact",
16+
"preact-ts",
1517
];
1618

1719
const matrix = [

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ Currently supported template presets include:
8383
- `yew`
8484
- `next`
8585
- `next-ts`
86+
- `preact`
87+
- `preact-ts`
8688

8789
You can use `.` for the project name to scaffold in the current directory.
8890

Lines changed: 1 addition & 0 deletions
Loading

packages/cli/fragments/fragment-next-ts/src/pages/index.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ function App() {
5353
</span>
5454
</div>
5555

56-
<p>
57-
Click on the Tauri, Next, and React logos to learn more about each
58-
framework.
59-
</p>
56+
<p>Click on the Tauri, Next, and React logos to learn more.</p>
6057

6158
<div className="row">
6259
<div>

packages/cli/fragments/fragment-next/src/pages/index.jsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ function App() {
5353
</span>
5454
</div>
5555

56-
<p>
57-
Click on the Tauri, Next, and React logos to learn more about each
58-
framework.
59-
</p>
56+
<p>Click on the Tauri, Next, and React logos to learn more.</p>
6057

6158
<div className="row">
6259
<div>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"]
3+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Tauri + Preact + Typescript
2+
3+
This template should help get you started developing with Tauri, Preact and Typescript in Vite.
4+
5+
## Recommended IDE Setup
6+
7+
- [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
2+
# SPDX-License-Identifier: Apache-2.0
3+
# SPDX-License-Identifier: MIT
4+
5+
beforeDevCommand = {{pkg_manager_run_command}} dev
6+
beforeBuildCommand = {{pkg_manager_run_command}} build
7+
devPath = http://localhost:1420
8+
distDir = ../dist
9+
10+
[files]
11+
preact.svg = src/assets/preact.svg
12+
vite.svg = public/vite.svg
13+
tauri.svg = public/tauri.svg

0 commit comments

Comments
 (0)