Skip to content

Commit

Permalink
feat: user-provided tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
mrgrain committed May 13, 2024
1 parent 2307b2b commit 502f639
Show file tree
Hide file tree
Showing 24 changed files with 1,818 additions and 257 deletions.
4 changes: 4 additions & 0 deletions .projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ project.vscode!.settings.addSetting('explorer.excludeGitIgnore', true);
project.vscode!.settings.addSetting('typescript.tsdk', 'node_modules/typescript/lib');
// Format-on-save using ESLint
project.vscode!.extensions.addRecommendations('dbaeumer.vscode-eslint');
project.vscode!.settings.addSetting('editor.codeActionsOnSave', { 'source.fixAll.eslint': true });
project.vscode!.settings.addSetting('editor.codeActionsOnSave', { 'source.fixAll.eslint': 'explicit' });
project.vscode!.settings.addSetting('eslint.validate', ['typescript']);

// Exports map...
Expand All @@ -181,14 +181,14 @@ project.package.addField('exports', {
project.deps.removeDependency('typescript');

// Modernize ts-jest configuration
if (project.jest?.config?.globals?.['ts-jest']) {
delete project.jest.config.globals['ts-jest'];
if (project.jest?.config) {
project.jest.config.transform ??= {};
project.jest.config.transform['^.+\\.tsx?$'] = [
project.jest.config.transform['^.+\\.[t]sx?$'] = [
'ts-jest',
{
compiler: 'typescript',
tsconfig: 'tsconfig.dev.json',
diagnostics: { ignoreCodes: ['TS151001'] },
},
];
}
Expand Down Expand Up @@ -232,6 +232,7 @@ project.addDevDeps(
'all-contributors-cli',
'clone',
'eslint-plugin-unicorn',
'fast-check',
'jsii-1.x@npm:jsii@1',
'lockfile',
'glob',
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build-tools/code-gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const { commit, suffix } = (function () {
writeFileSync(
join(__dirname, '..', 'src', 'version.ts'),
[
"import { versionMajorMinor } from 'typescript'",
"import { versionMajorMinor } from 'typescript';",
'',
'// GENERATED: This file is generated by build-tools/code-gen.ts -- Do not edit by hand!',
'',
Expand Down
8 changes: 7 additions & 1 deletion jest.config.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const camel = withCache(Case.camel);
export const constant = withCache(Case.constant);
export const pascal = withCache(Case.pascal);
export const snake = withCache(Case.snake);
export const kebab = withCache(Case.kebab);

class Cache {
public static fetch(text: string, func: (text: string) => string): string {
Expand Down

0 comments on commit 502f639

Please sign in to comment.