(core) Moving widget tests to core

Summary:
- Custom widget tests are now in grist-core
- Adding buildtools for grist-plugin-api.js

Test Plan: Existing tests

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D3617
This commit is contained in:
Jarosław Sadziński
2022-09-05 10:24:34 +02:00
parent ec157dc469
commit 2438a63255
27 changed files with 2519 additions and 2 deletions

View File

@@ -10,6 +10,8 @@ fi
set -x
tsc --build $PROJECT
buildtools/update_type_info.sh app
webpack --config buildtools/webpack.config.js --mode production
webpack --config buildtools/webpack.check.js --mode production
webpack --config buildtools/webpack.api.config.js --mode production
cat app/client/*.css app/client/*/*.css > static/bundle.css

27
buildtools/update_type_info.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
set -e
# updates any Foo*-ti.ts files $root that are older than Foo.ts
root=$1
if [[ -z "$root" ]]; then
echo "Usage: $0 app"
exit 1
fi
for root in "$@"; do
for ti in $(find $root/ -iname "*-ti.ts"); do
root=$(basename $ti -ti.ts)
dir=$(dirname $ti)
src="$dir/$root.ts"
if [ ! -e $src ]; then
echo "Cannot find src $src for $ti, aborting"
exit 1
fi
if [ $src -nt $ti ]; then
echo "Updating $ti from $src"
node_modules/.bin/ts-interface-builder $src
fi
done
done

View File

@@ -0,0 +1,44 @@
const path = require('path');
module.exports = {
target: 'web',
entry: {
"grist-plugin-api": "app/plugin/grist-plugin-api",
},
output: {
sourceMapFilename: "[file].map",
path: path.resolve("./static"),
library: "grist"
},
devtool: "source-map",
node: false,
resolve: {
extensions: ['.ts', '.js'],
modules: [
path.resolve('.'),
path.resolve('./ext'),
path.resolve('./stubs'),
path.resolve('./node_modules')
],
fallback: {
'path': require.resolve("path-browserify"),
},
},
optimization: {
minimize: false, // keep class names in code
},
module: {
rules: [
{
test: /\.(js|ts)?$/,
loader: 'esbuild-loader',
options: {
loader: 'ts',
target: 'es2017',
sourcemap: true,
},
exclude: /node_modules/
},
]
}
};