mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
move node_modules into root folder [action required]
Recommend removing ts/node_modules folder before attempting to build after this update. This moves ts/node_modules into the root of the project to work around https://github.com/ankitects/anki/pull/1405#issuecomment-936213861 Also fixes the sass errors shown when running scripts/svelte-check
This commit is contained in:
parent
b9251290ca
commit
46b80ca773
15 changed files with 28 additions and 24 deletions
|
@ -1 +1 @@
|
||||||
ts/node_modules
|
node_modules
|
||||||
|
|
|
@ -11,7 +11,7 @@ BAZEL="bazel --output_user_root=/state/bazel --output_base=/state/bazel/anki"
|
||||||
BUILDARGS="--config=ci --experimental_convenience_symlinks=ignore --disk_cache=/state/bazel/disk --repository_cache=/state/bazel/repo"
|
BUILDARGS="--config=ci --experimental_convenience_symlinks=ignore --disk_cache=/state/bazel/disk --repository_cache=/state/bazel/repo"
|
||||||
|
|
||||||
# move existing node_modules into tree
|
# move existing node_modules into tree
|
||||||
test -e /state/node_modules && mv /state/node_modules ts/
|
test -e /state/node_modules && mv /state/node_modules .
|
||||||
|
|
||||||
$BAZEL build $BUILDARGS ...
|
$BAZEL build $BUILDARGS ...
|
||||||
|
|
||||||
|
@ -26,4 +26,4 @@ python scripts/copyright_headers.py
|
||||||
|
|
||||||
echo "--- Cleanup"
|
echo "--- Cleanup"
|
||||||
# if tests succeed, back up node_modules folder
|
# if tests succeed, back up node_modules folder
|
||||||
mv ts/node_modules /state/
|
mv node_modules /state/
|
||||||
|
|
|
@ -7,7 +7,7 @@ BAZEL="bazel --output_user_root=~/bazel --output_base=~/bazel/anki"
|
||||||
BUILDARGS="--config=ci --experimental_convenience_symlinks=ignore"
|
BUILDARGS="--config=ci --experimental_convenience_symlinks=ignore"
|
||||||
|
|
||||||
# move existing node_modules into tree
|
# move existing node_modules into tree
|
||||||
test -e ~/node_modules && mv ~/node_modules ts/
|
test -e ~/node_modules && mv ~/node_modules .
|
||||||
|
|
||||||
$BAZEL build $BUILDARGS ...
|
$BAZEL build $BUILDARGS ...
|
||||||
|
|
||||||
|
@ -16,4 +16,4 @@ $BAZEL test $BUILDARGS ...
|
||||||
|
|
||||||
echo "--- Cleanup"
|
echo "--- Cleanup"
|
||||||
# if tests succeed, back up node_modules folder
|
# if tests succeed, back up node_modules folder
|
||||||
mv ts/node_modules ~/
|
mv node_modules ~/
|
||||||
|
|
|
@ -3,7 +3,7 @@ set BAZEL=\bazel\bazel.exe --output_user_root=\bazel\ankici --output_base=\bazel
|
||||||
set BUILDARGS=--config=ci
|
set BUILDARGS=--config=ci
|
||||||
|
|
||||||
if exist \bazel\node_modules (
|
if exist \bazel\node_modules (
|
||||||
move \bazel\node_modules ts\node_modules
|
move \bazel\node_modules .\node_modules
|
||||||
)
|
)
|
||||||
|
|
||||||
:: rollup may fail on the first build, so we build once without checking return code
|
:: rollup may fail on the first build, so we build once without checking return code
|
||||||
|
@ -37,4 +37,4 @@ IF %ERRORLEVEL% NEQ 0 exit /B 1
|
||||||
@REM echo Import succesful.
|
@REM echo Import succesful.
|
||||||
|
|
||||||
echo --- Cleanup
|
echo --- Cleanup
|
||||||
move ts\node_modules \bazel\node_modules
|
move node_modules \bazel\node_modules
|
||||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -6,3 +6,4 @@ target
|
||||||
user.bazelrc
|
user.bazelrc
|
||||||
.dmypy.json
|
.dmypy.json
|
||||||
rust-project.json
|
rust-project.json
|
||||||
|
node_modules
|
||||||
|
|
|
@ -33,5 +33,7 @@ pkg_tar(
|
||||||
tags = ["manual"],
|
tags = ["manual"],
|
||||||
)
|
)
|
||||||
|
|
||||||
# for version info
|
exports_files([
|
||||||
exports_files(["defs.bzl"])
|
"defs.bzl",
|
||||||
|
"package.json",
|
||||||
|
])
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
workspace(
|
workspace(
|
||||||
name = "ankidesktop",
|
name = "ankidesktop",
|
||||||
managed_directories = {"@npm": [
|
managed_directories = {"@npm": [
|
||||||
"ts/node_modules",
|
"node_modules",
|
||||||
]},
|
]},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
6
defs.bzl
6
defs.bzl
|
@ -43,12 +43,12 @@ def setup_deps():
|
||||||
python_runtime = "@python//:python",
|
python_runtime = "@python//:python",
|
||||||
)
|
)
|
||||||
|
|
||||||
node_repositories(package_json = ["@ankidesktop//ts:package.json"])
|
node_repositories(package_json = ["@ankidesktop//:package.json"])
|
||||||
|
|
||||||
yarn_install(
|
yarn_install(
|
||||||
name = "npm",
|
name = "npm",
|
||||||
package_json = "@ankidesktop//ts:package.json",
|
package_json = "@ankidesktop//:package.json",
|
||||||
yarn_lock = "@ankidesktop//ts:yarn.lock",
|
yarn_lock = "@ankidesktop//:yarn.lock",
|
||||||
)
|
)
|
||||||
|
|
||||||
sass_repositories()
|
sass_repositories()
|
||||||
|
|
|
@ -181,7 +181,7 @@ of `use` statements.
|
||||||
|
|
||||||
The Bazel build products will make RA start up slowly out of the box. For a much
|
The Bazel build products will make RA start up slowly out of the box. For a much
|
||||||
nicer experience, add each of the bazel-* folders to Rust Analyzer's excludeDirs
|
nicer experience, add each of the bazel-* folders to Rust Analyzer's excludeDirs
|
||||||
settings, and ts/node_modules. Wildcards don't work unfortunately. Then adjust
|
settings, and node_modules. Wildcards don't work unfortunately. Then adjust
|
||||||
VS Code's "watcher exclude", and add `**/bazel-*`.
|
VS Code's "watcher exclude", and add `**/bazel-*`.
|
||||||
|
|
||||||
After running 'code' from the project root, it may take a minute or two to be
|
After running 'code' from the project root, it may take a minute or two to be
|
||||||
|
@ -203,12 +203,12 @@ Recording also requires `lame` to be in your system path.
|
||||||
## Build errors and cleaning
|
## Build errors and cleaning
|
||||||
|
|
||||||
If you get errors with @npm and node_modules in the message, try deleting the
|
If you get errors with @npm and node_modules in the message, try deleting the
|
||||||
ts/node_modules folder.
|
node_modules folder.
|
||||||
|
|
||||||
Unlike the old Make system, a "clean build" should almost never be required
|
Unlike the old Make system, a "clean build" should almost never be required
|
||||||
unless you are debugging issues with the build system. But if you need to get
|
unless you are debugging issues with the build system. But if you need to get
|
||||||
things to a fresh state, you can run `bazel clean --expunge`. Afte doing so,
|
things to a fresh state, you can run `bazel clean --expunge`. After doing so,
|
||||||
make sure you remove the ts/node_modules folder, or subsequent build commands
|
make sure you remove the node_modules folder, or subsequent build commands
|
||||||
will fail with a "no such file or directory node_modules/anki" message.
|
will fail with a "no such file or directory node_modules/anki" message.
|
||||||
|
|
||||||
## Tracing build problems
|
## Tracing build problems
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"fix": "prettier --write */*.ts */*.svelte",
|
"fix": "prettier --write */*.ts */*.svelte",
|
||||||
"postinstall": "patch-package"
|
"postinstall": "patch-package --patch-dir ts/patches"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fluent/bundle": "^0.17.0",
|
"@fluent/bundle": "^0.17.0",
|
|
@ -18,7 +18,7 @@ nonstandard_header = {
|
||||||
ignored_folders = [
|
ignored_folders = [
|
||||||
"bazel-",
|
"bazel-",
|
||||||
"qt/forms",
|
"qt/forms",
|
||||||
"ts/node_modules",
|
"node_modules",
|
||||||
]
|
]
|
||||||
|
|
||||||
if not os.path.exists("WORKSPACE"):
|
if not os.path.exists("WORKSPACE"):
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
SASS_PATH=$(pwd)/bazel-bin ts/node_modules/.bin/svelte-check --workspace ts
|
SASS_PATH=ts/sass:$(pwd)/bazel-bin/ts/sass \
|
||||||
|
node_modules/.bin/svelte-check \
|
||||||
|
--workspace ts
|
||||||
|
|
|
@ -30,8 +30,7 @@
|
||||||
],
|
],
|
||||||
// uncomment for building with tsc directly
|
// uncomment for building with tsc directly
|
||||||
// "outDir": "dist",
|
// "outDir": "dist",
|
||||||
// "rootDir": "..",
|
"rootDir": "..",
|
||||||
"rootDir": ".",
|
|
||||||
"rootDirs": [
|
"rootDirs": [
|
||||||
".",
|
".",
|
||||||
// for VS code
|
// for VS code
|
||||||
|
|
|
@ -3,6 +3,6 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
./node_modules/.bin/license-checker-rseidelsohn --production --json \
|
cd .. && ./node_modules/.bin/license-checker-rseidelsohn --production --json \
|
||||||
--excludePackages anki --relativeLicensePath \
|
--excludePackages anki --relativeLicensePath \
|
||||||
--relativeModulePath > licenses.json
|
--relativeModulePath > ts/licenses.json
|
||||||
|
|
Loading…
Reference in a new issue