@kwirthmagnify/kwirth-sender-teams 0.1.3 → 0.1.5
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/dist/package.json +1 -1
- package/package.json +1 -1
- package/watch.mjs +2 -48
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "teams",
|
|
3
3
|
"name": "@kwirthmagnify/kwirth-sender-teams",
|
|
4
4
|
"publisher": "@kwirthmagnify",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.5",
|
|
6
6
|
"displayName": "MS Teams Sender",
|
|
7
7
|
"description": "MS Teams sender for Kwirth — sends messages via incoming webhook",
|
|
8
8
|
"type": "module",
|
package/watch.mjs
CHANGED
|
@@ -2,37 +2,6 @@ import esbuild from 'esbuild'
|
|
|
2
2
|
import fs from 'fs'
|
|
3
3
|
import path from 'path'
|
|
4
4
|
|
|
5
|
-
const kwirthGlobalsPlugin = {
|
|
6
|
-
name: 'kwirth-globals',
|
|
7
|
-
setup(build) {
|
|
8
|
-
const globals = {
|
|
9
|
-
'react': 'window.__kwirth__.React',
|
|
10
|
-
'@mui/material': 'window.__kwirth__.MUI.material',
|
|
11
|
-
'@mui/icons-material': 'window.__kwirth__.MUI.icons',
|
|
12
|
-
'@kwirthmagnify/kwirth-common': 'window.__kwirth__.kwirthCommon',
|
|
13
|
-
}
|
|
14
|
-
for (const pkg of Object.keys(globals)) {
|
|
15
|
-
build.onResolve({ filter: new RegExp(`^${pkg.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}$`) }, () => ({ path: pkg, namespace: 'kwirth-globals' }))
|
|
16
|
-
}
|
|
17
|
-
build.onLoad({ filter: /.*/, namespace: 'kwirth-globals' }, (args) => ({
|
|
18
|
-
contents: `module.exports = ${globals[args.path]}`, loader: 'js',
|
|
19
|
-
}))
|
|
20
|
-
},
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const notifyPlugin = (label) => ({
|
|
24
|
-
name: `notify-${label}`,
|
|
25
|
-
setup(build) {
|
|
26
|
-
build.onEnd(result => {
|
|
27
|
-
const t = new Date().toLocaleTimeString()
|
|
28
|
-
if (result.errors.length) {
|
|
29
|
-
console.error(`[${t}] ${label} FAILED: ${result.errors.map(e => e.text).join('; ')}`)
|
|
30
|
-
} else {
|
|
31
|
-
console.log(`[${t}] ${label} OK`)
|
|
32
|
-
}
|
|
33
|
-
})
|
|
34
|
-
},
|
|
35
|
-
})
|
|
36
5
|
|
|
37
6
|
fs.mkdirSync('dist', { recursive: true })
|
|
38
7
|
const meta = JSON.parse(fs.readFileSync('package.json', 'utf-8'))
|
|
@@ -47,22 +16,7 @@ const backCtx = await esbuild.context({
|
|
|
47
16
|
outfile: 'dist/back.js',
|
|
48
17
|
loader: { '.ts': 'ts' },
|
|
49
18
|
minify: false,
|
|
50
|
-
plugins: [notifyPlugin('back')],
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
const frontCtx = await esbuild.context({
|
|
54
|
-
entryPoints: ['src/front/index.tsx'],
|
|
55
|
-
bundle: true,
|
|
56
|
-
format: 'iife',
|
|
57
|
-
outfile: 'dist/front.js',
|
|
58
|
-
plugins: [kwirthGlobalsPlugin, notifyPlugin('front')],
|
|
59
|
-
loader: { '.tsx': 'tsx', '.ts': 'ts' },
|
|
60
|
-
jsx: 'transform',
|
|
61
|
-
jsxFactory: 'React.createElement',
|
|
62
|
-
jsxFragment: 'React.Fragment',
|
|
63
|
-
target: 'es2020',
|
|
64
|
-
minify: false,
|
|
65
19
|
})
|
|
66
20
|
|
|
67
|
-
await
|
|
68
|
-
console.log('[watch] Watching src/ — back.js
|
|
21
|
+
await backCtx.watch()
|
|
22
|
+
console.log('[watch] Watching src/ — back.js rebuilds on every change.')
|