Skip to content

Commit

Permalink
chore: ignore play page.svelte (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
baiwusanyu-c authored Aug 31, 2023
1 parent a5eda5f commit f1cd546
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 351 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"init": "pnpm i",
"dev": "pnpm run build && pnpm run play",
"dev:docs": "pnpm run --filter @ikun-ui/docs docs:dev",
"play": "pnpm run --filter @ikun-ui/play dev",
"play": "esno scripts/play.js && pnpm run --filter @ikun-ui/play dev",
"build": "run-s build:* && run-s build-*",
"build-preset": "pnpm run --filter @ikun-ui/preset build",
"build-lib": "tsup --config tsup.config.ts",
Expand Down
1 change: 1 addition & 0 deletions play/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ node_modules
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
src/routes/+page.svelte
7 changes: 0 additions & 7 deletions play/src/index.test.ts

This file was deleted.

343 changes: 0 additions & 343 deletions play/src/routes/+page.svelte

This file was deleted.

26 changes: 26 additions & 0 deletions scripts/play.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Create play template
*/
import * as fs from 'fs'
const PLAY_PATH = 'play/src/routes'
const content = `<script lang="ts">
import 'virtual:uno.css';
import { KButton } from '@ikun-ui/button'
</script>
<KButton type="info" cls="mx-2">
info
</KButton>
`
function createPlayTemplate(){
if (!fs.existsSync(`${PLAY_PATH}/+page.svelte`)) {
fs.mkdirSync(PLAY_PATH, { recursive: true });
fs.writeFile(`${PLAY_PATH}/+page.svelte`, content, (err) => {
if (err) {
console.error('Error writing file:', err);
} else {
console.log(`File +page.svelte has been created with the specified content.`);
}
});
}
}
createPlayTemplate()

0 comments on commit f1cd546

Please sign in to comment.