1
0
mirror of https://github.com/flarum/core.git synced 2025-08-13 03:44:32 +02:00

Setup Mithril 2

This commit is contained in:
Matthew Kilgore
2020-08-04 19:10:50 -04:00
committed by Franz Liedke
parent fa0ff204dd
commit 5c30f8fa67
6 changed files with 60 additions and 4 deletions

11
js/package-lock.json generated
View File

@@ -1075,6 +1075,11 @@
"integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==",
"dev": true
},
"@types/mithril": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/@types/mithril/-/mithril-2.0.3.tgz",
"integrity": "sha512-cZHOdO2IiXYeyjeDYdbOisSdfaJRzfmRo3zVzgu33IWTMA0KEQObp9fdvqcuYdPz93iJ1yCl19GcEjo/9yv+yA=="
},
"@types/parse-json": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",
@@ -3807,9 +3812,9 @@
}
},
"mithril": {
"version": "0.2.8",
"resolved": "https://registry.npmjs.org/mithril/-/mithril-0.2.8.tgz",
"integrity": "sha512-9XuGnVmS2OyFexUuP/CcJFFJjHLM+RGYBxyVRNyQ6khbMfDJIF/xyZ4zq18ZRfPagpFmWUFpjHd5ZqPULGZyNg=="
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/mithril/-/mithril-2.0.4.tgz",
"integrity": "sha512-mgw+DMZlhMS4PpprF6dl7ZoeZq5GGcAuWnrg5e12MvaGauc4jzWsDZtVGRCktsiQczOEUr2K5teKbE5k44RlOg=="
},
"mixin-deep": {
"version": "1.3.2",

View File

@@ -3,6 +3,7 @@
"name": "@flarum/core",
"dependencies": {
"@babel/preset-typescript": "^7.10.1",
"@types/mithril": "^2.0.3",
"bootstrap": "^3.4.1",
"classnames": "^2.2.5",
"color-thief-browser": "^2.0.2",
@@ -13,7 +14,7 @@
"jquery.hotkeys": "^0.1.0",
"lodash-es": "^4.17.14",
"m.attrs.bidi": "github:tobscure/m.attrs.bidi",
"mithril": "^0.2.8",
"mithril": "^2.0.4",
"punycode": "^2.1.1",
"spin.js": "^3.1.0",
"webpack": "^4.43.0",

7
js/shims.d.ts vendored Normal file
View File

@@ -0,0 +1,7 @@
export * from './webpack-config-shims';
import Application from './src/common/Application';
declare global {
const app: Application;
}

4
js/tsconfig.json Normal file
View File

@@ -0,0 +1,4 @@
{
"extends": "./webpack-flarum-tsconfig"
}

17
js/webpack-config-shims.d.ts vendored Normal file
View File

@@ -0,0 +1,17 @@
import * as Mithril from 'mithril';
import Stream from 'mithril/stream';
import * as _dayjs from 'dayjs';
interface m extends Mithril.Static {
prop: typeof Stream;
}
declare global {
const m: m;
const dayjs: typeof _dayjs;
}
export as namespace Mithril;
export {};

View File

@@ -0,0 +1,22 @@
{
"include": ["src/**/*.ts"],
"files": ["shims.d.ts"],
"compilerOptions": {
"allowUmdGlobalAccess": true,
"outDir": "dist",
"sourceMap": true,
"strict": true,
"noImplicitReturns": false,
"noImplicitAny": false,
"module": "es2015",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"esModuleInterop": true,
"moduleResolution": "node",
"target": "es6",
"jsx": "preserve",
"lib": ["es2015", "es2017", "dom"],
"allowSyntheticDefaultImports": true
}
}