@botpress/cognitive 0.1.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.
@@ -0,0 +1,28 @@
1
+
2
+ > @botpress/cognitive@0.1.0 build /home/runner/work/botpress/botpress/packages/cognitive
3
+ > pnpm build:type && pnpm build:neutral && size-limit
4
+
5
+
6
+ > @botpress/cognitive@0.1.0 build:type /home/runner/work/botpress/botpress/packages/cognitive
7
+ > tsup ./src/index.ts --dts-resolve --dts-only --clean
8
+
9
+ CLI Building entry: ./src/index.ts
10
+ CLI Using tsconfig: tsconfig.json
11
+ CLI tsup v8.0.2
12
+ DTS Build start
13
+ DTS ⚡️ Build success in 1577ms
14
+ DTS dist/index.d.ts 8.92 KB
15
+
16
+ > @botpress/cognitive@0.1.0 build:neutral /home/runner/work/botpress/botpress/packages/cognitive
17
+ > ts-node -T ./build.ts --neutral
18
+
19
+ Done
20
+
21
+ dist/index.cjs
22
+ Size limit: 50 kB
23
+ Size: 6.4 kB brotlied
24
+
25
+ dist/index.mjs
26
+ Size limit: 50 kB
27
+ Size: 6.28 kB brotlied
28
+
@@ -0,0 +1,4 @@
1
+
2
+ > @botpress/cognitive@0.1.0 generate /home/runner/work/botpress/botpress/packages/cognitive
3
+ > ts-node -T ./types.ts ./src/gen
4
+
package/build.ts ADDED
@@ -0,0 +1,53 @@
1
+ import esbuild from 'esbuild'
2
+ import { devDependencies } from './package.json'
3
+
4
+ const common: esbuild.BuildOptions = {
5
+ bundle: true,
6
+ minify: true,
7
+ sourcemap: true,
8
+ }
9
+
10
+ const external = Object.keys(devDependencies)
11
+
12
+ const buildCjs = () =>
13
+ esbuild.build({
14
+ ...common,
15
+ platform: 'node',
16
+ minify: false,
17
+ format: 'cjs',
18
+ external,
19
+ outfile: 'dist/index.cjs',
20
+ entryPoints: ['src/index.ts'],
21
+ allowOverwrite: true,
22
+ })
23
+
24
+ const buildEsm = () =>
25
+ esbuild.build({
26
+ ...common,
27
+ platform: 'browser',
28
+ format: 'esm',
29
+ minify: false,
30
+ external,
31
+ outfile: 'dist/index.mjs',
32
+ entryPoints: ['src/index.ts'],
33
+ allowOverwrite: true,
34
+ })
35
+
36
+ const main = async (argv: string[]) => {
37
+ if (argv.includes('--neutral')) {
38
+ await buildCjs()
39
+ await buildEsm()
40
+ } else {
41
+ throw new Error('you must specify a build target (--neutral)')
42
+ }
43
+ }
44
+
45
+ void main(process.argv.slice(2))
46
+ .then(() => {
47
+ console.info('Done')
48
+ process.exit(0)
49
+ })
50
+ .catch((error) => {
51
+ console.error(error)
52
+ process.exit(1)
53
+ })