@roots/bud-build 6.9.0 → 6.10.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.
Files changed (245) hide show
  1. package/README.md +6 -1
  2. package/package.json +21 -17
  3. package/src/config/optimization.ts +3 -2
  4. package/src/config/output/assetModuleFilename.ts +3 -3
  5. package/src/config/output/chunkFilename.ts +3 -3
  6. package/src/config/output/filename.ts +3 -8
  7. package/src/config/output/index.ts +4 -3
  8. package/src/rule/index.ts +19 -80
  9. package/src/service.ts +2 -2
  10. package/lib/config/bail.d.ts +0 -3
  11. package/lib/config/bail.d.ts.map +0 -1
  12. package/lib/config/bail.js +0 -2
  13. package/lib/config/bail.js.map +0 -1
  14. package/lib/config/cache.d.ts +0 -3
  15. package/lib/config/cache.d.ts.map +0 -1
  16. package/lib/config/cache.js +0 -2
  17. package/lib/config/cache.js.map +0 -1
  18. package/lib/config/context.d.ts +0 -3
  19. package/lib/config/context.d.ts.map +0 -1
  20. package/lib/config/context.js +0 -2
  21. package/lib/config/context.js.map +0 -1
  22. package/lib/config/dependencies.d.ts +0 -3
  23. package/lib/config/dependencies.d.ts.map +0 -1
  24. package/lib/config/dependencies.js +0 -5
  25. package/lib/config/dependencies.js.map +0 -1
  26. package/lib/config/devtool.d.ts +0 -3
  27. package/lib/config/devtool.d.ts.map +0 -1
  28. package/lib/config/devtool.js +0 -2
  29. package/lib/config/devtool.js.map +0 -1
  30. package/lib/config/entry.d.ts +0 -3
  31. package/lib/config/entry.d.ts.map +0 -1
  32. package/lib/config/entry.js +0 -2
  33. package/lib/config/entry.js.map +0 -1
  34. package/lib/config/experiments.d.ts +0 -3
  35. package/lib/config/experiments.d.ts.map +0 -1
  36. package/lib/config/experiments.js +0 -2
  37. package/lib/config/experiments.js.map +0 -1
  38. package/lib/config/externals.d.ts +0 -3
  39. package/lib/config/externals.d.ts.map +0 -1
  40. package/lib/config/externals.js +0 -2
  41. package/lib/config/externals.js.map +0 -1
  42. package/lib/config/externalsType.d.ts +0 -3
  43. package/lib/config/externalsType.d.ts.map +0 -1
  44. package/lib/config/externalsType.js +0 -2
  45. package/lib/config/externalsType.js.map +0 -1
  46. package/lib/config/index.d.ts +0 -35
  47. package/lib/config/index.d.ts.map +0 -1
  48. package/lib/config/index.js +0 -27
  49. package/lib/config/index.js.map +0 -1
  50. package/lib/config/infrastructureLogging.d.ts +0 -3
  51. package/lib/config/infrastructureLogging.d.ts.map +0 -1
  52. package/lib/config/infrastructureLogging.js +0 -14
  53. package/lib/config/infrastructureLogging.js.map +0 -1
  54. package/lib/config/loader.d.ts +0 -3
  55. package/lib/config/loader.d.ts.map +0 -1
  56. package/lib/config/loader.js +0 -2
  57. package/lib/config/loader.js.map +0 -1
  58. package/lib/config/mode.d.ts +0 -3
  59. package/lib/config/mode.d.ts.map +0 -1
  60. package/lib/config/mode.js +0 -2
  61. package/lib/config/mode.js.map +0 -1
  62. package/lib/config/module.d.ts +0 -3
  63. package/lib/config/module.d.ts.map +0 -1
  64. package/lib/config/module.js +0 -23
  65. package/lib/config/module.js.map +0 -1
  66. package/lib/config/name.d.ts +0 -3
  67. package/lib/config/name.d.ts.map +0 -1
  68. package/lib/config/name.js +0 -2
  69. package/lib/config/name.js.map +0 -1
  70. package/lib/config/node.d.ts +0 -3
  71. package/lib/config/node.d.ts.map +0 -1
  72. package/lib/config/node.js +0 -2
  73. package/lib/config/node.js.map +0 -1
  74. package/lib/config/optimization.d.ts +0 -3
  75. package/lib/config/optimization.d.ts.map +0 -1
  76. package/lib/config/optimization.js +0 -10
  77. package/lib/config/optimization.js.map +0 -1
  78. package/lib/config/output/assetModuleFilename.d.ts +0 -8
  79. package/lib/config/output/assetModuleFilename.d.ts.map +0 -1
  80. package/lib/config/output/assetModuleFilename.js +0 -2
  81. package/lib/config/output/assetModuleFilename.js.map +0 -1
  82. package/lib/config/output/chunkFilename.d.ts +0 -8
  83. package/lib/config/output/chunkFilename.d.ts.map +0 -1
  84. package/lib/config/output/chunkFilename.js +0 -4
  85. package/lib/config/output/chunkFilename.js.map +0 -1
  86. package/lib/config/output/filename.d.ts +0 -8
  87. package/lib/config/output/filename.d.ts.map +0 -1
  88. package/lib/config/output/filename.js +0 -4
  89. package/lib/config/output/filename.js.map +0 -1
  90. package/lib/config/output/index.d.ts +0 -3
  91. package/lib/config/output/index.d.ts.map +0 -1
  92. package/lib/config/output/index.js +0 -18
  93. package/lib/config/output/index.js.map +0 -1
  94. package/lib/config/parallelism.d.ts +0 -3
  95. package/lib/config/parallelism.d.ts.map +0 -1
  96. package/lib/config/parallelism.js +0 -3
  97. package/lib/config/parallelism.js.map +0 -1
  98. package/lib/config/performance.d.ts +0 -3
  99. package/lib/config/performance.d.ts.map +0 -1
  100. package/lib/config/performance.js +0 -2
  101. package/lib/config/performance.js.map +0 -1
  102. package/lib/config/plugins.d.ts +0 -3
  103. package/lib/config/plugins.d.ts.map +0 -1
  104. package/lib/config/plugins.js +0 -2
  105. package/lib/config/plugins.js.map +0 -1
  106. package/lib/config/profile.d.ts +0 -3
  107. package/lib/config/profile.d.ts.map +0 -1
  108. package/lib/config/profile.js +0 -2
  109. package/lib/config/profile.js.map +0 -1
  110. package/lib/config/recordsPath.d.ts +0 -3
  111. package/lib/config/recordsPath.d.ts.map +0 -1
  112. package/lib/config/recordsPath.js +0 -2
  113. package/lib/config/recordsPath.js.map +0 -1
  114. package/lib/config/resolve.d.ts +0 -3
  115. package/lib/config/resolve.d.ts.map +0 -1
  116. package/lib/config/resolve.js +0 -30
  117. package/lib/config/resolve.js.map +0 -1
  118. package/lib/config/stats.d.ts +0 -3
  119. package/lib/config/stats.d.ts.map +0 -1
  120. package/lib/config/stats.js +0 -17
  121. package/lib/config/stats.js.map +0 -1
  122. package/lib/config/target.d.ts +0 -3
  123. package/lib/config/target.d.ts.map +0 -1
  124. package/lib/config/target.js +0 -4
  125. package/lib/config/target.js.map +0 -1
  126. package/lib/handlers/index.d.ts +0 -19
  127. package/lib/handlers/index.d.ts.map +0 -1
  128. package/lib/handlers/index.js +0 -6
  129. package/lib/handlers/index.js.map +0 -1
  130. package/lib/handlers/items/items.d.ts +0 -47
  131. package/lib/handlers/items/items.d.ts.map +0 -1
  132. package/lib/handlers/items/items.js +0 -69
  133. package/lib/handlers/items/items.js.map +0 -1
  134. package/lib/handlers/loaders/loaders.d.ts +0 -12
  135. package/lib/handlers/loaders/loaders.d.ts.map +0 -1
  136. package/lib/handlers/loaders/loaders.js +0 -11
  137. package/lib/handlers/loaders/loaders.js.map +0 -1
  138. package/lib/handlers/register.d.ts +0 -14
  139. package/lib/handlers/register.d.ts.map +0 -1
  140. package/lib/handlers/register.js +0 -26
  141. package/lib/handlers/register.js.map +0 -1
  142. package/lib/handlers/rules/css.d.ts +0 -3
  143. package/lib/handlers/rules/css.d.ts.map +0 -1
  144. package/lib/handlers/rules/css.js +0 -5
  145. package/lib/handlers/rules/css.js.map +0 -1
  146. package/lib/handlers/rules/css.module.d.ts +0 -3
  147. package/lib/handlers/rules/css.module.d.ts.map +0 -1
  148. package/lib/handlers/rules/css.module.js +0 -5
  149. package/lib/handlers/rules/css.module.js.map +0 -1
  150. package/lib/handlers/rules/csv.d.ts +0 -3
  151. package/lib/handlers/rules/csv.d.ts.map +0 -1
  152. package/lib/handlers/rules/csv.js +0 -5
  153. package/lib/handlers/rules/csv.js.map +0 -1
  154. package/lib/handlers/rules/font.d.ts +0 -3
  155. package/lib/handlers/rules/font.d.ts.map +0 -1
  156. package/lib/handlers/rules/font.inline.d.ts +0 -3
  157. package/lib/handlers/rules/font.inline.d.ts.map +0 -1
  158. package/lib/handlers/rules/font.inline.js +0 -6
  159. package/lib/handlers/rules/font.inline.js.map +0 -1
  160. package/lib/handlers/rules/font.js +0 -5
  161. package/lib/handlers/rules/font.js.map +0 -1
  162. package/lib/handlers/rules/html.d.ts +0 -3
  163. package/lib/handlers/rules/html.d.ts.map +0 -1
  164. package/lib/handlers/rules/html.js +0 -5
  165. package/lib/handlers/rules/html.js.map +0 -1
  166. package/lib/handlers/rules/image.d.ts +0 -3
  167. package/lib/handlers/rules/image.d.ts.map +0 -1
  168. package/lib/handlers/rules/image.inline.d.ts +0 -3
  169. package/lib/handlers/rules/image.inline.d.ts.map +0 -1
  170. package/lib/handlers/rules/image.inline.js +0 -6
  171. package/lib/handlers/rules/image.inline.js.map +0 -1
  172. package/lib/handlers/rules/image.js +0 -5
  173. package/lib/handlers/rules/image.js.map +0 -1
  174. package/lib/handlers/rules/index.d.ts +0 -19
  175. package/lib/handlers/rules/index.d.ts.map +0 -1
  176. package/lib/handlers/rules/index.js +0 -35
  177. package/lib/handlers/rules/index.js.map +0 -1
  178. package/lib/handlers/rules/js.d.ts +0 -3
  179. package/lib/handlers/rules/js.d.ts.map +0 -1
  180. package/lib/handlers/rules/js.js +0 -5
  181. package/lib/handlers/rules/js.js.map +0 -1
  182. package/lib/handlers/rules/json.d.ts +0 -3
  183. package/lib/handlers/rules/json.d.ts.map +0 -1
  184. package/lib/handlers/rules/json.js +0 -7
  185. package/lib/handlers/rules/json.js.map +0 -1
  186. package/lib/handlers/rules/svg.d.ts +0 -3
  187. package/lib/handlers/rules/svg.d.ts.map +0 -1
  188. package/lib/handlers/rules/svg.inline.d.ts +0 -5
  189. package/lib/handlers/rules/svg.inline.d.ts.map +0 -1
  190. package/lib/handlers/rules/svg.inline.js +0 -9
  191. package/lib/handlers/rules/svg.inline.js.map +0 -1
  192. package/lib/handlers/rules/svg.js +0 -5
  193. package/lib/handlers/rules/svg.js.map +0 -1
  194. package/lib/handlers/rules/toml.d.ts +0 -3
  195. package/lib/handlers/rules/toml.d.ts.map +0 -1
  196. package/lib/handlers/rules/toml.js +0 -7
  197. package/lib/handlers/rules/toml.js.map +0 -1
  198. package/lib/handlers/rules/webp.d.ts +0 -3
  199. package/lib/handlers/rules/webp.d.ts.map +0 -1
  200. package/lib/handlers/rules/webp.js +0 -5
  201. package/lib/handlers/rules/webp.js.map +0 -1
  202. package/lib/handlers/rules/xml.d.ts +0 -3
  203. package/lib/handlers/rules/xml.d.ts.map +0 -1
  204. package/lib/handlers/rules/xml.js +0 -5
  205. package/lib/handlers/rules/xml.js.map +0 -1
  206. package/lib/handlers/rules/yml.d.ts +0 -3
  207. package/lib/handlers/rules/yml.d.ts.map +0 -1
  208. package/lib/handlers/rules/yml.js +0 -5
  209. package/lib/handlers/rules/yml.js.map +0 -1
  210. package/lib/helpers/isMjs.d.ts +0 -3
  211. package/lib/helpers/isMjs.d.ts.map +0 -1
  212. package/lib/helpers/isMjs.js +0 -2
  213. package/lib/helpers/isMjs.js.map +0 -1
  214. package/lib/helpers/scriptExtension.d.ts +0 -3
  215. package/lib/helpers/scriptExtension.d.ts.map +0 -1
  216. package/lib/helpers/scriptExtension.js +0 -5
  217. package/lib/helpers/scriptExtension.js.map +0 -1
  218. package/lib/index.d.ts +0 -12
  219. package/lib/index.d.ts.map +0 -1
  220. package/lib/index.js +0 -14
  221. package/lib/index.js.map +0 -1
  222. package/lib/item/index.d.ts +0 -84
  223. package/lib/item/index.d.ts.map +0 -1
  224. package/lib/item/index.js +0 -165
  225. package/lib/item/index.js.map +0 -1
  226. package/lib/loader/index.d.ts +0 -26
  227. package/lib/loader/index.d.ts.map +0 -1
  228. package/lib/loader/index.js +0 -28
  229. package/lib/loader/index.js.map +0 -1
  230. package/lib/rule/index.d.ts +0 -178
  231. package/lib/rule/index.d.ts.map +0 -1
  232. package/lib/rule/index.js +0 -319
  233. package/lib/rule/index.js.map +0 -1
  234. package/lib/service.d.ts +0 -84
  235. package/lib/service.d.ts.map +0 -1
  236. package/lib/service.js +0 -212
  237. package/lib/service.js.map +0 -1
  238. package/lib/shared/base.d.ts +0 -20
  239. package/lib/shared/base.d.ts.map +0 -1
  240. package/lib/shared/base.js +0 -43
  241. package/lib/shared/base.js.map +0 -1
  242. package/lib/types.d.ts +0 -52
  243. package/lib/types.d.ts.map +0 -1
  244. package/lib/types.js +0 -4
  245. package/lib/types.js.map +0 -1
package/README.md CHANGED
@@ -96,7 +96,9 @@ Keep track of development and community news.
96
96
 
97
97
  ## Sponsors
98
98
 
99
- Help support our open-source development efforts by [becoming a patron](https://www.patreon.com/rootsdev).
99
+ **Bud** is an open source project and completely free to use.
100
+
101
+ However, the amount of effort needed to maintain and develop new features and projects within the Roots ecosystem is not sustainable without proper financial backing. If you have the capability, please consider [sponsoring Roots](https://github.com/sponsors/roots).
100
102
 
101
103
  <a href="https://k-m.com/">
102
104
  <img src="https://cdn.roots.io/app/uploads/km-digital.svg" alt="KM Digital" width="200" height="150"/>
@@ -113,3 +115,6 @@ Help support our open-source development efforts by [becoming a patron](https://
113
115
  <a href="https://worksitesafety.ca/careers/">
114
116
  <img src="https://cdn.roots.io/app/uploads/worksite-safety.svg" alt="Worksite Safety" width="200" height="150"/>
115
117
  </a>
118
+ <a href="https://www.copiadigital.com/">
119
+ <img src="https://cdn.roots.io/app/uploads/copia-digital.svg" alt="Copia Digital" width="200" height="150"/>
120
+ </a>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@roots/bud-build",
3
3
  "description": "bud.js core module",
4
- "version": "6.9.0",
4
+ "version": "6.10.0",
5
5
  "homepage": "https://roots.io/bud",
6
6
  "repository": {
7
7
  "type": "git",
@@ -40,52 +40,56 @@
40
40
  "node": ">=16"
41
41
  },
42
42
  "files": [
43
- "docs/",
44
- "lib/",
45
- "src/"
43
+ "docs",
44
+ "lib",
45
+ "src"
46
46
  ],
47
47
  "type": "module",
48
- "module": "./lib/index.js",
49
- "types": "./lib/index.d.ts",
50
48
  "exports": {
51
49
  ".": {
52
50
  "types": "./lib/index.d.ts",
53
- "default": "./lib/index.js"
51
+ "import": "./lib/index.js"
54
52
  },
55
53
  "./item": {
56
54
  "types": "./lib/item/index.d.ts",
57
- "default": "./lib/item/index.js"
55
+ "import": "./lib/item/index.js"
58
56
  },
59
57
  "./items": {
60
58
  "types": "./lib/handlers/items/items.d.ts",
61
- "default": "./lib/handlers/items/items.js"
59
+ "import": "./lib/handlers/items/items.js"
62
60
  },
63
61
  "./loader": {
64
62
  "types": "./lib/loader/index.d.ts",
65
- "default": "./lib/loader/index.js"
63
+ "import": "./lib/loader/index.js"
66
64
  },
67
65
  "./loaders": {
68
66
  "types": "./lib/handlers/loaders/loaders.d.ts",
69
- "default": "./lib/handlers/loaders/loaders.js"
67
+ "import": "./lib/handlers/loaders/loaders.js"
70
68
  },
71
69
  "./rule": {
72
70
  "types": "./lib/rule/index.d.ts",
73
- "default": "./lib/rule/index.js"
71
+ "import": "./lib/rule/index.js"
74
72
  },
75
73
  "./rules": {
76
74
  "types": "./lib/handlers/rules/index.d.ts",
77
- "default": "./lib/handlers/rules/index.js"
75
+ "import": "./lib/handlers/rules/index.js"
76
+ },
77
+ "./types": {
78
+ "types": "./lib/types.d.ts",
79
+ "import": "./lib/types.js"
78
80
  }
79
81
  },
82
+ "module": "./lib/index.js",
83
+ "types": "./lib/index.d.ts",
80
84
  "devDependencies": {
81
- "@roots/bud-api": "6.9.0",
82
- "@roots/bud-hooks": "6.9.0",
85
+ "@roots/bud-api": "6.10.0",
86
+ "@roots/bud-hooks": "6.10.0",
83
87
  "@skypack/package-check": "0.2.2",
84
88
  "@types/node": "18.11.18"
85
89
  },
86
90
  "dependencies": {
87
- "@roots/bud-framework": "6.9.0",
88
- "@roots/bud-support": "6.9.0"
91
+ "@roots/bud-framework": "6.10.0",
92
+ "@roots/bud-support": "6.10.0"
89
93
  },
90
94
  "volta": {
91
95
  "extends": "../../../package.json"
@@ -8,12 +8,13 @@ export const optimization: Factory<`optimization`> = async ({
8
8
  filter(`build.optimization`, {
9
9
  emitOnErrors: filter(`build.optimization.emitOnErrors`, isDevelopment),
10
10
  minimize: filter(`build.optimization.minimize`, isProduction),
11
- minimizer: filter(`build.optimization.minimizer`, [`...`]),
11
+ minimizer: filter(`build.optimization.minimizer`, []),
12
12
  moduleIds: filter(`build.optimization.moduleIds`, `named`),
13
13
  removeEmptyChunks: filter(
14
14
  `build.optimization.removeEmptyChunks`,
15
- true,
15
+ false,
16
16
  ),
17
17
  runtimeChunk: filter(`build.optimization.runtimeChunk`, false),
18
18
  splitChunks: filter(`build.optimization.splitChunks`, false),
19
+ usedExports: filter(`build.optimization.usedExports`, isProduction),
19
20
  })
@@ -2,8 +2,8 @@ import type {Bud} from '@roots/bud-framework'
2
2
 
3
3
  interface Props {
4
4
  filter: Bud['hooks'][`filter`]
5
- path: Bud['path']
5
+ relPath: Bud['relPath']
6
6
  }
7
7
 
8
- export const assetModuleFilename = ({filter, path}: Props) =>
9
- filter(`build.output.assetModuleFilename`, path(`@file`))
8
+ export const assetModuleFilename = ({filter, relPath}: Props) =>
9
+ filter(`build.output.assetModuleFilename`, relPath(`@file`))
@@ -6,13 +6,13 @@ import {scriptExtension} from '../../helpers/scriptExtension.js'
6
6
 
7
7
  interface Props {
8
8
  filter: Bud[`hooks`][`filter`]
9
- path: Bud[`path`]
9
+ relPath: Bud[`relPath`]
10
10
  }
11
11
 
12
- export const chunkFilename = ({filter, path}: Props) =>
12
+ export const chunkFilename = ({filter, relPath}: Props) =>
13
13
  filter(
14
14
  `build.output.chunkFilename`,
15
- join(`js`, `dynamic`, path(`@name.chunk`)).concat(
15
+ join(`js`, `dynamic`, relPath(`@name.chunk`)).concat(
16
16
  scriptExtension(filter, `.mjs`, `.js`),
17
17
  ),
18
18
  )
@@ -1,19 +1,14 @@
1
- import {join} from 'node:path'
2
-
3
1
  import type {Bud} from '@roots/bud-framework'
4
2
 
5
3
  import {scriptExtension} from '../../helpers/scriptExtension.js'
6
4
 
7
5
  interface Props {
8
6
  filter: Bud['hooks'][`filter`]
9
- path: Bud['path']
7
+ relPath: Bud['relPath']
10
8
  }
11
9
 
12
- export const filename = ({filter, path}: Props) =>
10
+ export const filename = ({filter, relPath}: Props) =>
13
11
  filter(
14
12
  `build.output.filename`,
15
- join(
16
- `js`,
17
- path(`@name`).concat(scriptExtension(filter, `.mjs`, `.js`)),
18
- ),
13
+ relPath(`js`, `@name${scriptExtension(filter, `.mjs`, `.js`)}`),
19
14
  )
@@ -8,13 +8,14 @@ export const output: Factory<`output`> = async ({
8
8
  hooks: {filter},
9
9
  isProduction,
10
10
  path,
11
+ relPath,
11
12
  }) =>
12
13
  filter(`build.output`, {
13
- assetModuleFilename: assetModuleFilename({filter, path}),
14
- chunkFilename: chunkFilename({filter, path}),
14
+ assetModuleFilename: assetModuleFilename({filter, relPath}),
15
+ chunkFilename: chunkFilename({filter, relPath}),
15
16
  clean: filter(`build.output.clean`, isProduction),
16
17
  environment: filter(`build.output.environment`, undefined),
17
- filename: filename({filter, path}),
18
+ filename: filename({filter, relPath}),
18
19
  module: filter(`build.output.module`, false),
19
20
  path: filter(`build.output.path`, path(`@dist`)),
20
21
  pathinfo: filter(`build.output.pathinfo`),
package/src/rule/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type {Bud, Items} from '@roots/bud-framework'
1
+ import type {Bud} from '@roots/bud-framework'
2
2
  import type {
3
3
  Options,
4
4
  Output,
@@ -8,62 +8,56 @@ import type {
8
8
  import {bind} from '@roots/bud-support/decorators'
9
9
  import isFunction from '@roots/bud-support/lodash/isFunction'
10
10
  import isString from '@roots/bud-support/lodash/isString'
11
+ import type {RuleSetRule} from '@roots/bud-support/webpack'
11
12
 
12
- import type {Item} from '../item/index.js'
13
13
  import Base from '../shared/base.js'
14
14
 
15
- export {Interface, Options, Output, Parser}
16
-
17
15
  /**
18
- * Bud Rule
16
+ * RuleSetRule
19
17
  */
20
18
  class Rule extends Base implements Interface {
21
19
  /**
22
- * @public
20
+ * RuleSetRule test
23
21
  */
24
22
  public test: Options['test']
25
23
 
26
24
  /**
27
- * @public
25
+ * RuleSetRule use
28
26
  */
29
27
  public use?: Options[`use`]
30
28
 
31
29
  /**
32
- * @public
30
+ * RuleSetRule include
33
31
  */
34
32
  public include?: Options['include']
35
33
 
36
34
  /**
37
- * @public
35
+ * RuleSetRule exclude
38
36
  */
39
37
  public exclude?: Options['exclude']
40
38
 
41
39
  /**
42
- * @public
40
+ * RuleSetRule type
43
41
  */
44
- public type?: Interface['type']
42
+ public type?: Options['type']
45
43
 
46
44
  /**
47
- * @public
45
+ * RuleSetRule resourceQuery
48
46
  */
49
- public resourceQuery?: Interface['resourceQuery']
47
+ public resourceQuery?: Options['resourceQuery']
50
48
 
51
49
  /**
52
- * @public
50
+ * RuleSetRule parser
53
51
  */
54
- public parser?: Interface['parser']
52
+ public parser?: Options['parser']
55
53
 
56
54
  /**
57
- * Generator factory
58
- *
59
- * @public
55
+ * RuleSetRule generator
60
56
  */
61
- public generator?: Interface['generator']
57
+ public generator?: Options['generator']
62
58
 
63
59
  /**
64
60
  * Class constructor
65
- *
66
- * @public
67
61
  */
68
62
  public constructor(_app: () => Bud, options?: Options) {
69
63
  super(_app)
@@ -82,11 +76,6 @@ class Rule extends Base implements Interface {
82
76
 
83
77
  /**
84
78
  * Test value
85
- *
86
- * @param app - Bud instance
87
- *
88
- * @public
89
- * @decorator `@bind`
90
79
  */
91
80
  @bind
92
81
  public getTest(): Output['test'] {
@@ -95,9 +84,6 @@ class Rule extends Base implements Interface {
95
84
 
96
85
  /**
97
86
  * Set test value
98
- *
99
- * @public
100
- * @decorator `@bind`
101
87
  */
102
88
  @bind
103
89
  public setTest(test: Options['test']): this {
@@ -107,9 +93,6 @@ class Rule extends Base implements Interface {
107
93
 
108
94
  /**
109
95
  * Get parser value
110
- *
111
- * @public
112
- * @decorator `@bind`
113
96
  */
114
97
  @bind
115
98
  public getParser(): Output['parser'] {
@@ -118,9 +101,6 @@ class Rule extends Base implements Interface {
118
101
 
119
102
  /**
120
103
  * Set parser value
121
- *
122
- * @public
123
- * @decorator `@bind`
124
104
  */
125
105
  @bind
126
106
  public setParser(parser: Interface['parser']): this {
@@ -130,20 +110,14 @@ class Rule extends Base implements Interface {
130
110
 
131
111
  /**
132
112
  * Get use value
133
- *
134
- * @public
135
- * @decorator `@bind`
136
113
  */
137
114
  @bind
138
- public getUse(): Array<`${keyof Items & string}` | Item> {
115
+ public getUse(): Options[`use`] {
139
116
  return this.use
140
117
  }
141
118
 
142
119
  /**
143
120
  * Set use value
144
- *
145
- * @public
146
- * @decorator `@bind`
147
121
  */
148
122
  @bind
149
123
  public setUse(
@@ -155,9 +129,6 @@ class Rule extends Base implements Interface {
155
129
 
156
130
  /**
157
131
  * Get include value
158
- *
159
- * @public
160
- * @decorator `@bind`
161
132
  */
162
133
  @bind
163
134
  public getInclude(): Array<string | RegExp> {
@@ -168,9 +139,6 @@ class Rule extends Base implements Interface {
168
139
 
169
140
  /**
170
141
  * Set include value
171
- *
172
- * @public
173
- * @decorator `@bind`
174
142
  */
175
143
  @bind
176
144
  public setInclude(includes: Options['include']): this {
@@ -180,9 +148,6 @@ class Rule extends Base implements Interface {
180
148
 
181
149
  /**
182
150
  * Get include value
183
- *
184
- * @public
185
- * @decorator `@bind`
186
151
  */
187
152
  @bind
188
153
  public getResourceQuery(): Output[`resourceQuery`] {
@@ -191,9 +156,6 @@ class Rule extends Base implements Interface {
191
156
 
192
157
  /**
193
158
  * Set include value
194
- *
195
- * @public
196
- * @decorator `@bind`
197
159
  */
198
160
  @bind
199
161
  public setResourceQuery(query: Options['resourceQuery']): this {
@@ -203,9 +165,6 @@ class Rule extends Base implements Interface {
203
165
 
204
166
  /**
205
167
  * Get exclude value
206
- *
207
- * @public
208
- * @decorator `@bind`
209
168
  */
210
169
  @bind
211
170
  public getExclude(): Array<string | RegExp> {
@@ -214,9 +173,6 @@ class Rule extends Base implements Interface {
214
173
 
215
174
  /**
216
175
  * Set exclude value
217
- *
218
- * @public
219
- * @decorator `@bind`
220
176
  */
221
177
  @bind
222
178
  public setExclude(
@@ -230,9 +186,6 @@ class Rule extends Base implements Interface {
230
186
 
231
187
  /**
232
188
  * Get type value
233
- *
234
- * @public
235
- * @decorator `@bind`
236
189
  */
237
190
  @bind
238
191
  public getType(): string {
@@ -241,9 +194,6 @@ class Rule extends Base implements Interface {
241
194
 
242
195
  /**
243
196
  * Set type value
244
- *
245
- * @public
246
- * @decorator `@bind`
247
197
  */
248
198
  @bind
249
199
  public setType(type: Options[`type`]): this {
@@ -253,9 +203,6 @@ class Rule extends Base implements Interface {
253
203
 
254
204
  /**
255
205
  * Get generator value
256
- *
257
- * @public
258
- * @decorator `@bind`
259
206
  */
260
207
  @bind
261
208
  public getGenerator() {
@@ -264,27 +211,18 @@ class Rule extends Base implements Interface {
264
211
 
265
212
  /**
266
213
  * Set generator value
267
- *
268
- * @public
269
- * @decorator `@bind`
270
214
  */
271
215
  @bind
272
- public setGenerator(generator: Interface['generator']): this {
216
+ public setGenerator(generator: Options['generator']): this {
273
217
  this.generator = this.wrap(generator)
274
218
  return this
275
219
  }
276
220
 
277
221
  /**
278
222
  * Produce final Base output
279
- *
280
- * @param app - {@link @roots/bud-framework#Bud}
281
- * @returns finalized rule
282
- *
283
- * @public
284
- * @decorator `@bind`
285
223
  */
286
224
  @bind
287
- public toWebpack(): Output {
225
+ public toWebpack(): Output & RuleSetRule {
288
226
  const output: Output = Object.entries({
289
227
  test: this.getTest(),
290
228
  type: this.getType(),
@@ -316,3 +254,4 @@ class Rule extends Base implements Interface {
316
254
  }
317
255
 
318
256
  export {Rule}
257
+ export {Interface, Options, Output, Parser}
package/src/service.ts CHANGED
@@ -57,7 +57,7 @@ export class Build extends Service implements Base.Service {
57
57
  @bind
58
58
  public async make(): Promise<Configuration> {
59
59
  this.logger.log(`bud.build.make called`)
60
- await this.app.hooks.fire(`build.before`)
60
+ await this.app.hooks.fire(`build.before`, this.app)
61
61
 
62
62
  await import(`./config/index.js`).then(
63
63
  async (records: Records) =>
@@ -77,7 +77,7 @@ export class Build extends Service implements Base.Service {
77
77
  )
78
78
 
79
79
  this.logger.success(`configuration successfully built`)
80
- await this.app.hooks.fire(`build.after`)
80
+ await this.app.hooks.fire(`build.after`, this.app)
81
81
 
82
82
  return this.config
83
83
  }
@@ -1,3 +0,0 @@
1
- import type { Factory } from './index.js';
2
- export declare const bail: Factory<'bail'>;
3
- //# sourceMappingURL=bail.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bail.d.ts","sourceRoot":"","sources":["../../src/config/bail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,YAAY,CAAA;AAEvC,eAAO,MAAM,IAAI,EAAE,OAAO,CAAC,MAAM,CACS,CAAA"}
@@ -1,2 +0,0 @@
1
- export const bail = async ({ hooks, isProduction }) => hooks.filter(`build.bail`, isProduction);
2
- //# sourceMappingURL=bail.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bail.js","sourceRoot":"","sources":["../../src/config/bail.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,IAAI,GAAoB,KAAK,EAAE,EAAC,KAAK,EAAE,YAAY,EAAC,EAAE,EAAE,CACnE,KAAK,CAAC,MAAM,CAAC,YAAY,EAAE,YAAY,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- import type { Factory } from './index.js';
2
- export declare const cache: Factory<`cache`>;
3
- //# sourceMappingURL=cache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/config/cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,YAAY,CAAA;AAEvC,eAAO,MAAM,KAAK,EAAE,OAAO,CAAC,OAAO,CACe,CAAA"}
@@ -1,2 +0,0 @@
1
- export const cache = async ({ cache, hooks }) => hooks.filter(`build.cache`, cache.configuration);
2
- //# sourceMappingURL=cache.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache.js","sourceRoot":"","sources":["../../src/config/cache.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,KAAK,GAAqB,KAAK,EAAE,EAAC,KAAK,EAAE,KAAK,EAAC,EAAE,EAAE,CAC9D,KAAK,CAAC,MAAM,CAAC,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- import type { Factory } from './index.js';
2
- export declare const context: Factory<`context`>;
3
- //# sourceMappingURL=context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/config/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,YAAY,CAAA;AAEvC,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,SAAS,CAAkC,CAAA"}
@@ -1,2 +0,0 @@
1
- export const context = async ({ path }) => path(`@src`);
2
- //# sourceMappingURL=context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/config/context.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAuB,KAAK,EAAE,EAAC,IAAI,EAAC,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- import type { Factory } from './index.js';
2
- export declare const dependencies: Factory<`dependencies`>;
3
- //# sourceMappingURL=dependencies.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../../src/config/dependencies.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,YAAY,CAAA;AAEvC,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,cAAc,CAMO,CAAA"}
@@ -1,5 +0,0 @@
1
- import isUndefined from '@roots/bud-support/lodash/isUndefined';
2
- export const dependencies = async ({ hooks, root, }) => hooks
3
- .filter(`build.dependencies`, [])
4
- .filter(label => !isUndefined(root.children[label]));
5
- //# sourceMappingURL=dependencies.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../src/config/dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,uCAAuC,CAAA;AAI/D,MAAM,CAAC,MAAM,YAAY,GAA4B,KAAK,EAAE,EAC1D,KAAK,EACL,IAAI,GACL,EAAE,EAAE,CACH,KAAK;KACF,MAAM,CAAC,oBAAoB,EAAE,EAAE,CAAC;KAChC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- import type { Factory } from './index.js';
2
- export declare const devtool: Factory<`devtool`>;
3
- //# sourceMappingURL=devtool.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"devtool.d.ts","sourceRoot":"","sources":["../../src/config/devtool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,YAAY,CAAA;AAEvC,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,SAAS,CACD,CAAA"}
@@ -1,2 +0,0 @@
1
- export const devtool = async ({ hooks }) => hooks.filter(`build.devtool`, false);
2
- //# sourceMappingURL=devtool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"devtool.js","sourceRoot":"","sources":["../../src/config/devtool.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAuB,KAAK,EAAE,EAAC,KAAK,EAAC,EAAE,EAAE,CAC3D,KAAK,CAAC,MAAM,CAAC,eAAe,EAAE,KAAK,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- import type { Factory } from './index.js';
2
- export declare const entry: Factory<`entry`>;
3
- //# sourceMappingURL=entry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../../src/config/entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,YAAY,CAAA;AAEvC,eAAO,MAAM,KAAK,EAAE,OAAO,CAAC,OAAO,CACuB,CAAA"}
@@ -1,2 +0,0 @@
1
- export const entry = async ({ hooks }) => hooks.filter(`build.entry`, { main: { import: [`index`] } });
2
- //# sourceMappingURL=entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"entry.js","sourceRoot":"","sources":["../../src/config/entry.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,KAAK,GAAqB,KAAK,EAAE,EAAC,KAAK,EAAC,EAAE,EAAE,CACvD,KAAK,CAAC,MAAM,CAAC,aAAa,EAAE,EAAC,IAAI,EAAE,EAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAC,EAAC,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- import type { Factory } from './index.js';
2
- export declare const experiments: Factory<`experiments`>;
3
- //# sourceMappingURL=experiments.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"experiments.d.ts","sourceRoot":"","sources":["../../src/config/experiments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,YAAY,CAAA;AAEvC,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,aAAa,CACD,CAAA"}
@@ -1,2 +0,0 @@
1
- export const experiments = async ({ hooks }) => hooks.filter(`build.experiments`, undefined);
2
- //# sourceMappingURL=experiments.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"experiments.js","sourceRoot":"","sources":["../../src/config/experiments.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAA2B,KAAK,EAAE,EAAC,KAAK,EAAC,EAAE,EAAE,CACnE,KAAK,CAAC,MAAM,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- import type { Factory } from './index.js';
2
- export declare const externals: Factory<`externals`>;
3
- //# sourceMappingURL=externals.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"externals.d.ts","sourceRoot":"","sources":["../../src/config/externals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,YAAY,CAAA;AAEvC,eAAO,MAAM,SAAS,EAAE,OAAO,CAAC,WAAW,CACK,CAAA"}
@@ -1,2 +0,0 @@
1
- export const externals = async (app) => app.hooks.filter(`build.externals`, undefined);
2
- //# sourceMappingURL=externals.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"externals.js","sourceRoot":"","sources":["../../src/config/externals.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAyB,KAAK,EAAC,GAAG,EAAC,EAAE,CACzD,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- import type { Factory } from './index.js';
2
- export declare const externalsType: Factory<`externalsType`>;
3
- //# sourceMappingURL=externalsType.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"externalsType.d.ts","sourceRoot":"","sources":["../../src/config/externalsType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,YAAY,CAAA;AAEvC,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,eAAe,CAAsB,CAAA"}
@@ -1,2 +0,0 @@
1
- export const externalsType = async (app) => `var`;
2
- //# sourceMappingURL=externalsType.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"externalsType.js","sourceRoot":"","sources":["../../src/config/externalsType.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAA6B,KAAK,EAAC,GAAG,EAAC,EAAE,CAAC,KAAK,CAAA"}