Skip to content

Commit

Permalink
Only copy scaffold files
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesrp13 committed Jan 22, 2024
1 parent 5df2577 commit d418f5d
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
6 changes: 3 additions & 3 deletions scaffolds/nextjs-dedicated-wallet/scaffold.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const definition = {

export default class DedicatedScaffold extends BaseScaffold {
public templateName = 'nextjs-dedicated-wallet';
private data: Data | undefined;
private data: Data;
public installationCommand: ExecaCommand = { command: 'npm', args: ['install'] };
public startCommand: ExecaCommand = { command: 'npm', args: ['run', 'dev'] };
public source: string | string[] = [
Expand Down Expand Up @@ -52,12 +52,12 @@ export default class DedicatedScaffold extends BaseScaffold {
'./src/utils',
];

constructor(data: Data | undefined) {
constructor(data: Data) {
super();
this.data = data;

if (typeof this.source !== 'string') {
data.loginMethods.forEach((authType) => {
data?.loginMethods.forEach((authType) => {
(this.source as string[]).push(`./src/components/magic/auth/${authType.replaceAll(' ', '')}.tsx`);
if (
authType === 'Discord' ||
Expand Down
4 changes: 2 additions & 2 deletions scaffolds/nextjs-flow-dedicated-wallet/scaffold.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const definition = {

export default class FlowDedicatedScaffold extends BaseScaffold {
public templateName = 'nextjs-flow-dedicated-wallet';
private data: Data | undefined;
private data: Data;
public installationCommand: ExecaCommand = { command: 'npm', args: ['install'] };
public startCommand: ExecaCommand = { command: 'npm', args: ['run', 'dev'] };
public source: string | string[] = [
Expand Down Expand Up @@ -52,7 +52,7 @@ export default class FlowDedicatedScaffold extends BaseScaffold {
'./src/utils',
];

constructor(data: Data | undefined) {
constructor(data: Data) {
super();
this.data = data;

Expand Down
4 changes: 2 additions & 2 deletions scaffolds/nextjs-flow-universal-wallet/scaffold.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ export const definition = {

export default class FlowUniversalScaffold extends BaseScaffold {
public templateName = 'nextjs-flow-universal-wallet';
private data: Data | undefined;
private data: Data;
public installationCommand: ExecaCommand = { command: 'npm', args: ['install'] };
public startCommand: ExecaCommand = { command: 'npm', args: ['run', 'dev'] };
public source: string | string[] = './';

constructor(data: Data | undefined) {
constructor(data: Data) {
super();
this.data = data;
}
Expand Down
4 changes: 2 additions & 2 deletions scaffolds/nextjs-solana-dedicated-wallet/scaffold.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const definition = {

export default class SolanaDedicatedScaffold extends BaseScaffold {
public templateName = 'nextjs-solana-dedicated-wallet';
private data: Data | undefined;
private data: Data;
public installationCommand: ExecaCommand = { command: 'npm', args: ['install'] };
public startCommand: ExecaCommand = { command: 'npm', args: ['run', 'dev'] };
public source: string | string[] = [
Expand Down Expand Up @@ -52,7 +52,7 @@ export default class SolanaDedicatedScaffold extends BaseScaffold {
'./src/utils',
];

constructor(data: Data | undefined) {
constructor(data: Data) {
super();
this.data = data;

Expand Down
4 changes: 2 additions & 2 deletions scaffolds/nextjs-universal-wallet/scaffold.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ export const definition = {

export default class UniversalScaffold extends BaseScaffold {
public templateName = 'nextjs-universal-wallet';
private data: Data | undefined;
private data: Data;
public installationCommand: ExecaCommand = { command: 'npm', args: ['install'] };
public startCommand: ExecaCommand = { command: 'npm', args: ['run', 'dev'] };
public source: string | string[] = './';

constructor(data: Data | undefined) {
constructor(data: Data) {
super();
this.data = data;
}
Expand Down
7 changes: 5 additions & 2 deletions scripts/template_dev/ejs_dev_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ if (!template) {

const ejsData = templateDevData[template];

const scaffoldInstance = new (require(`../../scaffolds/${template}/scaffold.ts`).default)();
const scaffoldInstance = new (require(`../../scaffolds/${template}/scaffold.ts`).default)(ejsData);

console.log('Rebuilding template...');
fs.rmSync('./.template-dev', { recursive: true, force: true });
fs.mkdir('./.template-dev');

fs.cpSync(`./scaffolds/${template}/template`, './.template-dev', { recursive: true });
scaffoldInstance.source.forEach((source) => {
fs.cpSync(`./scaffolds/${template}/template/${source}`, `./.template-dev/${source}`, { recursive: true });
});

process.chdir('./.template-dev');

Expand Down

0 comments on commit d418f5d

Please sign in to comment.