mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
add typescript to build
This commit is contained in:
parent
9df10bb9ef
commit
9b04a92df2
5 changed files with 86 additions and 1 deletions
12
Makefile
12
Makefile
|
@ -50,7 +50,7 @@ uninstall:
|
|||
clean:
|
||||
rm -rf .build
|
||||
|
||||
build: .build/ui
|
||||
build: .build/ui js
|
||||
|
||||
.build/ui: $(shell find designer -name '*.ui')
|
||||
./tools/build_ui.sh
|
||||
|
@ -84,3 +84,13 @@ pytype: .build/pytype
|
|||
.build/pytype: $(CHECKDEPS)
|
||||
pytype --config pytype.conf
|
||||
touch $@
|
||||
|
||||
.PHONY: js
|
||||
|
||||
TSDEPS := $(wildcard ts/*.ts)
|
||||
JSDEPS := $(patsubst ts/%.ts, web/%.js, $(TSDEPS))
|
||||
|
||||
js: $(JSDEPS)
|
||||
|
||||
web/%.js: ts/%.ts
|
||||
(cd ts && ./node_modules/.bin/tsc $(notdir $<) --outFile ../web/$(notdir $@))
|
||||
|
|
1
ts/.gitignore
vendored
Normal file
1
ts/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
node_modules
|
35
ts/package-lock.json
generated
Normal file
35
ts/package-lock.json
generated
Normal file
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"name": "anki-dtop-js",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@types/jquery": {
|
||||
"version": "3.3.31",
|
||||
"resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.3.31.tgz",
|
||||
"integrity": "sha512-Lz4BAJihoFw5nRzKvg4nawXPzutkv7wmfQ5121avptaSIXlDNJCUuxZxX/G+9EVidZGuO0UBlk+YjKbwRKJigg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/sizzle": "*"
|
||||
}
|
||||
},
|
||||
"@types/mathjax": {
|
||||
"version": "0.0.36",
|
||||
"resolved": "https://registry.npmjs.org/@types/mathjax/-/mathjax-0.0.36.tgz",
|
||||
"integrity": "sha512-TqDJc2GWuTqd/m+G/FbNkN+/TF2OCCHvcawmhIrUaZkdVquMdNZmNiNUkupNg9qctorXXkVLVSogZv1DhmgLmg==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/sizzle": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.2.tgz",
|
||||
"integrity": "sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg==",
|
||||
"dev": true
|
||||
},
|
||||
"typescript": {
|
||||
"version": "3.7.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.3.tgz",
|
||||
"integrity": "sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
}
|
18
ts/package.json
Normal file
18
ts/package.json
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "anki-dtop-js",
|
||||
"version": "1.0.0",
|
||||
"description": "Anki desktop js support files",
|
||||
"directories": {
|
||||
"test": "tests"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "Ankitects Pty Ltd",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"devDependencies": {
|
||||
"@types/jquery": "^3.3.31",
|
||||
"@types/mathjax": "0.0.36",
|
||||
"typescript": "^3.7.3"
|
||||
}
|
||||
}
|
21
ts/tsconfig.json
Normal file
21
ts/tsconfig.json
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"moduleResolution": "node",
|
||||
"sourceMap": false,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"*": [
|
||||
"node_modules/*",
|
||||
"src/types/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue