@jcoreio/toolchain-typescript 4.8.0 → 4.9.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jcoreio/toolchain-typescript",
3
- "version": "4.8.0",
3
+ "version": "4.9.0",
4
4
  "description": "TypeScript JS build toolchain",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,8 +19,8 @@
19
19
  "@typescript-eslint/eslint-plugin": "^7.6.0",
20
20
  "@typescript-eslint/parser": "^7.6.0",
21
21
  "json5": "^2.2.1",
22
- "@jcoreio/toolchain": "4.8.0",
23
- "@jcoreio/toolchain-esnext": "4.8.0"
22
+ "@jcoreio/toolchain": "4.9.0",
23
+ "@jcoreio/toolchain-esnext": "4.9.0"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "typescript": "^5.1.0"
@@ -1,5 +1,7 @@
1
1
  const fs = require('@jcoreio/toolchain/util/projectFs.cjs')
2
2
  const JSON5 = require('json5')
3
+ const { globExists } = require('@jcoreio/toolchain/util/glob.cjs')
4
+ const getPluginsArraySync = require('@jcoreio/toolchain/util/getPluginsArraySync.cjs')
3
5
 
4
6
  async function getRootTsconfig() {
5
7
  if (await fs.pathExists('tsconfig.json')) {
@@ -19,6 +21,18 @@ module.exports = [
19
21
  !rootTsconfig ||
20
22
  !rootTsconfig.extends ||
21
23
  !rootTsconfig.extends.includes('@jcoreio/toolchain')
24
+ const buildExclude = ['node_modules', 'test']
25
+ if (await globExists('src/**/__tests__')) {
26
+ buildExclude.push('src/**/__tests__')
27
+ }
28
+ for (const extension of getPluginsArraySync('sourceExtensions')) {
29
+ for (const suffix of ['spec', 'test']) {
30
+ const pattern = `src/**/*.${suffix}.${extension}`
31
+ if (await globExists(pattern, { ignore: 'src/**/__tests__/**' })) {
32
+ buildExclude.push(pattern)
33
+ }
34
+ }
35
+ }
22
36
  return {
23
37
  'tsconfig.json': {
24
38
  content: JSON.stringify(
@@ -39,7 +53,7 @@ module.exports = [
39
53
  {
40
54
  extends: './tsconfig.json',
41
55
  include: ['./src'],
42
- exclude: ['node_modules', './src/**/*.spec.ts', './test'],
56
+ exclude: buildExclude,
43
57
  compilerOptions: {
44
58
  outDir: './dist',
45
59
  declaration: true,