summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.eslintignore1
-rw-r--r--.eslintrc3
-rw-r--r--.stylelintrc4
-rw-r--r--Makefile5
-rw-r--r--web_src/js/features/gitGraph.js (renamed from web_src/js/gitGraphLoader.js)6
-rw-r--r--web_src/js/index.js6
-rw-r--r--web_src/js/standalone/swagger.js (renamed from web_src/js/swagger.js)0
-rw-r--r--web_src/js/vendor/gitGraph.js (renamed from web_src/js/gitGraph.js)0
-rw-r--r--web_src/js/vendor/semanticDropdown.js (renamed from web_src/js/semanticDropdown.js)0
-rw-r--r--web_src/less/index.less5
-rw-r--r--web_src/less/vendor/gitGraph.css (renamed from web_src/css/gitGraph.css)0
-rw-r--r--webpack.config.js2
12 files changed, 21 insertions, 11 deletions
diff --git a/.eslintignore b/.eslintignore
deleted file mode 100644
index 74bd6f529f..0000000000
--- a/.eslintignore
+++ /dev/null
@@ -1 +0,0 @@
-/web_src/js/semanticDropdown.js
diff --git a/.eslintrc b/.eslintrc
index cc85290a6b..6dfe6a0509 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -4,6 +4,9 @@ extends:
- eslint-config-airbnb-base
- eslint:recommended
+ignorePatterns:
+ - /web_src/js/vendor
+
parserOptions:
ecmaVersion: 2020
diff --git a/.stylelintrc b/.stylelintrc
index a3eb6c3fb5..669d2d7b71 100644
--- a/.stylelintrc
+++ b/.stylelintrc
@@ -1,6 +1,10 @@
extends: stylelint-config-standard
+ignoreFiles:
+ - web_src/less/vendor/**/*
+
rules:
+ at-rule-empty-line-before: null
block-closing-brace-empty-line-before: null
color-hex-length: null
comment-empty-line-before: null
diff --git a/Makefile b/Makefile
index 41213d3860..4177d7856e 100644
--- a/Makefile
+++ b/Makefile
@@ -56,7 +56,8 @@ LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(G
PACKAGES ?= $(filter-out code.gitea.io/gitea/integrations/migration-test,$(filter-out code.gitea.io/gitea/integrations,$(shell GO111MODULE=on $(GO) list -mod=vendor ./... | grep -v /vendor/)))
GO_SOURCES ?= $(shell find . -name "*.go" -type f)
-WEBPACK_SOURCES ?= $(shell find web_src/js web_src/css web_src/less -type f)
+WEBPACK_SOURCES ?= $(shell find web_src/js web_src/less -type f)
+WEBPACK_CONFIGS := webpack.config.js .eslintrc .stylelintrc
WEBPACK_DEST := public/js/index.js public/css/index.css
BINDATA_DEST := modules/public/bindata.go modules/options/bindata.go modules/templates/bindata.go
@@ -517,7 +518,7 @@ $(FOMANTIC_EVIDENCE): semantic.json $(FOMANTIC_SOURCES) | node_modules
.PHONY: webpack
webpack: node-check $(WEBPACK_DEST)
-$(WEBPACK_DEST): $(WEBPACK_SOURCES) webpack.config.js | node_modules
+$(WEBPACK_DEST): $(WEBPACK_SOURCES) $(WEBPACK_CONFIGS) | node_modules
npx eslint web_src/js webpack.config.js
npx stylelint web_src/less
npx webpack --hide-modules --display-entrypoints=false
diff --git a/web_src/js/gitGraphLoader.js b/web_src/js/features/gitGraph.js
index f2687fa270..a18c575163 100644
--- a/web_src/js/gitGraphLoader.js
+++ b/web_src/js/features/gitGraph.js
@@ -1,8 +1,8 @@
-$(async () => {
+export default async function initGitGraph() {
const graphCanvas = document.getElementById('graph-canvas');
if (!graphCanvas) return;
- const { default: gitGraph } = await import(/* webpackChunkName: "gitgraph" */'./gitGraph.js');
+ const { default: gitGraph } = await import(/* webpackChunkName: "gitgraph" */'../vendor/gitGraph.js');
const graphList = [];
$('#graph-raw-list li span.node-relation').each(function () {
@@ -10,4 +10,4 @@ $(async () => {
});
gitGraph(graphCanvas, graphList);
-});
+}
diff --git a/web_src/js/index.js b/web_src/js/index.js
index cbd62f1c1e..3fa6303c8a 100644
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -5,10 +5,11 @@
import 'jquery.are-you-sure';
import './publicPath.js';
import './polyfills.js';
-import './gitGraphLoader.js';
-import './semanticDropdown.js';
+import './vendor/semanticDropdown.js';
+
import initContextPopups from './features/contextPopup.js';
import initHighlight from './features/highlight.js';
+import initGitGraph from './features/gitGraph.js';
import ActivityTopAuthors from './components/ActivityTopAuthors.vue';
@@ -2578,6 +2579,7 @@ $(document).ready(async () => {
initRepoStatusChecker();
initTemplateSearch();
initContextPopups(suburl);
+ initGitGraph();
// Repo clone url.
if ($('#repo-clone-url').length > 0) {
diff --git a/web_src/js/swagger.js b/web_src/js/standalone/swagger.js
index 757612dcdf..757612dcdf 100644
--- a/web_src/js/swagger.js
+++ b/web_src/js/standalone/swagger.js
diff --git a/web_src/js/gitGraph.js b/web_src/js/vendor/gitGraph.js
index 12d7a2eddf..12d7a2eddf 100644
--- a/web_src/js/gitGraph.js
+++ b/web_src/js/vendor/gitGraph.js
diff --git a/web_src/js/semanticDropdown.js b/web_src/js/vendor/semanticDropdown.js
index c9144adf53..c9144adf53 100644
--- a/web_src/js/semanticDropdown.js
+++ b/web_src/js/vendor/semanticDropdown.js
diff --git a/web_src/less/index.less b/web_src/less/index.less
index a8ef18953d..1b93024329 100644
--- a/web_src/less/index.less
+++ b/web_src/less/index.less
@@ -1,3 +1,6 @@
+@import "~highlight.js/styles/github.css";
+@import "./vendor/gitGraph.css";
+
@import "_tribute";
@import "_emojify";
@import "_base";
@@ -13,5 +16,3 @@
@import "_admin";
@import "_explore";
@import "_review";
-@import "~highlight.js/styles/github.css";
-@import "../css/gitGraph.css";
diff --git a/web_src/css/gitGraph.css b/web_src/less/vendor/gitGraph.css
index bb7e708101..bb7e708101 100644
--- a/web_src/css/gitGraph.css
+++ b/web_src/less/vendor/gitGraph.css
diff --git a/webpack.config.js b/webpack.config.js
index 57f624aa14..08926bf58a 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -24,7 +24,7 @@ module.exports = {
resolve(__dirname, 'web_src/less/index.less'),
],
swagger: [
- resolve(__dirname, 'web_src/js/swagger.js'),
+ resolve(__dirname, 'web_src/js/standalone/swagger.js'),
],
jquery: [
resolve(__dirname, 'web_src/js/jquery.js'),