@duonghieu0712z/create-tauri-vue-template 0.0.4 → 0.0.5
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/cli/project.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { resolve } from 'node:path';
|
|
2
2
|
import { readJson, updateText, writeJson } from './files.js';
|
|
3
3
|
import { updateReleaseWorkflow } from './release-workflow.js';
|
|
4
|
+
const initialProjectVersion = '0.0.1';
|
|
4
5
|
export async function renameProject(targetDir, identity) {
|
|
5
6
|
const packageJsonPath = resolve(targetDir, 'package.json');
|
|
6
7
|
const packageJson = await readJson(packageJsonPath);
|
|
7
8
|
packageJson.name = identity.packageName;
|
|
9
|
+
packageJson.version = initialProjectVersion;
|
|
8
10
|
if (identity.author) {
|
|
9
11
|
packageJson.author = identity.author;
|
|
10
12
|
}
|
|
@@ -15,6 +17,7 @@ export async function renameProject(targetDir, identity) {
|
|
|
15
17
|
const tauriConfigPath = resolve(targetDir, 'src-tauri', 'tauri.conf.json');
|
|
16
18
|
const tauriConfig = await readJson(tauriConfigPath);
|
|
17
19
|
tauriConfig.productName = identity.appName;
|
|
20
|
+
tauriConfig.version = initialProjectVersion;
|
|
18
21
|
tauriConfig.identifier = identity.identifier;
|
|
19
22
|
tauriConfig.app.windows = tauriConfig.app.windows.map((window) => ({
|
|
20
23
|
...window,
|
|
@@ -32,6 +35,7 @@ export async function renameProject(targetDir, identity) {
|
|
|
32
35
|
]);
|
|
33
36
|
await updateText(resolve(targetDir, 'src-tauri', 'Cargo.toml'), [
|
|
34
37
|
[/^name = "([^"]+)"/m, `name = "${identity.crateName}"`],
|
|
38
|
+
[/^version = "([^"]+)"/m, `version = "${initialProjectVersion}"`],
|
|
35
39
|
[/^description = "([^"]+)"/m, `description = "${identity.appName}"`],
|
|
36
40
|
[/^(\[lib\]\s+[\s\S]*?^name = )"([^"]+)"/m, `$1"${identity.crateLibName}"`],
|
|
37
41
|
]);
|
package/dist/cli/scaffold.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { access, copyFile, cp, mkdir, readdir } from 'node:fs/promises';
|
|
1
|
+
import { access, copyFile, cp, mkdir, readdir, rm } from 'node:fs/promises';
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
3
|
import { renameProject } from './project.js';
|
|
4
4
|
export async function ensureEmptyTarget(path) {
|
|
@@ -20,11 +20,15 @@ export async function writeEditorSettings(targetDir, packageDir) {
|
|
|
20
20
|
await mkdir(resolve(targetDir, '.vscode'), { recursive: true });
|
|
21
21
|
await copyFile(resolve(packageDir, 'assets', 'vscode-settings.json'), resolve(targetDir, '.vscode', 'settings.json'));
|
|
22
22
|
}
|
|
23
|
+
async function removeTemplateArtifacts(targetDir) {
|
|
24
|
+
await Promise.all(['CHANGELOG.md', 'Changelog.md', 'changelog.md'].map((fileName) => rm(resolve(targetDir, fileName), { force: true })));
|
|
25
|
+
}
|
|
23
26
|
export async function scaffoldProject(targetDir, packageDir, identity) {
|
|
24
27
|
const templateDir = resolve(packageDir, 'template');
|
|
25
28
|
await ensureTemplate(templateDir);
|
|
26
29
|
await ensureEmptyTarget(targetDir);
|
|
27
30
|
await cp(templateDir, targetDir, { recursive: true });
|
|
31
|
+
await removeTemplateArtifacts(targetDir);
|
|
28
32
|
await writeEditorSettings(targetDir, packageDir);
|
|
29
33
|
await renameProject(targetDir, identity);
|
|
30
34
|
}
|
|
@@ -22,11 +22,14 @@ const excludedPaths = new Set([
|
|
|
22
22
|
'packages',
|
|
23
23
|
'src-tauri/target',
|
|
24
24
|
]);
|
|
25
|
+
const excludedFileNames = new Set(['changelog.md']);
|
|
25
26
|
function normalizePath(path) {
|
|
26
27
|
return path.replaceAll('\\', '/');
|
|
27
28
|
}
|
|
28
29
|
function shouldInclude(relativePath) {
|
|
29
|
-
|
|
30
|
+
const normalizedPath = normalizePath(relativePath);
|
|
31
|
+
const fileName = normalizedPath.split('/').at(-1)?.toLowerCase();
|
|
32
|
+
return !excludedPaths.has(normalizedPath) && !excludedFileNames.has(fileName ?? '');
|
|
30
33
|
}
|
|
31
34
|
async function copyTemplateSource(sourceDir) {
|
|
32
35
|
await mkdir(templateDir, { recursive: true });
|
package/package.json
CHANGED
package/template/CHANGELOG.md
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## v0.0.1 - 2026-05-23
|
|
4
|
-
|
|
5
|
-
### Added
|
|
6
|
-
|
|
7
|
-
- Initial Tauri 2 desktop application template with Vue 3, TypeScript, Vite, and Tailwind CSS 4.
|
|
8
|
-
- shadcn-vue conventions, Lucide Vue, and shared UI utilities for application interface development.
|
|
9
|
-
- Rust backend shell with Tauri command registration and generated Rust-to-TypeScript bindings through Specta.
|
|
10
|
-
- Project scripts for development, production builds, app renaming, version bumping, linting, and formatting.
|
|
11
|
-
- GitHub Actions workflows for frontend quality checks, Rust formatting and Clippy checks, and cross-platform release builds.
|
|
12
|
-
- Release packaging for macOS, Linux, and Windows through `tauri-apps/tauri-action`.
|