chore: add JS boilerplate code from Flarum CLI

This commit is contained in:
David Wheatley 2021-10-13 19:28:14 +01:00
parent 4072a3cd6d
commit cfab9a65ca
No known key found for this signature in database
GPG Key ID: DCC0FCE349280DFF
3 changed files with 10991 additions and 11156 deletions

22093
js/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,23 @@
{ {
"private": true, "name": "@blomstra/realtime",
"name": "@blomstra/realtime", "private": true,
"dependencies": { "version": "0.0.0",
"flarum-webpack-config": "^1.0.0", "prettier": "@flarum/prettier-config",
"lodash-es": "^4.17.14", "dependencies": {
"pusher-js": "^7.0.3", "flarum-webpack-config": "^1.0.0",
"webpack": "^4.43.0", "pusher-js": "^7.0.3",
"webpack-cli": "^3.3.11" "webpack": "^4.46.0",
}, "webpack-cli": "^4.9.0",
"scripts": { "@flarum/prettier-config": "^1.0.0",
"dev": "webpack --mode development --watch", "flarum-tsconfig": "^1.0.2"
"build": "webpack --mode production", },
"lint": "prettier --single-quote --trailing-comma es5 --print-width 150 --tab-width 4 --write src" "scripts": {
}, "dev": "webpack --mode development --watch",
"devDependencies": { "build": "webpack --mode production",
"prettier": "^2.3.1" "format": "prettier --write src",
} "format-check": "prettier --check src"
},
"devDependencies": {
"prettier": "^2.4.1"
}
} }

16
js/tsconfig.json Normal file
View File

@ -0,0 +1,16 @@
{
// Use Flarum's tsconfig as a starting point
"extends": "flarum-tsconfig",
// This will match all .ts, .tsx, .d.ts, .js, .jsx files in your `src` folder
// and also tells your Typescript server to read core's global typings for
// access to `dayjs` and `$` in the global namespace.
"include": ["src/**/*", "../vendor/flarum/core/js/dist-typings/@types/**/*"],
"compilerOptions": {
// This will output typings to `dist-typings`
"declarationDir": "./dist-typings",
"baseUrl": ".",
"paths": {
"flarum/*": ["../vendor/flarum/core/js/dist-typings/*"]
}
}
}