Skip to content

Commit

Permalink
feat(projen): Configure ReadmeFile
Browse files Browse the repository at this point in the history
Adds support for creating sample `README` files with Projen.
  • Loading branch information
langri-sha committed Jul 18, 2024
1 parent e3a0e09 commit 7f0e128
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 28 deletions.
142 changes: 114 additions & 28 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ const project = new Project({
pnpmWorkspace: {
packages: ['apps/*', 'packages/*'],
},
readme: {
filename: 'readme',
},
renovate: {
packageRules: [
{
Expand Down Expand Up @@ -109,10 +112,6 @@ const subproject = (project: Project) => {
contents: 'export {}',
})

new SampleFile(project, 'readme', {
contents: `# ${project.name}\n`,
})

project.tryRemoveFile('.gitignore')

project.package?.addField('repository', {
Expand Down Expand Up @@ -167,6 +166,9 @@ project.addSubproject(
name: '@langri-sha/babel-preset',
outdir: path.join('packages', 'babel-preset'),
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
Expand All @@ -193,10 +195,13 @@ project.addSubproject(
{
name: '@langri-sha/babel-test',
outdir: path.join('packages', 'babel-test'),
typeScriptConfig: {},
npmIgnore: {
ignorePatterns: ['fixtures/'],
},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
copyrightYear: '2024',
Expand All @@ -221,6 +226,9 @@ project.addSubproject(
name: '@langri-sha/eslint-config',
outdir: path.join('packages', 'eslint-config'),
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
Expand Down Expand Up @@ -251,8 +259,11 @@ project.addSubproject(
{
name: '@langri-sha/jest-config',
outdir: path.join('packages', 'jest-config'),
typeScriptConfig: {},
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
copyrightYear: '2024',
Expand All @@ -268,8 +279,11 @@ project.addSubproject(
{
name: '@langri-sha/jest-test',
outdir: path.join('packages', 'jest-test'),
typeScriptConfig: {},
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
copyrightYear: '2024',
Expand All @@ -287,6 +301,9 @@ project.addSubproject(
name: '@langri-sha/lint-staged',
outdir: path.join('packages', 'lint-staged'),
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
Expand All @@ -305,8 +322,11 @@ project.addSubproject(
{
name: '@langri-sha/monorepo',
outdir: path.join('packages', 'monorepo'),
typeScriptConfig: {},
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
copyrightYear: '2024',
Expand All @@ -325,6 +345,9 @@ project.addSubproject(
name: '@langri-sha/prettier',
outdir: path.join('packages', 'prettier'),
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
Expand All @@ -343,8 +366,11 @@ project.addSubproject(
{
name: '@langri-sha/projen-codeowners',
outdir: path.join('packages', 'projen-codeowners'),
typeScriptConfig: {},
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
copyrightYear: '2024',
Expand All @@ -361,8 +387,11 @@ project.addSubproject(
{
name: '@langri-sha/projen-babel',
outdir: path.join('packages', 'projen-babel'),
typeScriptConfig: {},
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
copyrightYear: '2024',
Expand All @@ -385,8 +414,11 @@ project.addSubproject(
{
name: '@langri-sha/projen-beachball',
outdir: path.join('packages', 'projen-beachball'),
typeScriptConfig: {},
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
copyrightYear: '2024',
Expand All @@ -403,8 +435,11 @@ project.addSubproject(
{
name: '@langri-sha/projen-editorconfig',
outdir: path.join('packages', 'projen-editorconfig'),
typeScriptConfig: {},
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
copyrightYear: '2024',
Expand All @@ -421,8 +456,11 @@ project.addSubproject(
{
name: '@langri-sha/projen-eslint',
outdir: path.join('packages', 'projen-eslint'),
typeScriptConfig: {},
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
copyrightYear: '2024',
Expand All @@ -441,8 +479,11 @@ project.addSubproject(
{
name: '@langri-sha/projen-husky',
outdir: path.join('packages', 'projen-husky'),
typeScriptConfig: {},
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
type: 'module',
Expand All @@ -460,8 +501,11 @@ project.addSubproject(
{
name: '@langri-sha/projen-jest-config',
outdir: path.join('packages', 'projen-jest-config'),
typeScriptConfig: {},
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
copyrightYear: '2024',
Expand All @@ -480,8 +524,11 @@ project.addSubproject(
{
name: '@langri-sha/projen-lint-synthesized',
outdir: path.join('packages', 'projen-lint-synthesized'),
typeScriptConfig: {},
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
copyrightYear: '2024',
Expand All @@ -500,8 +547,11 @@ project.addSubproject(
{
name: '@langri-sha/projen-lint-staged',
outdir: path.join('packages', 'projen-lint-staged'),
typeScriptConfig: {},
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
copyrightYear: '2024',
Expand All @@ -520,14 +570,17 @@ project.addSubproject(
{
name: '@langri-sha/projen-license',
outdir: path.join('packages', 'projen-license'),
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {
config: {
compilerOptions: {
typeRoots: ['node_modules/@types', 'types'],
},
},
},
npmIgnore: {},
package: {
...pkg,
copyrightYear: '2024',
Expand All @@ -545,8 +598,11 @@ project.addSubproject(
{
name: '@langri-sha/projen-pnpm-workspace',
outdir: path.join('packages', 'projen-pnpm-workspace'),
typeScriptConfig: {},
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
copyrightYear: '2024',
Expand All @@ -564,8 +620,11 @@ project.addSubproject(
{
name: '@langri-sha/projen-prettier',
outdir: path.join('packages', 'projen-prettier'),
typeScriptConfig: {},
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
copyrightYear: '2024',
Expand All @@ -584,8 +643,11 @@ project.addSubproject(
{
name: '@langri-sha/projen-project',
outdir: path.join('packages', 'projen-project'),
typeScriptConfig: {},
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
copyrightYear: '2024',
Expand Down Expand Up @@ -671,8 +733,11 @@ project.addSubproject(
{
name: '@langri-sha/projen-readme',
outdir: path.join('packages', 'projen-readme'),
typeScriptConfig: {},
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
copyrightYear: '2024',
Expand All @@ -689,8 +754,11 @@ project.addSubproject(
{
name: '@langri-sha/projen-renovate',
outdir: path.join('packages', 'projen-renovate'),
typeScriptConfig: {},
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
copyrightYear: '2024',
Expand All @@ -717,8 +785,11 @@ project.addSubproject(
{
name: '@langri-sha/projen-swcrc',
outdir: path.join('packages', 'projen-swcrc'),
typeScriptConfig: {},
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
copyrightYear: '2024',
Expand All @@ -745,8 +816,11 @@ project.addSubproject(
{
name: '@langri-sha/projen-typescript-config',
outdir: path.join('packages', 'projen-typescript-config'),
typeScriptConfig: {},
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
copyrightYear: '2024',
Expand All @@ -765,8 +839,11 @@ project.addSubproject(
{
name: '@langri-sha/schemastore-to-typescript',
outdir: path.join('packages', 'schemastore-to-typescript'),
typeScriptConfig: {},
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
copyrightYear: '2024',
Expand Down Expand Up @@ -806,6 +883,9 @@ project.addSubproject(
name: '@langri-sha/tsconfig',
outdir: path.join('packages', 'tsconfig'),
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
Expand All @@ -822,8 +902,11 @@ project.addSubproject(
{
name: '@langri-sha/vitest',
outdir: path.join('packages', 'vitest'),
typeScriptConfig: {},
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
copyrightYear: '2024',
Expand All @@ -840,8 +923,11 @@ project.addSubproject(
{
name: '@langri-sha/webpack',
outdir: path.join('packages', 'webpack'),
typeScriptConfig: {},
npmIgnore: {},
readme: {
filename: 'readme',
},
typeScriptConfig: {},
package: {
...pkg,
copyrightYear: '2024',
Expand Down
1 change: 1 addition & 0 deletions readme
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# langri-sha.com

0 comments on commit 7f0e128

Please sign in to comment.