mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
feat(sandbox): rebuild sandbox with shell UI and expanded templates (#773)
This commit is contained in:
@@ -7,6 +7,8 @@ import prompts from 'prompts';
|
||||
|
||||
const SOURCE = './src';
|
||||
const TEMPLATES = './templates';
|
||||
// Some file always live in src
|
||||
const IGNORE = new Set(['index.html', 'main.tsx']);
|
||||
|
||||
function colorizePatch(patch: string): string {
|
||||
return patch
|
||||
@@ -38,7 +40,12 @@ console.log(chalk.bold(`\nComparing ${SOURCE} → ${TEMPLATES}\n`));
|
||||
const res = compareSync(SOURCE, TEMPLATES, { compareContent: true });
|
||||
|
||||
const changes = (res.diffSet ?? []).filter(
|
||||
(d) => d.state !== 'equal' && d.type1 !== 'directory' && d.type2 !== 'directory'
|
||||
(d) =>
|
||||
d.state !== 'equal' &&
|
||||
d.type1 !== 'directory' &&
|
||||
d.type2 !== 'directory' &&
|
||||
!IGNORE.has(d.name1 ?? '') &&
|
||||
!IGNORE.has(d.name2 ?? '')
|
||||
);
|
||||
|
||||
if (changes.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user