-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from frontend-park-mail-ru/NM-2
NM-2: core spa logic
- Loading branch information
Showing
56 changed files
with
4,845 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import globals from "globals"; | ||
import pluginJs from "@eslint/js"; | ||
|
||
|
||
export default [ | ||
{ | ||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
Handlebars: "readonly" | ||
} | ||
} | ||
}, | ||
pluginJs.configs.recommended, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
packages: read | ||
statuses: write | ||
|
||
steps: | ||
- name: Check out code into directory | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Node.js 20.x | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: npm | ||
|
||
- name: Clean install | ||
id: install | ||
run: npm ci | ||
|
||
- name: Run linter | ||
id: super-linter | ||
uses: super-linter/super-linter/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
IGNORE_GITIGNORED_FILES: true | ||
DEFAULT_BRANCH: main | ||
VALIDATE_JAVASCRIPT_ES: true | ||
VALIDATE_ALL_CODEBASE: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
node_modules/ | ||
.idea/ | ||
.vscode/ | ||
.DS_Store | ||
|
||
*.precompiled.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
ENV_FILE = ./docker/.env | ||
include $(ENV_FILE) | ||
|
||
DOCKER_COMPOSE_PATH = ./docker/docker-compose.yaml | ||
|
||
# use `gawk` on mac os | ||
AWK := awk | ||
ifeq ($(shell uname -s), Darwin) | ||
AWK = gawk | ||
ifeq (, $(shell which gawk 2> /dev/null)) | ||
$(error "gawk not found") | ||
endif | ||
endif | ||
|
||
################################################################################ | ||
# Miscellaneous | ||
################################################################################ | ||
|
||
.PHONY: help | ||
## (default) Show help page. | ||
help: | ||
@echo "$$(tput bold)Available rules:$$(tput sgr0)";echo;sed -ne"/^## /{h;s/.*//;:d" -e"H;n;s/^## //;td" -e"s/:.*//;G;s/\\n## /---/;s/\\n/ /g;p;}" ${MAKEFILE_LIST}|awk -F --- -v n=$$(tput cols) -v i=29 -v a="$$(tput setaf 6)" -v z="$$(tput sgr0)" '{printf"%s%*s%s ",a,-i,$$1,z;m=split($$2,w," ");l=n-i;for(j=1;j<=m;j++){l-=length(w[j])+1;if(l<= 0){l=n-i-length(w[j])-1;printf"\n%*s ",-i," ";}printf"%s ",w[j];}printf"\n\n";}' | ||
|
||
################################################################################ | ||
# Containers | ||
################################################################################ | ||
|
||
.PHONY: docker-build | ||
## Build docker container static server. | ||
docker-build: | ||
@docker compose -f $(DOCKER_COMPOSE_PATH) --env-file $(ENV_FILE) build | ||
|
||
.PHONY: docker-start | ||
## Start docker compose containers (all by default). | ||
## Format: `docker-start [compose=<docker-compose-service>]`. | ||
## Example: `docker-start`, `docker-stop compose=postgres`. | ||
docker-start: | ||
@docker compose -f $(DOCKER_COMPOSE_PATH) --env-file $(ENV_FILE) up -d $(compose) | ||
|
||
.PHONY: docker-stop | ||
## Stop docker compose containers (all by default). | ||
## Format: `docker-stop [compose=<docker-compose-service>]`. | ||
## Example: `docker-stop`, `docker-stop compose=postgres`. | ||
docker-stop: | ||
@docker compose -f $(DOCKER_COMPOSE_PATH) stop $(compose) | ||
|
||
.PHONY: docker-ash | ||
## Run `ash` in docker container of static server. | ||
docker-ash: | ||
@docker exec -it $(SERVICE_NAME) /bin/ash | ||
|
||
.PHONY: docker-clean | ||
## Remove containers, networks, volumes, and images created by `make docker-start`. | ||
docker-clean: | ||
@docker compose -f $(DOCKER_COMPOSE_PATH) down | ||
|
||
.PHONY: build-image | ||
## Build docker image of frontend static server with name. | ||
build-image: | ||
@docker build -f docker/Dockerfile --platform linux/amd64 -t daronenko/$(SERVICE_NAME)-frontend:$(VERSION) . | ||
|
||
.PHONY: push-image | ||
## Push docker image of frontend static server to the docker hub. | ||
push-image: | ||
@docker push daronenko/$(SERVICE_NAME)-frontend:$(VERSION) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SERVICE_NAME=novamusic | ||
VERSION=v0.3 | ||
PORT=3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM node:20-alpine | ||
|
||
WORKDIR /service | ||
|
||
COPY package.json ./ | ||
RUN npm install | ||
|
||
COPY . . | ||
|
||
EXPOSE 3000 | ||
|
||
CMD [ "npm", "run", "start" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
services: | ||
novamusic-frontend: | ||
image: daronenko/novamusic-frontend:${VERSION} | ||
container_name: novamusic-frontend | ||
build: | ||
dockerfile: docker/Dockerfile | ||
context: .. | ||
env_file: .env | ||
ports: | ||
- 80:${PORT} | ||
restart: on-failure |
Oops, something went wrong.