-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This allows one to eject out the default layout and style to more easily customize a default layout site. Specify the --src flag to determine the target path of the eject.
- Loading branch information
Showing
9 changed files
with
160 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
@import './local-import.css' | ||
@import './local-import.css'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
# Default Layout | ||
|
||
TopBun ships a default layout when you don't have a `root.layout.js` file in the root | ||
of your `src` directory. | ||
TopBun ships a default layout when you don't have a `root.layout.js` file your `src` directory. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* @typedef {import('node:readline').Interface} Interface | ||
*/ | ||
|
||
/** | ||
* @param {Interface} rl | ||
* @param {string} question | ||
* @return {Promise<boolean>} [description] | ||
*/ | ||
export function askYesNo (rl, question) { | ||
return new Promise((resolve) => { | ||
const query = () => { | ||
rl.question(`${question} (Y/n) `, (answer) => { | ||
const lowercaseAnswer = answer.toLowerCase() | ||
if (['yes', 'ye', 'y', ''].includes(lowercaseAnswer)) { | ||
resolve(true) | ||
} else if (['no', 'n'].includes(lowercaseAnswer)) { | ||
resolve(false) | ||
} else { | ||
console.log('Invalid response. Please answer with yes (Y) or no (n).') | ||
query() // Re-prompt if invalid input | ||
} | ||
}) | ||
} | ||
|
||
query() | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { promises as fs } from 'node:fs' | ||
import path from 'node:path' | ||
|
||
/** | ||
* @param {string} source | ||
* @param {string} target | ||
*/ | ||
export async function copyFile (source, target) { | ||
// Extract the directory part of the target path | ||
const targetDir = path.dirname(target) | ||
|
||
// Ensure the target directory exists | ||
await fs.mkdir(targetDir, { recursive: true }) | ||
|
||
// Copy the file | ||
await fs.copyFile(source, target) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters