Explorar el Código

#5406 AI Agents revamp: agents chat migrate to typescript 7

Aleksandr Trofimov hace 1 mes
padre
commit
70d6138f25
Se han modificado 4 ficheros con 15 adiciones y 8 borrados
  1. 1 1
      package.json
  2. 1 6
      rollup.config.js
  3. 10 0
      tsconfig.build.json
  4. 3 1
      tsconfig.json

+ 1 - 1
package.json

@@ -143,7 +143,7 @@
     "build:jekyll-toc": "cp node_modules/jekyll-toc/toc.js plugins_public; patch -p1 < patches/plugins_public_toc-js.txt",
     "build:urijs": "cp node_modules/urijs/src/URI.min.js plugins_public",
     "build:stripe": "mkdir -p plugins_public/stripe; cp -r node_modules/@stripe/connect-js/dist/ plugins_public/stripe",
-    "build:bundle": "mkdir -p plugins_public && rollup -c rollup.config.js",
+    "build:bundle": "mkdir -p plugins_public tmp/ts-out && tsc -p tsconfig.build.json && rollup -c rollup.config.js",
     "build": "mkdir -p plugins_public; rm -rf plugins_public/*; npm run install-bower-components; npm run; npm-run-all --parallel build:*",
     "postinstall": "npm run build"
   },

+ 1 - 6
rollup.config.js

@@ -1,10 +1,9 @@
 import resolve from '@rollup/plugin-node-resolve';
 import commonjs from '@rollup/plugin-commonjs';
 import replace from '@rollup/plugin-replace';
-import typescript from '@rollup/plugin-typescript';
 
 export default {
-    input: 'src/index.ts',
+    input: 'tmp/ts-out/index.js',
 
     output: {
         file: 'plugins_public/bundle.js',
@@ -18,9 +17,5 @@ export default {
         }),
         resolve({ browser: true }),
         commonjs(),
-        typescript({
-            tsconfig: './tsconfig.json',
-            compilerOptions: { noEmit: false },
-        }),
     ],
 };

+ 10 - 0
tsconfig.build.json

@@ -0,0 +1,10 @@
+{
+  "extends": "./tsconfig.json",
+  "compilerOptions": {
+    "noEmit": false,
+    "outDir": "./tmp/ts-out",
+    "rootDir": "./src",
+    "declaration": false,
+    "sourceMap": false
+  }
+}

+ 3 - 1
tsconfig.json

@@ -8,7 +8,9 @@
     "esModuleInterop": true,
     "jsx": "react-jsx",
     "noEmit": true,
-    "lib": ["ES2020", "DOM", "DOM.Iterable"]
+    "lib": ["ES2020", "DOM"],
+    "rootDir": "./src",
+    "types": []
   },
   "include": ["src"]
 }