Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
myakinx authored Feb 22, 2024
2 parents e93ea89 + 8f6bfbb commit 683fe20
Show file tree
Hide file tree
Showing 59 changed files with 10,098 additions and 16,537 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/monkey-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:

- name: Create stub firebase config
working-directory: ./frontend/src/ts/constants
run: mv ./firebase-config-example.ts ./firebase-config-live.ts
run: mv ./firebase-config-example.ts ./firebase-config.ts && cp ./firebase-config.ts ./firebase-config-live.ts

- name: Install dependencies
run: npm ci & cd frontend && npm ci
Expand All @@ -107,7 +107,7 @@ jobs:
run: npm run lint-fe

- name: Build
run: npm run pr-check-ts
run: npm run pr-check-build-fe

- name: Test
run: npm run test-fe
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ dist/
frontend/public/
backend/globalConfig.json
backend/server.version
vite-build/

#cloudflare y
.cloudflareKey.txt
Expand Down
4 changes: 2 additions & 2 deletions .release-it-fe.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"before:init": [
"npm run lint-fe",
"npm run test-fe",
"cd frontend && npx gulp build-production"
"cd frontend && npm run validate-json && npm run build"
],
"before:release": [
"cd frontend && npm run deploy-live",
"cd frontend && firebase deploy -P live --only hosting",
"sh ./bin/purgeCfCache.sh"
]
},
Expand Down
4 changes: 2 additions & 2 deletions .release-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"before:init": [
"npm run lint",
"npm run test",
"cd frontend && npx gulp build-production"
"cd frontend && npm run validate-json && npm run build"
],
"before:release": [
"sh ./bin/deployBackend.sh",
"cd frontend && npm run deploy-live",
"cd frontend && firebase deploy -P live --only hosting",
"sh ./bin/purgeCfCache.sh"
]
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/firebase.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"hosting": {
"public": "public",
"public": "dist",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
Expand Down
90 changes: 21 additions & 69 deletions frontend/gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,91 +1,43 @@
const { webpack } = require("webpack");
const eslint = require("gulp-eslint-new");
const { task, src, series, watch } = require("gulp");
const { resolve } = require("path");
const fs = require("fs");
const webpackDevConfig = require("./webpack/config.dev.js");
const webpackProdConfig = require("./webpack/config.prod.js");

const JSONValidation = require("./scripts/json-validation");
import eslint, { format, failAfterError } from "gulp-eslint-new";
import gulp from "gulp";
import {
validateAll,
validateQuotes,
validateLanguages,
validateOthers,
} from "./scripts/json-validation.cjs";
const eslintConfig = "../.eslintrc.json";

const { task, src, series } = gulp;

task("lint", function () {
return src(["./src/ts/**/*.ts"])
.pipe(eslint(eslintConfig))
.pipe(eslint.format())
.pipe(eslint.failAfterError());
.pipe(format())
.pipe(failAfterError());
});

task("lint-json", function () {
return src("./static/**/*.json")
.pipe(eslint(eslintConfig))
.pipe(eslint.format())
.pipe(eslint.failAfterError());
.pipe(format())
.pipe(failAfterError());
});

task("validate-json-schema", function () {
return JSONValidation.validateAll();
});

const taskWithWebpackConfig = (webpackConfig) => {
return async () => {
return new Promise((resolve, reject) => {
webpack(webpackConfig, (err, stats) => {
if (err) {
return reject(err);
}
if (stats.hasErrors()) {
return reject(new Error(stats.compilation.errors.join("\n")));
}
console.log(
`Finished building in ${
(stats.endTime - stats.startTime) / 1000
} second(s)`
);
resolve();
});
});
};
};

task("webpack", taskWithWebpackConfig(webpackDevConfig));
task("webpack-production", taskWithWebpackConfig(webpackProdConfig));

task("compile", series("lint", "lint-json", "webpack"));

task(
"compile-production",
series("lint", "lint-json", "validate-json-schema", "webpack-production")
);

task("watch", function () {
watch(["./src/ts/**/*.ts", "./src/ts/*.ts"], series("lint"));
watch(["./static/**/*.*", "./static/*.*"], series("lint-json"));
return validateAll();
});

task("build", series("compile"));

task("build-production", series("compile-production"));

//PR CHECK

task("validate-quote-json-schema", function () {
return JSONValidation.validateQuotes();
task("pr-check-quote-json", function () {
return validateQuotes();
});

task("validate-language-json-schema", function () {
return JSONValidation.validateLanguages();
task("pr-check-language-json", function () {
return validateLanguages();
});

task("validate-other-json-schema", function () {
return JSONValidation.validateOthers();
task("pr-check-other-json", function () {
return validateOthers();
});

task("pr-check-lint-json", series("lint-json"));
task("pr-check-quote-json", series("validate-quote-json-schema"));
task("pr-check-language-json", series("validate-language-json-schema"));
task("pr-check-other-json", series("validate-other-json-schema"));

task("pr-check-lint", series("lint"));

task("pr-check-ts", series("webpack-production"));
Loading

0 comments on commit 683fe20

Please sign in to comment.