Skip to content

Refactor to use only EJS for templating #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions packages/create-vue-lib/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,14 +474,6 @@ function copyFiles(templateFile: string, config: Config) {

fs.writeFileSync(target, content)
}
else if (['package.json', 'vite.config.mts', 'config.mts', 'index.md', 'introduction.md', 'App.vue', 'tsconfig.app.json', 'env.d.ts'].includes(filename)) {
const template = fs.readFileSync(templatePath, 'utf-8')
const content = template
.replace(/@projectName@/g, config.mainPackageDirName)
.replace(new RegExp(`@(${Object.keys(config).join('|')})@`, 'g'), (all, setting) => `${config[setting as keyof Config] ?? all}`)

fs.writeFileSync(targetPath, content)
}
else {
fs.copyFileSync(templatePath, targetPath)
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/// <reference types="vite/client" />

import '../<%- config.mainPackageDirName %>/env.d.ts'

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/// <reference types="vite/client" />

import '../<%- config.mainPackageDirName %>/env.d.ts'
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
layout: home

title: @unscopedPackageName@
title: <%- config.unscopedPackageName %>
titleTemplate: Title template

hero:
name: @unscopedPackageName@
name: <%- config.unscopedPackageName %>
text: Description
tagline: Tag line!
actions:
Expand All @@ -14,7 +14,7 @@ hero:
link: /introduction
- theme: alt
text: View on GitHub
link: https://github.com/@githubPath@
link: https://github.com/<%- config.githubPath %>
- theme: alt
text: See a demo
link: https://play.vuejs.org/
Expand Down