Skip to content

Commit

Permalink
Add debug
Browse files Browse the repository at this point in the history
  • Loading branch information
garronej committed Sep 30, 2024
1 parent 4647712 commit 6e4ed78
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions scripts/build/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,37 @@ import { crawl } from '../tools/crawl';
{
const angularWorkspaceDirPath = pathJoin(distDirPath, 'workspace');

console.log('a');

if (fs.existsSync(distDirPath)) {
fs.rmSync(distDirPath, { recursive: true, force: true });
}

console.log('b');

transformCodebase({
srcDirPath: pathJoin(__dirname, 'workspace'),
destDirPath: angularWorkspaceDirPath
});

console.log('c');

const srcDirPath_workspace = pathJoin(
angularWorkspaceDirPath,
'projects',
'keycloakify-angular',
'src'
);

console.log('e');

transformCodebase({
srcDirPath: pathJoin(getThisCodebaseRootDirPath(), 'src'),
destDirPath: srcDirPath_workspace
});

console.log('f');

{
const typescriptFilesRelativeFilePaths = crawl({
dirPath: pathJoin(getThisCodebaseRootDirPath(), 'src'),
Expand All @@ -57,14 +67,20 @@ import { crawl } from '../tools/crawl';
);
}

console.log('g');

run(`npx ng build`, { cwd: angularWorkspaceDirPath });

console.log('h');

const angularDistDirPath = pathJoin(
angularWorkspaceDirPath,
'dist',
'keycloakify-angular'
);

console.log('i');

transformCodebase({
srcDirPath: pathJoin(angularDistDirPath, 'esm2022'),
destDirPath: distDirPath,
Expand All @@ -81,6 +97,8 @@ import { crawl } from '../tools/crawl';
}
});

console.log('j');

transformCodebase({
srcDirPath: angularDistDirPath,
destDirPath: distDirPath,
Expand Down Expand Up @@ -109,11 +127,17 @@ import { crawl } from '../tools/crawl';
}
});

console.log('k');

fs.rmSync(angularWorkspaceDirPath, { recursive: true, force: true });
}

console.log('l');

run(`npx tsc-alias -p ${pathJoin('src', 'tsconfig.json')}`);

console.log('m');

{
const dirBasename = 'src';

Expand All @@ -124,6 +148,8 @@ import { crawl } from '../tools/crawl';
fs.cpSync(dirBasename, destDirPath, { recursive: true });
}

console.log('n');

transformCodebase({
srcDirPath: pathJoin(getThisCodebaseRootDirPath(), 'stories'),
destDirPath: pathJoin(getThisCodebaseRootDirPath(), 'dist', 'stories'),
Expand All @@ -136,6 +162,8 @@ import { crawl } from '../tools/crawl';
}
});

console.log('o');

console.log(
chalk.green(`✓ built in ${((Date.now() - startTime) / 1000).toFixed(2)}s`)
);
Expand Down

0 comments on commit 6e4ed78

Please sign in to comment.