@companion-module/tools 2.2.2 → 2.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.3.0](https://github.com/bitfocus/companion-module-tools/compare/v2.2.3...v2.3.0) (2025-04-12)
4
+
5
+
6
+ ### Features
7
+
8
+ * Allow additional rules to be provided to the eslint config generator ([#48](https://github.com/bitfocus/companion-module-tools/issues/48)) ([6fb9125](https://github.com/bitfocus/companion-module-tools/commit/6fb9125b1097b598d4b1ba552890034a44c45235))
9
+
10
+ ## [2.2.3](https://github.com/bitfocus/companion-module-tools/compare/v2.2.2...v2.2.3) (2025-04-12)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * sanitise output filename ([cb07027](https://github.com/bitfocus/companion-module-tools/commit/cb0702738632da68ccd651f96f72ff038c30f3a1))
16
+
3
17
  ## [2.2.2](https://github.com/bitfocus/companion-module-tools/compare/v2.2.1...v2.2.2) (2025-03-09)
4
18
 
5
19
 
package/eslint/config.mjs CHANGED
@@ -22,7 +22,13 @@ function compactObj(obj) {
22
22
  }
23
23
 
24
24
  /***
25
- * @param {{ enableJest?: boolean, enableTypescript?: boolean, ignores?: string[] }} [options={}] - Options to customize the config
25
+ * @param {{
26
+ * enableJest?: boolean,
27
+ * enableTypescript?: boolean,
28
+ * ignores?: string[],
29
+ * commonRules?: Readonly<import('eslint').Linter.RulesRecord>,
30
+ * typescriptRules?: Readonly<import('eslint').Linter.RulesRecord>,
31
+ * }} [options={}] - Options to customize the config
26
32
  * @returns {Promise<import('eslint').Linter.Config[]>}
27
33
  */
28
34
  export async function generateEslintConfig(options = {}) {
@@ -46,6 +52,8 @@ export async function generateEslintConfig(options = {}) {
46
52
  'no-use-before-define': 'off',
47
53
  'no-warning-comments': ['error', { terms: ['nocommit', '@nocommit', '@no-commit'] }],
48
54
  // 'jest/no-mocks-import': 'off',
55
+
56
+ ...(options.commonRules || {}),
49
57
  },
50
58
  }
51
59
 
@@ -101,6 +109,8 @@ export async function generateEslintConfig(options = {}) {
101
109
  '@typescript-eslint/restrict-plus-operands': 0,
102
110
  '@typescript-eslint/no-redundant-type-constituents': 0,
103
111
  /** End 'recommended-requiring-type-checking' overrides */
112
+
113
+ ...(options.typescriptRules || {}),
104
114
  },
105
115
  }
106
116
  : null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companion-module/tools",
3
- "version": "2.2.2",
3
+ "version": "2.3.0",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
package/scripts/build.js CHANGED
@@ -23,6 +23,10 @@ if (argv.help) {
23
23
  process.exit(0)
24
24
  }
25
25
 
26
+ function toSanitizedDirname(name) {
27
+ return name.replace(/[^a-zA-Z0-9-\.]/g, '-').replace(/[-+]/g, '-')
28
+ }
29
+
26
30
  const require = createRequire(import.meta.url)
27
31
 
28
32
  async function findModuleDir(cwd) {
@@ -201,7 +205,7 @@ if (Object.keys(packageJson.dependencies).length) {
201
205
  }
202
206
 
203
207
  // Create tgz of the build
204
- let tgzFile = `${manifestJson.name}-${manifestJson.version}`
208
+ let tgzFile = toSanitizedDirname(`${manifestJson.id}-${manifestJson.version}`)
205
209
  if (typeof argv['output'] === 'string') {
206
210
  // -o flag, to allow legacy behaviour creating pkg.tgz output
207
211
  tgzFile = argv['output']