mirror of
https://github.com/flarum/core.git
synced 2025-09-05 21:53:04 +02:00
Setup Mithril 2
This commit is contained in:
committed by
Franz Liedke
parent
fa0ff204dd
commit
5c30f8fa67
11
js/package-lock.json
generated
11
js/package-lock.json
generated
@@ -1075,6 +1075,11 @@
|
|||||||
"integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==",
|
"integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==",
|
||||||
"dev": true
|
"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": {
|
"@types/parse-json": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",
|
||||||
@@ -3807,9 +3812,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mithril": {
|
"mithril": {
|
||||||
"version": "0.2.8",
|
"version": "2.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/mithril/-/mithril-0.2.8.tgz",
|
"resolved": "https://registry.npmjs.org/mithril/-/mithril-2.0.4.tgz",
|
||||||
"integrity": "sha512-9XuGnVmS2OyFexUuP/CcJFFJjHLM+RGYBxyVRNyQ6khbMfDJIF/xyZ4zq18ZRfPagpFmWUFpjHd5ZqPULGZyNg=="
|
"integrity": "sha512-mgw+DMZlhMS4PpprF6dl7ZoeZq5GGcAuWnrg5e12MvaGauc4jzWsDZtVGRCktsiQczOEUr2K5teKbE5k44RlOg=="
|
||||||
},
|
},
|
||||||
"mixin-deep": {
|
"mixin-deep": {
|
||||||
"version": "1.3.2",
|
"version": "1.3.2",
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
"name": "@flarum/core",
|
"name": "@flarum/core",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/preset-typescript": "^7.10.1",
|
"@babel/preset-typescript": "^7.10.1",
|
||||||
|
"@types/mithril": "^2.0.3",
|
||||||
"bootstrap": "^3.4.1",
|
"bootstrap": "^3.4.1",
|
||||||
"classnames": "^2.2.5",
|
"classnames": "^2.2.5",
|
||||||
"color-thief-browser": "^2.0.2",
|
"color-thief-browser": "^2.0.2",
|
||||||
@@ -13,7 +14,7 @@
|
|||||||
"jquery.hotkeys": "^0.1.0",
|
"jquery.hotkeys": "^0.1.0",
|
||||||
"lodash-es": "^4.17.14",
|
"lodash-es": "^4.17.14",
|
||||||
"m.attrs.bidi": "github:tobscure/m.attrs.bidi",
|
"m.attrs.bidi": "github:tobscure/m.attrs.bidi",
|
||||||
"mithril": "^0.2.8",
|
"mithril": "^2.0.4",
|
||||||
"punycode": "^2.1.1",
|
"punycode": "^2.1.1",
|
||||||
"spin.js": "^3.1.0",
|
"spin.js": "^3.1.0",
|
||||||
"webpack": "^4.43.0",
|
"webpack": "^4.43.0",
|
||||||
|
7
js/shims.d.ts
vendored
Normal file
7
js/shims.d.ts
vendored
Normal 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
4
js/tsconfig.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"extends": "./webpack-flarum-tsconfig"
|
||||||
|
}
|
||||||
|
|
17
js/webpack-config-shims.d.ts
vendored
Normal file
17
js/webpack-config-shims.d.ts
vendored
Normal 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 {};
|
22
js/webpack-config-tsconfig.json
Normal file
22
js/webpack-config-tsconfig.json
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Reference in New Issue
Block a user