@companion-module/tools 2.7.1 → 3.0.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 +15 -0
- package/dist/build-config.d.ts +26 -0
- package/dist/build-config.js +1 -0
- package/dist/eslint/config.d.mts +9 -0
- package/dist/eslint/config.mjs +123 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -0
- package/dist/scripts/build-connection.d.ts +2 -0
- package/dist/scripts/build-connection.js +19 -0
- package/dist/scripts/build-surface.d.ts +2 -0
- package/dist/scripts/build-surface.js +17 -0
- package/dist/scripts/check-connection.d.ts +2 -0
- package/dist/scripts/check-connection.js +25 -0
- package/dist/scripts/check-surface.d.ts +2 -0
- package/dist/scripts/check-surface.js +23 -0
- package/dist/scripts/lib/build-util.d.ts +6 -0
- package/dist/scripts/lib/build-util.js +222 -0
- package/package.json +35 -23
- package/tsconfig/node22/recommended-esm.json +0 -3
- package/tsconfig/node22/recommended.json +0 -3
- package/eslint/config.mjs +0 -155
- package/index.js +0 -1
- package/scripts/build-connection.js +0 -27
- package/scripts/build-surface.js +0 -22
- package/scripts/check-connection.js +0 -40
- package/scripts/check-surface.js +0 -40
- package/scripts/generate-connection-manifest.js +0 -83
- package/scripts/lib/build-util.js +0 -254
- package/tsconfig/node18/recommended.json +0 -30
- package/webpack.config.cjs +0 -82
package/webpack.config.cjs
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
|
|
3
|
-
module.exports = async (env) => {
|
|
4
|
-
if (!env.ROOT) throw new Error(`Missing ROOT`)
|
|
5
|
-
if (!env.MODULETYPE) throw new Error(`Missing MODULETYPE`)
|
|
6
|
-
|
|
7
|
-
const pkgJson = require(path.join(env.ROOT, 'package.json'))
|
|
8
|
-
|
|
9
|
-
if (!pkgJson.main) throw new Error(`Missing main in package.json`)
|
|
10
|
-
|
|
11
|
-
let webpackExt = {}
|
|
12
|
-
try {
|
|
13
|
-
webpackExt = require(path.join(env.ROOT, 'build-config.cjs'))
|
|
14
|
-
|
|
15
|
-
console.log('Found additional webpack configuration')
|
|
16
|
-
} catch (e) {
|
|
17
|
-
// Ignore
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
let externalsExt = []
|
|
21
|
-
if (Array.isArray(webpackExt.externals)) externalsExt = webpackExt.externals
|
|
22
|
-
else if (webpackExt.externals) externalsExt = [webpackExt.externals]
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
entry: {
|
|
26
|
-
main: './' + pkgJson.main, // path.join(frameworkDir, 'dist/entrypoint.js'),
|
|
27
|
-
// Allow for custom entrypoints
|
|
28
|
-
...webpackExt.entry,
|
|
29
|
-
},
|
|
30
|
-
mode: env.dev ? 'development' : 'production',
|
|
31
|
-
output:
|
|
32
|
-
env.MODULETYPE === 'connection'
|
|
33
|
-
? {
|
|
34
|
-
path: path.resolve(env.ROOT, 'pkg'),
|
|
35
|
-
}
|
|
36
|
-
: {
|
|
37
|
-
path: path.resolve(env.ROOT, 'pkg'),
|
|
38
|
-
filename: 'main.js',
|
|
39
|
-
library: {
|
|
40
|
-
type: 'commonjs2',
|
|
41
|
-
// Avoid producing a double default in the bundle
|
|
42
|
-
export: 'default',
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
context: path.resolve(env.ROOT, '.'),
|
|
46
|
-
target: 'node',
|
|
47
|
-
externals: [
|
|
48
|
-
// Allow for custom externals
|
|
49
|
-
...externalsExt,
|
|
50
|
-
],
|
|
51
|
-
experiments: {
|
|
52
|
-
topLevelAwait: true,
|
|
53
|
-
},
|
|
54
|
-
optimization: {
|
|
55
|
-
minimize: !webpackExt.disableMinifier,
|
|
56
|
-
},
|
|
57
|
-
module: {
|
|
58
|
-
rules: [
|
|
59
|
-
// {
|
|
60
|
-
// test: /\.json$/,
|
|
61
|
-
// type: 'asset/source',
|
|
62
|
-
// },
|
|
63
|
-
// {
|
|
64
|
-
// test: /BUILD$/,
|
|
65
|
-
// type: 'asset/resource',
|
|
66
|
-
// generator: {
|
|
67
|
-
// filename: 'BUILD',
|
|
68
|
-
// },
|
|
69
|
-
// },
|
|
70
|
-
],
|
|
71
|
-
},
|
|
72
|
-
plugins: [
|
|
73
|
-
// Let modules define additional plugins. Hopefully this won't conflict with anything we add
|
|
74
|
-
...(webpackExt.plugins || []),
|
|
75
|
-
],
|
|
76
|
-
node: webpackExt.useOriginalStructureDirname
|
|
77
|
-
? {
|
|
78
|
-
__dirname: true,
|
|
79
|
-
}
|
|
80
|
-
: undefined,
|
|
81
|
-
}
|
|
82
|
-
}
|