@jakubmazanec/carson-templates 1.0.0 → 2.0.0-next.2fa8a2c

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/LICENSE.md +0 -2
  2. package/README.md +1 -1
  3. package/build/constants.d.ts +60 -0
  4. package/build/constants.js +89 -0
  5. package/build/constants.js.map +7 -0
  6. package/build/dependency-versions.d.ts +1 -0
  7. package/build/dependency-versions.js +58 -0
  8. package/build/dependency-versions.js.map +7 -0
  9. package/build/getDependencies.d.ts +2 -0
  10. package/build/getDependencies.js +44 -0
  11. package/build/getDependencies.js.map +7 -0
  12. package/build/getDevelopmentBranch.d.ts +2 -0
  13. package/build/getDevelopmentBranch.js +11 -0
  14. package/build/getDevelopmentBranch.js.map +7 -0
  15. package/build/getMainBranch.d.ts +2 -0
  16. package/build/getMainBranch.js +11 -0
  17. package/build/getMainBranch.js.map +7 -0
  18. package/build/getReferences.d.ts +4 -0
  19. package/build/getReferences.js +20 -0
  20. package/build/getReferences.js.map +7 -0
  21. package/build/getWorkspaceName.d.ts +2 -0
  22. package/build/getWorkspaceName.js +16 -0
  23. package/build/getWorkspaceName.js.map +7 -0
  24. package/build/main.d.ts +8 -0
  25. package/build/main.js +10 -0
  26. package/build/main.js.map +7 -0
  27. package/package.json +31 -20
  28. package/source/constants.ts +94 -0
  29. package/source/dependency-versions.ts +69 -0
  30. package/source/getDependencies.ts +58 -0
  31. package/source/getDevelopmentBranch.ts +13 -0
  32. package/source/getMainBranch.ts +13 -0
  33. package/source/getReferences.ts +29 -0
  34. package/source/getWorkspaceName.ts +20 -0
  35. package/source/main.ts +8 -0
  36. package/templates/projects/carson-templates/.eslintrc.cjs.ejs +21 -0
  37. package/templates/projects/carson-templates/.prettierignore.ejs +3 -0
  38. package/templates/projects/carson-templates/CONTRIBUTING.md.ejs +3 -0
  39. package/templates/projects/carson-templates/package.json.ejs +26 -12
  40. package/templates/projects/carson-templates/prettier.config.cjs.ejs +3 -0
  41. package/templates/projects/carson-templates/source/main.ts.check.ejs +4 -0
  42. package/templates/projects/carson-templates/source/main.ts.create.ejs +6 -0
  43. package/templates/projects/carson-templates/tests/tsconfig.json.ejs +19 -12
  44. package/templates/projects/carson-templates/tsconfig.json.ejs +23 -9
  45. package/templates/projects/carson-templates/tsconfig.typecheck.json.ejs +1 -12
  46. package/templates/projects/carson-templates/typedoc.config.cjs.ejs +1 -10
  47. package/templates/projects/changesets-changelog/.eslintrc.cjs.ejs +21 -0
  48. package/templates/projects/changesets-changelog/.prettierignore.ejs +3 -0
  49. package/templates/projects/changesets-changelog/CONTRIBUTING.md.ejs +3 -0
  50. package/templates/projects/changesets-changelog/package.json.ejs +38 -20
  51. package/templates/projects/changesets-changelog/prettier.config.cjs.ejs +3 -0
  52. package/templates/projects/changesets-changelog/source/main.ts.check.ejs +4 -0
  53. package/templates/projects/changesets-changelog/source/main.ts.create.ejs +6 -0
  54. package/templates/projects/changesets-changelog/tests/tsconfig.json.ejs +19 -12
  55. package/templates/projects/changesets-changelog/tsconfig.json.ejs +23 -9
  56. package/templates/projects/changesets-changelog/tsconfig.typecheck.json.ejs +21 -10
  57. package/templates/projects/eslint-config/.eslintrc.cjs.ejs +21 -0
  58. package/templates/projects/eslint-config/.prettierignore.ejs +3 -0
  59. package/templates/projects/eslint-config/CONTRIBUTING.md.ejs +3 -0
  60. package/templates/projects/eslint-config/package.json.ejs +39 -25
  61. package/templates/projects/eslint-config/prettier.config.cjs.ejs +3 -0
  62. package/templates/projects/eslint-config/source/main.ts.check.ejs +4 -0
  63. package/templates/projects/eslint-config/source/main.ts.create.ejs +6 -0
  64. package/templates/projects/eslint-config/tsconfig.json.ejs +23 -9
  65. package/templates/projects/eslint-config/tsconfig.typecheck.json.ejs +20 -9
  66. package/templates/projects/library/.eslintrc.cjs.ejs +21 -0
  67. package/templates/projects/library/.prettierignore.ejs +3 -0
  68. package/templates/projects/library/CONTRIBUTING.md.ejs +18 -0
  69. package/templates/projects/library/README.md.create.ejs +36 -0
  70. package/templates/projects/library/package.json.create.ejs +1 -1
  71. package/templates/projects/library/package.json.ejs +35 -13
  72. package/templates/projects/library/prettier.config.cjs.ejs +3 -0
  73. package/templates/projects/library/source/main.ts.check.ejs +4 -0
  74. package/templates/projects/library/source/main.ts.create.ejs +5 -0
  75. package/templates/projects/library/tests/tsconfig.json.ejs +19 -12
  76. package/templates/projects/library/tsconfig.json.ejs +23 -9
  77. package/templates/projects/library/tsconfig.typecheck.json.ejs +20 -9
  78. package/templates/projects/library/typedoc.config.cjs.ejs +13 -7
  79. package/templates/projects/remix-app/.eslintrc.cjs.ejs +21 -0
  80. package/templates/projects/remix-app/.prettierignore.ejs +3 -0
  81. package/templates/projects/remix-app/CONTRIBUTING.md.ejs +3 -0
  82. package/templates/projects/remix-app/Dockerfile.ejs +47 -0
  83. package/templates/projects/remix-app/README.md.create.ejs +26 -0
  84. package/templates/projects/remix-app/app/entry.client.tsx.create.ejs +16 -0
  85. package/templates/projects/remix-app/app/root.tsx.create.ejs +26 -0
  86. package/templates/projects/remix-app/app/routes/_index.tsx.create.ejs +18 -0
  87. package/templates/projects/remix-app/app/tailwind.css.create.ejs +7 -0
  88. package/templates/projects/remix-app/config.json +4 -0
  89. package/templates/projects/remix-app/env.d.ts.ejs +14 -0
  90. package/templates/projects/remix-app/fly.toml.ejs +18 -0
  91. package/templates/projects/remix-app/package.json.create.ejs +14 -0
  92. package/templates/projects/remix-app/package.json.ejs +67 -0
  93. package/templates/projects/remix-app/postcss.config.cjs.ejs +18 -0
  94. package/templates/projects/remix-app/prettier.config.cjs.ejs +19 -0
  95. package/templates/projects/remix-app/tailwind.config.ts.ejs +21 -0
  96. package/templates/projects/remix-app/tests/setup.ts.ejs +13 -0
  97. package/templates/projects/remix-app/tests/tsconfig.json.ejs +24 -0
  98. package/templates/projects/remix-app/tsconfig.json.ejs +30 -0
  99. package/templates/projects/remix-app/tsconfig.typecheck.json.ejs +19 -0
  100. package/templates/projects/remix-app/vite.config.ts.ejs +40 -0
  101. package/templates/workspace/.eslintrc.cjs.ejs +9 -13
  102. package/templates/workspace/.github/workflows/{pull-request.yaml.ejs → check-pull-request.yaml.ejs} +30 -7
  103. package/templates/workspace/.github/workflows/merge-to-main-branch.yaml.ejs +12 -4
  104. package/templates/workspace/.github/workflows/release-pull-request.yaml.ejs +105 -0
  105. package/templates/workspace/.github/workflows/release.yaml.ejs +65 -105
  106. package/templates/workspace/.github/workflows/update-pull-request.yaml.ejs +139 -0
  107. package/templates/workspace/.gitignore.ejs +9 -1
  108. package/templates/workspace/.prettierignore.ejs +9 -10
  109. package/templates/workspace/CONTRIBUTING.md.ejs +18 -0
  110. package/templates/workspace/README.md.create.ejs +16 -0
  111. package/templates/workspace/README.md.insert.ejs +1 -0
  112. package/templates/workspace/package.json.ejs +6 -16
  113. package/templates/workspace/prettier.config.cjs.ejs +19 -0
  114. package/templates/workspace/tsconfig.json.ejs +23 -0
  115. package/templates/workspace/tsconfig.typecheck.json.ejs +10 -4
  116. package/templates/workspace/turbo.json.ejs +1 -1
  117. package/dist/main.d.ts +0 -10
  118. package/dist/main.js +0 -128
  119. package/dist/main.js.map +0 -1
  120. package/src/main.ts +0 -166
  121. package/templates/projects/carson-templates/.swcrc.ejs +0 -23
  122. package/templates/projects/carson-templates/jest.config.ts.ejs +0 -30
  123. package/templates/projects/carson-templates/src/main.ts.check.ejs +0 -5
  124. package/templates/projects/carson-templates/src/main.ts.create.ejs +0 -4
  125. package/templates/projects/changesets-changelog/.swcrc.ejs +0 -25
  126. package/templates/projects/changesets-changelog/jest.config.ts.ejs +0 -24
  127. package/templates/projects/changesets-changelog/src/main.ts.check.ejs +0 -5
  128. package/templates/projects/changesets-changelog/src/main.ts.create.ejs +0 -4
  129. package/templates/projects/eslint-config/.swcrc.ejs +0 -25
  130. package/templates/projects/eslint-config/jest.config.ts.ejs +0 -24
  131. package/templates/projects/eslint-config/src/main.ts.check.ejs +0 -5
  132. package/templates/projects/eslint-config/src/main.ts.create.ejs +0 -4
  133. package/templates/projects/eslint-config/tests/tsconfig.json.ejs +0 -17
  134. package/templates/projects/library/.swcrc.ejs +0 -23
  135. package/templates/projects/library/jest.config.ts.ejs +0 -30
  136. package/templates/projects/library/src/main.ts.check.ejs +0 -5
  137. package/templates/projects/library/src/main.ts.create.ejs +0 -4
  138. package/templates/workspace/prettier.config.js.ejs +0 -19
  139. package/templates/workspace/tsconfig.options.json.ejs +0 -24
@@ -2,16 +2,23 @@
2
2
  to: 'tests/tsconfig.json'
3
3
  strategy: overwrite
4
4
  ---
5
- {
6
- "extends": "../../../tsconfig.options.json",
7
- "compilerOptions": {
8
- "composite": false,
9
- "noEmit": true
5
+ <%
6
+ let tsconfig = {
7
+ compilerOptions: {
8
+ ...TSCONFIG_COMPILER_OPTIONS,
9
+ composite: false,
10
+ noEmit: true,
10
11
  },
11
- "include": ["./**/*"],
12
- "references": [
13
- {
14
- "path": ".."
15
- }
16
- ]
17
- }
12
+ include: ['./**/*'],
13
+ references: [{path: '..'}],
14
+ };
15
+ -%>
16
+ //
17
+ // DO NOT EDIT!
18
+ // This file was autogenerated by Carson.
19
+ // Changes may cause incorrect behavior and will be lost when the file is regenerated.
20
+ //
21
+ // Run `npx carson update workspace` to regenerate.
22
+ //
23
+
24
+ <%- JSON.stringify(tsconfig, null, 2) %>
@@ -2,13 +2,27 @@
2
2
  to: 'tsconfig.json'
3
3
  strategy: overwrite
4
4
  ---
5
- {
6
- "extends": "../../tsconfig.options.json",
7
- "compilerOptions": {
8
- "emitDeclarationOnly": true,
9
- "outDir": "./dist",
10
- "rootDir": "./src"
5
+ <%
6
+ let tsconfig = lodash.merge(
7
+ {
8
+ compilerOptions: {
9
+ ...TSCONFIG_COMPILER_OPTIONS,
10
+ emitDeclarationOnly: true,
11
+ outDir: `./${BUILD_DIRECTORY}`,
12
+ rootDir: `./${SOURCE_DIRECTORY}`,
13
+ },
14
+ include: [`./${SOURCE_DIRECTORY}/**/*`],
15
+ references: getReferences(workspace, project),
11
16
  },
12
- "include": ["./src/**/*"],
13
- "references": <%- JSON.stringify(getReferences(workspace, project), null, 2) %>
14
- }
17
+ project.config.overrides?.tsconfig ?? {},
18
+ );
19
+ -%>
20
+ //
21
+ // DO NOT EDIT!
22
+ // This file was autogenerated by Carson.
23
+ // Changes may cause incorrect behavior and will be lost when the file is regenerated.
24
+ //
25
+ // Run `npx carson update workspace` to regenerate.
26
+ //
27
+
28
+ <%- JSON.stringify(tsconfig, null, 2) %>
@@ -2,14 +2,25 @@
2
2
  to: 'tsconfig.typecheck.json'
3
3
  strategy: overwrite
4
4
  ---
5
- {
6
- "extends": "./tsconfig.json",
7
- "compilerOptions": {
8
- "composite": false,
9
- "emitDeclarationOnly": false,
10
- "exactOptionalPropertyTypes": false, // TODO: remove
11
- "noEmit": true,
12
- "rootDir": "."
5
+ <%
6
+ let tsconfig = {
7
+ extends: './tsconfig.json',
8
+ compilerOptions: {
9
+ composite: false,
10
+ emitDeclarationOnly: false,
11
+ exactOptionalPropertyTypes: false, // TODO: fix the source code and remove this
12
+ noEmit: true,
13
+ rootDir: '.',
13
14
  },
14
- "include": ["./src/**/*", "./tests/**/*", "./*"]
15
- }
15
+ include: [`./${SOURCE_DIRECTORY}/**/*`, './tests/**/*', './*'],
16
+ };
17
+ -%>
18
+ //
19
+ // DO NOT EDIT!
20
+ // This file was autogenerated by Carson.
21
+ // Changes may cause incorrect behavior and will be lost when the file is regenerated.
22
+ //
23
+ // Run `npx carson update workspace` to regenerate.
24
+ //
25
+
26
+ <%- JSON.stringify(tsconfig, null, 2) %>
@@ -0,0 +1,21 @@
1
+ ---
2
+ to: '.eslintrc.cjs'
3
+ strategy: overwrite
4
+ ---
5
+ /**
6
+ * DO NOT EDIT!
7
+ * This file was autogenerated by Carson.
8
+ * Changes may cause incorrect behavior and will be lost when the file is regenerated.
9
+ *
10
+ * Run `npx carson update workspace` to regenerate.
11
+ */
12
+
13
+ module.exports = {
14
+ root: true,
15
+ extends: [
16
+ '@jakubmazanec/eslint-config',
17
+ '@jakubmazanec/eslint-config/nodejs',
18
+ '@jakubmazanec/eslint-config/prettier',
19
+ ],
20
+ ignorePatterns: <%- JSON.stringify(LINT_IGNORE_PATTERNS, null, 2) %>,
21
+ };
@@ -0,0 +1,3 @@
1
+ ---
2
+ extends: '../../workspace/.prettierignore.ejs'
3
+ ---
@@ -0,0 +1,3 @@
1
+ ---
2
+ extends: '../library/CONTRIBUTING.md.ejs'
3
+ ---
@@ -3,31 +3,45 @@ to: 'package.json'
3
3
  strategy: merge
4
4
  ---
5
5
  <%
6
- let packageJson = {
7
- repository: {
8
- type: 'git',
9
- directory: project.relativePath,
6
+ let developmentDependencies = getDependencies(
7
+ [
8
+ '@types/node',
9
+ 'del-cli',
10
+ 'esbuild',
11
+ 'eslint',
12
+ 'prettier',
13
+ 'prettier-plugin-packagejson',
14
+ 'typescript',
15
+ ],
16
+ workspace,
17
+ );
18
+ let packageJson = lodash.merge(
19
+ {
20
+ repository: {
21
+ type: 'git',
22
+ directory: project.relativePath,
23
+ },
24
+ type: 'commonjs',
25
+ exports: {
26
+ '.': `./${BUILD_DIRECTORY}/main.js`,
27
+ './nodejs': `./${BUILD_DIRECTORY}/presets/nodejs.js`,
28
+ './prettier': `./${BUILD_DIRECTORY}/presets/prettier.js`,
29
+ },
30
+ files: [BUILD_DIRECTORY, SOURCE_DIRECTORY],
31
+ scripts: {
32
+ build: `del-cli ${BUILD_DIRECTORY} tsconfig.tsbuildinfo && ${BUILD_TO_CJS_COMMAND} && tsc`,
33
+ clean: `del-cli coverage ${BUILD_DIRECTORY} *.tsbuildinfo`,
34
+ format: FORMAT_COMMAND,
35
+ lint: 'eslint .',
36
+ typecheck: 'tsc --project tsconfig.typecheck.json',
37
+ },
38
+ devDependencies: developmentDependencies,
39
+ packageManager: 'npm@10.1.0',
40
+ engines: {
41
+ node: '^20.8.0',
42
+ },
10
43
  },
11
- type: 'commonjs',
12
- exports: {
13
- '.': './dist/main.js',
14
- './nextjs': './dist/presets/nextjs.js',
15
- './nodejs': './dist/presets/nodejs.js',
16
- './prettier': './dist/presets/prettier.js',
17
- },
18
- files: ['dist', 'src'],
19
- scripts: {
20
- build: 'swc src -d dist && tsc',
21
- clean: 'del-cli coverage dist *.tsbuildinfo',
22
- format: 'prettier . --write --ignore-unknown --ignore-path ../../.prettierignore',
23
- lint: 'eslint .',
24
- test: 'jest --passWithNoTests',
25
- typecheck: 'tsc --project tsconfig.typecheck.json',
26
- },
27
- packageManager: 'npm@8.19.4',
28
- engines: {
29
- node: '>=16.20.0',
30
- },
31
- };
44
+ project.config.overrides?.packageJson ?? {},
45
+ );
32
46
  -%>
33
47
  <%- JSON.stringify(packageJson) %>
@@ -0,0 +1,3 @@
1
+ ---
2
+ extends: '../../workspace/prettier.config.cjs.ejs'
3
+ ---
@@ -0,0 +1,4 @@
1
+ ---
2
+ to: <%- `${SOURCE_DIRECTORY}/main.ts` %>
3
+ strategy: check
4
+ ---
@@ -0,0 +1,6 @@
1
+ ---
2
+ to: <%- `${SOURCE_DIRECTORY}/main.ts` %>
3
+ strategy: create
4
+ ---
5
+ export {}
6
+
@@ -2,13 +2,27 @@
2
2
  to: 'tsconfig.json'
3
3
  strategy: overwrite
4
4
  ---
5
- {
6
- "extends": "../../tsconfig.options.json",
7
- "compilerOptions": {
8
- "emitDeclarationOnly": true,
9
- "outDir": "./dist",
10
- "rootDir": "./src"
5
+ <%
6
+ let tsconfig = lodash.merge(
7
+ {
8
+ compilerOptions: {
9
+ ...TSCONFIG_COMPILER_OPTIONS,
10
+ emitDeclarationOnly: true,
11
+ outDir: `./${BUILD_DIRECTORY}`,
12
+ rootDir: `./${SOURCE_DIRECTORY}`,
13
+ },
14
+ include: [`./${SOURCE_DIRECTORY}/**/*`],
15
+ references: getReferences(workspace, project),
11
16
  },
12
- "include": ["./src/**/*"],
13
- "references": <%- JSON.stringify(getReferences(workspace, project), null, 2) %>
14
- }
17
+ project.config.overrides?.tsconfig ?? {},
18
+ );
19
+ -%>
20
+ //
21
+ // DO NOT EDIT!
22
+ // This file was autogenerated by Carson.
23
+ // Changes may cause incorrect behavior and will be lost when the file is regenerated.
24
+ //
25
+ // Run `npx carson update workspace` to regenerate.
26
+ //
27
+
28
+ <%- JSON.stringify(tsconfig, null, 2) %>
@@ -2,13 +2,24 @@
2
2
  to: 'tsconfig.typecheck.json'
3
3
  strategy: overwrite
4
4
  ---
5
- {
6
- "extends": "./tsconfig.json",
7
- "compilerOptions": {
8
- "composite": false,
9
- "emitDeclarationOnly": false,
10
- "noEmit": true,
11
- "rootDir": "."
5
+ <%
6
+ let tsconfig = {
7
+ extends: './tsconfig.json',
8
+ compilerOptions: {
9
+ composite: false,
10
+ emitDeclarationOnly: false,
11
+ noEmit: true,
12
+ rootDir: '.',
12
13
  },
13
- "include": ["./src/**/*", "./tests/**/*", "./tools/**/*", "./*"]
14
- }
14
+ include: [`./${SOURCE_DIRECTORY}/**/*`, './tests/**/*', './tools/**/*', './*'],
15
+ };
16
+ -%>
17
+ //
18
+ // DO NOT EDIT!
19
+ // This file was autogenerated by Carson.
20
+ // Changes may cause incorrect behavior and will be lost when the file is regenerated.
21
+ //
22
+ // Run `npx carson update workspace` to regenerate.
23
+ //
24
+
25
+ <%- JSON.stringify(tsconfig, null, 2) %>
@@ -0,0 +1,21 @@
1
+ ---
2
+ to: '.eslintrc.cjs'
3
+ strategy: overwrite
4
+ ---
5
+ /**
6
+ * DO NOT EDIT!
7
+ * This file was autogenerated by Carson.
8
+ * Changes may cause incorrect behavior and will be lost when the file is regenerated.
9
+ *
10
+ * Run `npx carson update workspace` to regenerate.
11
+ */
12
+
13
+ module.exports = {
14
+ root: true,
15
+ extends: [
16
+ '@jakubmazanec/eslint-config',
17
+ '@jakubmazanec/eslint-config/nodejs',
18
+ '@jakubmazanec/eslint-config/prettier',
19
+ ],
20
+ ignorePatterns: <%- JSON.stringify(LINT_IGNORE_PATTERNS, null, 2) %>,
21
+ };
@@ -0,0 +1,3 @@
1
+ ---
2
+ extends: '../../workspace/.prettierignore.ejs'
3
+ ---
@@ -0,0 +1,18 @@
1
+ ---
2
+ to: 'CONTRIBUTING.md'
3
+ strategy: overwrite
4
+ ---
5
+ # Contributing
6
+
7
+ Thank you for your interest in contributing to this project! Your help is greatly appreciated.
8
+
9
+ ## Reporting Bugs
10
+
11
+ If you encounter a bug, please let me know by opening an issue with a detailed description. You can
12
+ also create a repository with a minimal reproducible example to help me fix it more quickly.
13
+
14
+ ## Pull Requests
15
+
16
+ At this time, I am not accepting pull requests from external contributors. However, if you have a
17
+ feature request, please feel free to open an issue to discuss it.
18
+
@@ -0,0 +1,36 @@
1
+ ---
2
+ to: 'README.md'
3
+ strategy: create
4
+ ---
5
+ <!-- header --><!-- header -->
6
+
7
+ ## Installation
8
+
9
+ ```sh
10
+ npm install <%- project.name %>
11
+ ```
12
+
13
+ ⚠️ This is an [ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) package!
14
+ It cannot be required from a CommonJS module.
15
+
16
+ #### Prerequisites
17
+
18
+ - Node.js 20 or later
19
+ - TypeScript 5 or later
20
+
21
+ ## Usage
22
+
23
+ 🚧 This section is under development. Please check back later for updates.
24
+
25
+ ## Documentation
26
+
27
+ See [API reference](./docs) for auto-generated documentation.
28
+
29
+ ## Contributing
30
+
31
+ If you want to contribute, see [CONTRIBUTING](./CONTRIBUTING.md) for details.
32
+
33
+ ## License
34
+
35
+ This package is licensed under the GNU Lesser General Public License v3. See [LICENSE](./LICENSE.md)
36
+ for details.
@@ -9,7 +9,7 @@ strategy: create
9
9
  "repository": {
10
10
  "url": "<%- workspace.repository?.url ?? '' %>"
11
11
  },
12
- "license": "MIT",
12
+ "license": "LGPL-3.0-only",
13
13
  "author": "Jakub Mazanec <jakub@mazanec.dev>",
14
14
  "sideEffects": false
15
15
  }
@@ -3,9 +3,31 @@ to: 'package.json'
3
3
  strategy: merge
4
4
  ---
5
5
  <%
6
- let developmentDependencies = getDependencies([
7
- '@jest/globals',
8
- ], workspace);
6
+ let files = [BUILD_DIRECTORY, SOURCE_DIRECTORY];
7
+
8
+ if (project.packageJson.bin) {
9
+ files.push('bin');
10
+ }
11
+
12
+ files.sort();
13
+
14
+ let developmentDependencies = getDependencies(
15
+ [
16
+ '@types/node',
17
+ '@vitest/coverage-v8',
18
+ 'concurrently',
19
+ 'del-cli',
20
+ 'esbuild',
21
+ 'eslint',
22
+ 'prettier',
23
+ 'prettier-plugin-packagejson',
24
+ 'typedoc',
25
+ 'typedoc-plugin-markdown',
26
+ 'typescript',
27
+ 'vitest',
28
+ ],
29
+ workspace,
30
+ );
9
31
  let packageJson = lodash.merge(
10
32
  {
11
33
  repository: {
@@ -13,22 +35,22 @@ let packageJson = lodash.merge(
13
35
  directory: project.relativePath,
14
36
  },
15
37
  type: 'module',
16
- exports: './dist/main.js',
17
- files: ['dist', 'src'],
38
+ exports: `./${BUILD_DIRECTORY}/main.js`,
39
+ files,
18
40
  scripts: {
19
- build: 'swc src -d dist && tsc',
20
- clean: 'del-cli coverage dist *.tsbuildinfo',
21
- document: 'typedoc --options typedoc.config.cjs',
22
- format:
23
- 'prettier . --write --ignore-unknown --ignore-path ../../.prettierignore',
41
+ build: `del-cli ${BUILD_DIRECTORY} tsconfig.tsbuildinfo && ${BUILD_TO_ESM_COMMAND} && tsc`,
42
+ clean: `del-cli coverage ${BUILD_DIRECTORY} *.tsbuildinfo`,
43
+ develop: `concurrently "${BUILD_TO_ESM_COMMAND} --watch" "tsc --watch"`,
44
+ document: 'del-cli docs && typedoc --options typedoc.config.cjs',
45
+ format: FORMAT_COMMAND,
24
46
  lint: 'eslint .',
25
- test: 'cross-env NODE_OPTIONS=--experimental-vm-modules jest --passWithNoTests',
47
+ test: `del-cli coverage && ${TEST_COMMAND}`,
26
48
  typecheck: 'tsc --project tsconfig.typecheck.json',
27
49
  },
28
50
  devDependencies: developmentDependencies,
29
- packageManager: 'npm@8.19.4',
51
+ packageManager: 'npm@10.1.0',
30
52
  engines: {
31
- node: '>=16.20.0',
53
+ node: '^20.8.0',
32
54
  },
33
55
  },
34
56
  project.config.overrides?.packageJson ?? {},
@@ -0,0 +1,3 @@
1
+ ---
2
+ extends: '../../workspace/prettier.config.cjs.ejs'
3
+ ---
@@ -0,0 +1,4 @@
1
+ ---
2
+ to: <%- `${SOURCE_DIRECTORY}/main.ts` %>
3
+ strategy: check
4
+ ---
@@ -0,0 +1,5 @@
1
+ ---
2
+ to: <%- `${SOURCE_DIRECTORY}/main.ts` %>
3
+ strategy: create
4
+ ---
5
+ export {}
@@ -2,16 +2,23 @@
2
2
  to: 'tests/tsconfig.json'
3
3
  strategy: overwrite
4
4
  ---
5
- {
6
- "extends": "../../../tsconfig.options.json",
7
- "compilerOptions": {
8
- "composite": false,
9
- "noEmit": true
5
+ <%
6
+ let tsconfig = {
7
+ compilerOptions: {
8
+ ...TSCONFIG_COMPILER_OPTIONS,
9
+ composite: false,
10
+ noEmit: true,
10
11
  },
11
- "include": ["./**/*"],
12
- "references": [
13
- {
14
- "path": ".."
15
- }
16
- ]
17
- }
12
+ include: ['./**/*'],
13
+ references: [{path: '..'}],
14
+ };
15
+ -%>
16
+ //
17
+ // DO NOT EDIT!
18
+ // This file was autogenerated by Carson.
19
+ // Changes may cause incorrect behavior and will be lost when the file is regenerated.
20
+ //
21
+ // Run `npx carson update workspace` to regenerate.
22
+ //
23
+
24
+ <%- JSON.stringify(tsconfig, null, 2) %>
@@ -2,13 +2,27 @@
2
2
  to: 'tsconfig.json'
3
3
  strategy: overwrite
4
4
  ---
5
- {
6
- "extends": "../../tsconfig.options.json",
7
- "compilerOptions": {
8
- "emitDeclarationOnly": true,
9
- "outDir": "./dist",
10
- "rootDir": "./src"
5
+ <%
6
+ let tsconfig = lodash.merge(
7
+ {
8
+ compilerOptions: {
9
+ ...TSCONFIG_COMPILER_OPTIONS,
10
+ emitDeclarationOnly: true,
11
+ outDir: `./${BUILD_DIRECTORY}`,
12
+ rootDir: `./${SOURCE_DIRECTORY}`,
13
+ },
14
+ include: [`./${SOURCE_DIRECTORY}/**/*`],
15
+ references: getReferences(workspace, project),
11
16
  },
12
- "include": ["./src/**/*"],
13
- "references": <%- JSON.stringify(getReferences(workspace, project), null, 2) %>
14
- }
17
+ project.config.overrides?.tsconfig ?? {},
18
+ );
19
+ -%>
20
+ //
21
+ // DO NOT EDIT!
22
+ // This file was autogenerated by Carson.
23
+ // Changes may cause incorrect behavior and will be lost when the file is regenerated.
24
+ //
25
+ // Run `npx carson update workspace` to regenerate.
26
+ //
27
+
28
+ <%- JSON.stringify(tsconfig, null, 2) %>
@@ -2,13 +2,24 @@
2
2
  to: 'tsconfig.typecheck.json'
3
3
  strategy: overwrite
4
4
  ---
5
- {
6
- "extends": "./tsconfig.json",
7
- "compilerOptions": {
8
- "composite": false,
9
- "emitDeclarationOnly": false,
10
- "noEmit": true,
11
- "rootDir": "."
5
+ <%
6
+ let tsconfig = {
7
+ extends: './tsconfig.json',
8
+ compilerOptions: {
9
+ composite: false,
10
+ emitDeclarationOnly: false,
11
+ noEmit: true,
12
+ rootDir: '.',
12
13
  },
13
- "include": ["./src/**/*", "./tests/**/*", "./*"]
14
- }
14
+ include: [`./${SOURCE_DIRECTORY}/**/*`, './tests/**/*', './*'],
15
+ };
16
+ -%>
17
+ //
18
+ // DO NOT EDIT!
19
+ // This file was autogenerated by Carson.
20
+ // Changes may cause incorrect behavior and will be lost when the file is regenerated.
21
+ //
22
+ // Run `npx carson update workspace` to regenerate.
23
+ //
24
+
25
+ <%- JSON.stringify(tsconfig, null, 2) %>
@@ -2,11 +2,17 @@
2
2
  to: 'typedoc.config.cjs'
3
3
  strategy: overwrite
4
4
  ---
5
- module.exports = {
6
- plugin: 'typedoc-plugin-markdown',
7
- entryPoints: ['./src/main.ts'],
8
- out: 'docs',
9
- readme: 'none',
10
- githubPages: false,
11
- hideBreadcrumbs: true,
5
+ <%
6
+ let typedocConfig = {
7
+ ...TYPEDOC_CONFIG
12
8
  };
9
+ -%>
10
+ /**
11
+ * DO NOT EDIT!
12
+ * This file was autogenerated by Carson.
13
+ * Changes may cause incorrect behavior and will be lost when the file is regenerated.
14
+ *
15
+ * Run `npx carson update workspace` to regenerate.
16
+ */
17
+
18
+ module.exports = <%- JSON.stringify(typedocConfig, null, 2) %>;
@@ -0,0 +1,21 @@
1
+ ---
2
+ to: '.eslintrc.cjs'
3
+ strategy: overwrite
4
+ ---
5
+ /**
6
+ * DO NOT EDIT!
7
+ * This file was autogenerated by Carson.
8
+ * Changes may cause incorrect behavior and will be lost when the file is regenerated.
9
+ *
10
+ * Run `npx carson update workspace` to regenerate.
11
+ */
12
+
13
+ module.exports = {
14
+ root: true,
15
+ extends: [
16
+ '@jakubmazanec/eslint-config',
17
+ '@jakubmazanec/eslint-config/nodejs',
18
+ '@jakubmazanec/eslint-config/prettier',
19
+ ],
20
+ ignorePatterns: <%- JSON.stringify(LINT_IGNORE_PATTERNS, null, 2) %>,
21
+ };
@@ -0,0 +1,3 @@
1
+ ---
2
+ extends: '../../workspace/.prettierignore.ejs'
3
+ ---
@@ -0,0 +1,3 @@
1
+ ---
2
+ extends: '../library/CONTRIBUTING.md.ejs'
3
+ ---