浏览代码

chore: fix frontend directory structure

Vivek R 6 年之前
父节点
当前提交
11ca4beddb

+ 1 - 3
.gitignore

@@ -1,8 +1,6 @@
 frontend/node_modules/
-frontend/my/node_modules/
 frontend/.cache/
 frontend/yarn.lock
-frontend/my/yarn.lock
 .vscode/
 
-config.toml
+config.toml

+ 7 - 7
Makefile

@@ -1,5 +1,5 @@
 BIN := listmonk
-STATIC := config.toml.sample schema.sql queries.sql public email-templates frontend/my/build:/frontend
+STATIC := config.toml.sample schema.sql queries.sql public email-templates frontend/build:/frontend
 
 HASH := $(shell git rev-parse --short HEAD)
 COMMIT_DATE := $(shell git show -s --format=%ci ${HASH})
@@ -8,20 +8,20 @@ VERSION := ${HASH} (${COMMIT_DATE})
 
 .PHONY: build-frontend
 build-frontend:
-	cd frontend/my && yarn install && yarn build
+	cd frontend && yarn install && yarn build
 
 .PHONY: quickdev
 quickdev:
-	@ if [ ! -d "frontend/my/node_modules" ]; then \
+	@ if [ ! -d "frontend/node_modules" ]; then \
 		echo "Installing frontend deps"; \
-		cd frontend/my && yarn install; \
+		cd frontend && yarn install; \
 	fi
 
-	@ if [ ! -d "frontend/my/build" ]; then \
+	@ if [ ! -d "frontend/build" ]; then \
 		echo "Creating build directory"; \
-		mkdir -p frontend/my/build; \
+		mkdir -p frontend/build; \
 		echo "Building frontend assets"; \
-		cd frontend/my && yarn build; \
+		cd frontend && yarn build; \
 	fi
 
 	@ echo -e "\nBuilding go binary\n"

+ 1 - 1
README.dev.md

@@ -15,7 +15,7 @@ There are two independent components, the Go backend and the React frontend. In
 
 ### 2. Run the frontend
 
-`cd frontend/my` and `yarn start`
+`cd frontend` and `yarn start`
 
 ### 3. Setup an Nginx proxy endpoint
 

+ 1 - 0
frontend/.babelrc

@@ -2,3 +2,4 @@
   "presets": ["env", "react"],
   "plugins": [["transform-react-jsx", { "pragma": "h" }]]
 }
+

+ 0 - 0
frontend/my/.gitignore → frontend/.gitignore


+ 0 - 0
frontend/my/README.md → frontend/README.md


+ 0 - 0
frontend/my/config-overrides.js → frontend/config-overrides.js


+ 0 - 34
frontend/my/package.json

@@ -1,34 +0,0 @@
-{
-  "name": "my",
-  "version": "0.1.0",
-  "private": true,
-  "dependencies": {
-    "antd": "^3.6.5",
-    "axios": "^0.18.0",
-    "bizcharts": "^3.2.5-beta.4",
-    "dayjs": "^1.7.5",
-    "react": "^16.4.1",
-    "react-app-rewire-less": "^2.1.3",
-    "react-app-rewired": "^1.6.2",
-    "react-dom": "^16.4.1",
-    "react-quill": "^1.3.1",
-    "react-router": "^4.3.1",
-    "react-router-dom": "^4.3.1",
-    "react-scripts": "1.1.4"
-  },
-  "scripts": {
-    "start": "react-app-rewired start",
-    "build": "GENERATE_SOURCEMAP=false PUBLIC_URL=/frontend/ react-app-rewired build",
-    "test": "react-app-rewired test --env=jsdom",
-    "eject": "react-scripts eject"
-  },
-  "eslintConfig": {
-    "extends": "react-app"
-  },
-  "devDependencies": {
-    "babel-plugin-import": "^1.11.0",
-    "eslint-plugin-prettier": "^3.0.1",
-    "less-plugin-npm-import": "^2.1.0",
-    "prettier": "1.15.3"
-  }
-}

+ 30 - 2
frontend/package.json

@@ -1,6 +1,34 @@
 {
+  "name": "my",
+  "version": "0.1.0",
+  "private": true,
   "dependencies": {
-    "create-react-app": "^1.5.2",
-    "react": "^16.4.1"
+    "antd": "^3.6.5",
+    "axios": "^0.18.0",
+    "bizcharts": "^3.2.5-beta.4",
+    "dayjs": "^1.7.5",
+    "react": "^16.4.1",
+    "react-app-rewire-less": "^2.1.3",
+    "react-app-rewired": "^1.6.2",
+    "react-dom": "^16.4.1",
+    "react-quill": "^1.3.1",
+    "react-router": "^4.3.1",
+    "react-router-dom": "^4.3.1",
+    "react-scripts": "1.1.4"
+  },
+  "scripts": {
+    "start": "react-app-rewired start",
+    "build": "GENERATE_SOURCEMAP=false PUBLIC_URL=/frontend/ react-app-rewired build",
+    "test": "react-app-rewired test --env=jsdom",
+    "eject": "react-scripts eject"
+  },
+  "eslintConfig": {
+    "extends": "react-app"
+  },
+  "devDependencies": {
+    "babel-plugin-import": "^1.11.0",
+    "eslint-plugin-prettier": "^3.0.1",
+    "less-plugin-npm-import": "^2.1.0",
+    "prettier": "1.15.3"
   }
 }

+ 0 - 0
frontend/my/public/favicon.png → frontend/public/favicon.png


+ 0 - 0
frontend/my/public/gallery.svg → frontend/public/gallery.svg


+ 0 - 0
frontend/my/public/index.html → frontend/public/index.html


+ 0 - 0
frontend/my/public/manifest.json → frontend/public/manifest.json


+ 0 - 0
frontend/my/src/App.js → frontend/src/App.js


+ 0 - 0
frontend/my/src/Campaign.js → frontend/src/Campaign.js


+ 0 - 0
frontend/my/src/Campaigns.js → frontend/src/Campaigns.js


+ 0 - 0
frontend/my/src/Dashboard.css → frontend/src/Dashboard.css


+ 0 - 0
frontend/my/src/Dashboard.js → frontend/src/Dashboard.js


+ 0 - 0
frontend/my/src/Import.js → frontend/src/Import.js


+ 0 - 0
frontend/my/src/Layout.js → frontend/src/Layout.js


+ 0 - 0
frontend/my/src/Lists.js → frontend/src/Lists.js


+ 0 - 0
frontend/my/src/Media.js → frontend/src/Media.js


+ 0 - 0
frontend/my/src/ModalPreview.js → frontend/src/ModalPreview.js


+ 0 - 0
frontend/my/src/Subscriber.js → frontend/src/Subscriber.js


+ 0 - 0
frontend/my/src/Subscribers.js → frontend/src/Subscribers.js


+ 0 - 0
frontend/my/src/Templates.js → frontend/src/Templates.js


+ 0 - 0
frontend/my/src/constants.js → frontend/src/constants.js


+ 0 - 0
frontend/my/src/index.css → frontend/src/index.css


+ 0 - 0
frontend/my/src/index.js → frontend/src/index.js


+ 0 - 0
frontend/my/src/logo.svg → frontend/src/logo.svg


+ 0 - 0
frontend/my/src/registerServiceWorker.js → frontend/src/registerServiceWorker.js


+ 0 - 0
frontend/my/src/static/gallery.svg → frontend/src/static/gallery.svg


+ 0 - 0
frontend/my/src/static/listmonk.svg → frontend/src/static/listmonk.svg


+ 0 - 0
frontend/my/src/utils.js → frontend/src/utils.js


+ 1 - 1
main.go

@@ -101,7 +101,7 @@ func initFileSystem(binPath string) (stuffbin.FileSystem, error) {
 
 		// The frontend app's static assets are aliased to /frontend
 		// so that they are accessible at localhost:port/frontend/static/ ...
-		"frontend/my/build:/frontend",
+		"frontend/build:/frontend",
 	}
 
 	fs, err = stuffbin.NewLocalFS("/", files...)