Skip to content

Commit

Permalink
v1872: v0.7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
MuTsunTsai committed Dec 18, 2024
2 parents b333ef3 + 6180931 commit c4de89e
Show file tree
Hide file tree
Showing 49 changed files with 1,502 additions and 3,840 deletions.
7 changes: 7 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
# https://clang-format-configurator.site/
AlignAfterOpenBracket: BlockIndent
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
AllowShortLoopsOnASingleLine: true
Expand All @@ -8,5 +9,11 @@ FixNamespaceComments: false
IndentWidth: 4
NamespaceIndentation: All
PackConstructorInitializers: NextLine
SpaceBeforeCtorInitializerColon: false
SpaceBeforeInheritanceColon: false
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterControlStatements: false
SpaceBeforeRangeBasedForLoopColon: false
TabWidth: 4
UseTab: Always
15 changes: 12 additions & 3 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
Checks: '-*,
modernize-*,
-modernize-use-trailing-return-type,
-modernize-use-nodiscard'
modernize-*,
-modernize-use-trailing-return-type,
-modernize-use-nodiscard,
performance-*,
-performance-avoid-endl,
readability-*,
-readability-identifier-length,
-readability-implicit-bool-conversion,
-readability-braces-around-statements,
-readability-magic-numbers,
-readability-avoid-nested-conditional-operator,
-readability-use-anyofallof'
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ trim_trailing_whitespace = false

[lib/*]
insert_final_newline = false

[.clang-*]
indent_style = space
indent_size = 2
6 changes: 2 additions & 4 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
"hbenl.vscode-test-explorer",
"lokalise.i18n-ally",
"ms-playwright.playwright",
"ms-python.mypy-type-checker",
"ms-python.pylint",
"ms-python.vscode-pylance",
"ms-vscode.cpptools",
"ms-vscode.test-adapter-converter",
"mutsuntsai.jsdoc-link",
"ryanluker.vscode-coverage-gutters",
"sibiraj-s.vscode-scss-formatter",
"stylelint.vscode-stylelint",
"vue.volar"
]
}
}
32 changes: 17 additions & 15 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
{
"C_Cpp.autoAddFileAssociations": false,
"C_Cpp.codeAnalysis.clangTidy.args": [
"--extra-arg-before=-target",
"--extra-arg-before=wasm32-unknown-emscripten"
],
"C_Cpp.codeAnalysis.clangTidy.enabled": true,
"C_Cpp.codeAnalysis.clangTidy.headerFilter": "${workspaceFolder}",
"C_Cpp.codeAnalysis.exclude": {
"lib/**": true
},
"C_Cpp.loggingLevel": "Debug",
"[jsonc]": {
"editor.formatOnSave": true
},
Expand Down Expand Up @@ -94,17 +105,6 @@
"wicg",
"xdescribe"
],
"C_Cpp.autoAddFileAssociations": false,
"C_Cpp.codeAnalysis.clangTidy.args": [
"--extra-arg-before=-target",
"--extra-arg-before=wasm32-unknown-emscripten"
],
"C_Cpp.codeAnalysis.clangTidy.enabled": true,
"C_Cpp.codeAnalysis.clangTidy.headerFilter": "${workspaceFolder}",
"C_Cpp.codeAnalysis.exclude": {
"lib/**": true
},
"C_Cpp.loggingLevel": "Debug",
"css.validate": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
Expand All @@ -122,9 +122,12 @@
"Pipfile": "Pipfile.lock, pyproject.toml, .pylintrc",
"README.md": "LICENSE.md, CONTRIBUTING.md",
"eslint.config.mjs": ".editorconfig, eslint-local-rules.js",
"package.json": "pnpm-lock.yaml, .npmrc, .browserslistrc",
"rsbuild.config.ts": "rsbuild.*.ts",
"makefile": ".clang-*"
"makefile": ".clang-*",
"package.json": "pnpm-lock.yaml, .npmrc, .browserslistrc"
},
"files.associations": {
"*.bps": "json",
".clang-*": "yaml"
},
"files.exclude": {
"**/debug.log": true,
Expand All @@ -133,7 +136,6 @@
"coverage": true,
"node_modules/": true,
"patches/": true,
"src/app/gen": true,
"test-results/": true
},
"i18n-ally.enabledFrameworks": [
Expand Down
34 changes: 0 additions & 34 deletions gulp/plugins/order.js

This file was deleted.

61 changes: 32 additions & 29 deletions gulp/tasks/locale.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
const gulp = require("gulp");
const through2 = require("gulp-through2");

const newer = require("../utils/newer");
const config = require("../config.json");
const order = require("../plugins/order");

function compile(t) {
if(t.includes("{")) {
t = t.replace(/\{(\d+)\}/g, "\",i(l($1)),\"");
return "({normalize:n,interpolate:i,list:l})=>n([\"" + t + "\"])";
}
return `_=>"${t}"`;
// For sorting the locale file entries to the same ordering as the source locale

function copyInOrderOf(source, order) {
if(typeof source != "object" || Array.isArray(source)) return source;
const result = {};
for(const key in order) result[key] = copyInOrderOf(source[key], order[key]);
return result;
}

function order(sourceName) {
let source;
return through2({
name: "locale-order",
filter: ".json",
transform(_, file) {
if(file.basename == sourceName) {
source = file;
return null;
}
},
flush(files) {
if(!source) return;
this.push(source);
source = JSON.parse(through2.read(source));
for(const file of files) {
const json = JSON.parse(through2.read(file));
const result = JSON.stringify(copyInOrderOf(json, source), null, "\t") + "\n";
through2.write(file, result);
}
},
});
};

gulp.task("locale", () => gulp.src(config.src.locale + "/*.json")
.pipe(newer({
dest: config.src.app + "/gen/locale.ts",
extra: [__filename, "../plugins/order.js"],
}))
.pipe(order("en.json"))
.pipe(gulp.dest(config.src.locale))
.pipe(through2({
transform: (content, file) => `"${file.stem.toLowerCase()}": ${content},`,
flush(files) {
let content = files
.map(f => through2.read(f))
.join("\n")
.replace(/"((?:[^"\\]|\\.)+)"(.)/gs, ($0, $1, $2) => {
if($2 == "]" || $2 == ":") return $0;
return compile($1) + $2;
});
content = `import type { BpsLocale } from "shared/frontend/locale";\n\nexport default {${content}} as Record<string, BpsLocale>;`;
through2.write(files[0], content);
files[0].basename = "locale.ts";
return [files[0]];
},
}))
.pipe(gulp.dest(config.src.app + "/gen")));
);
1 change: 0 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ require("./gulp/tasks/tool.js");
gulp.task("build", gulp.parallel(
"static",
"donate",
"locale",
"html"
));

Expand Down
2 changes: 1 addition & 1 deletion lib/bootstrap/loader.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function(content, map, meta) {
variables: true,
})
.then(result => {
callback(null, result[0].css, map, meta);
callback(null, result[0].css, undefined, meta);
})
.catch(err => callback(err));
};
19 changes: 19 additions & 0 deletions lib/locale.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

function compile(t) {
if(t.includes("{")) {
t = t.replace(/\{(\d+)\}/g, "\",i(l($1)),\"");
return "({normalize:n,interpolate:i,list:l})=>n([\"" + t + "\"])";
}
return `_=>"${t}"`;
}

/**
* Locale loader
* @type {import("@rspack/core").LoaderDefinitionFunction}
*/
export default function(content, map, meta) {
return "export default " + content.replace(/"((?:[^"\\]|\\.)+)"(.)/gs, ($0, $1, $2) => {
if($2 == "]" || $2 == ":") return $0;
return compile($1) + $2;
});
};
Binary file modified lib/optimizer/debug/optimizer.wasm
Binary file not shown.
Binary file modified lib/optimizer/dist/optimizer.wasm
Binary file not shown.
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "box-pleating-studio",
"version": "0.7.2",
"app_version": "1870",
"version": "0.7.3",
"app_version": "1872",
"description": "Super-complex origami design made easy!",
"keywords": [
"origami",
Expand Down Expand Up @@ -44,35 +44,36 @@
"@aaroon/workbox-rspack-plugin": "^0.3.2",
"@eslint/compat": "^1.2.4",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.16.0",
"@eslint/js": "^9.17.0",
"@intlify/vue-i18n-extensions": "^6.2.0",
"@mutsuntsai/esbuild-plugin-vue": "^0.1.6",
"@mutsuntsai/rsbuild-utils": "^1.0.1",
"@mutsuntsai/stylistic": "^1.0.3",
"@playwright/test": "^1.49.0",
"@rsbuild/core": "^1.1.8",
"@rsbuild/plugin-assets-retry": "^1.0.6",
"@rsbuild/plugin-check-syntax": "^1.1.0",
"@rsbuild/plugin-sass": "^1.1.1",
"@playwright/test": "^1.49.1",
"@rsbuild/core": "^1.1.10",
"@rsbuild/plugin-assets-retry": "^1.0.7",
"@rsbuild/plugin-check-syntax": "^1.2.0",
"@rsbuild/plugin-sass": "^1.1.2",
"@rsbuild/plugin-vue": "^1.0.5",
"@rsdoctor/rspack-plugin": "^0.4.11",
"@swc/core": "^1.10.0",
"@rsdoctor/rspack-plugin": "^0.4.12",
"@swc/core": "^1.10.1",
"@types/bootstrap": "^5.2.10",
"@types/chai": "^5.0.1",
"@types/emscripten": "^1.39.13",
"@types/gtag.js": "^0.0.20",
"@types/gulp": "^4.0.17",
"@types/mocha": "^10.0.10",
"@types/node": "^22.10.1",
"@types/node": "^22.10.2",
"@types/wicg-file-system-access": "^2023.10.5",
"chai": "^5.1.2",
"del": "^8.0.0",
"esbuild": "^0.24.0",
"eslint": "^9.16.0",
"eslint": "^9.17.0",
"eslint-import-resolver-typescript": "^3.7.0",
"eslint-plugin-compat": "^6.0.1",
"eslint-plugin-compat": "^6.0.2",
"eslint-plugin-html": "^8.1.2",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsdoc": "^50.6.0",
"eslint-plugin-jsdoc": "^50.6.1",
"eslint-plugin-mocha": "^10.5.0",
"eslint-plugin-typescript-compat": "^1.0.2",
"eslint-plugin-vue": "^9.32.0",
Expand All @@ -82,7 +83,7 @@
"globals": "^15.13.0",
"gulp": "^5.0.0",
"gulp-all": "^1.1.0",
"gulp-esbuild": "^0.13.0",
"gulp-esbuild": "^0.14.0",
"gulp-fontawesome": "^1.0.4",
"gulp-html-minifier-terser": "^7.1.0",
"gulp-if": "^3.0.0",
Expand All @@ -91,16 +92,16 @@
"gulp-vue-ssg": "^1.2.4",
"html-minifier-loader": "^1.4.1",
"ifdef-loader": "^2.3.2",
"inquirer": "^12.1.0",
"inquirer": "^12.2.0",
"jsdom": "^25.0.1",
"markdown-loader": "^8.0.0",
"mocha": "^11.0.1",
"mocha-suppress-logs": "^0.5.1",
"nyc": "^17.1.0",
"postcss-preset-env": "^10.1.1",
"postcss-preset-env": "^10.1.2",
"purgecss": "^7.0.2",
"scheduler-polyfill": "^1.3.0",
"stylelint": "^16.11.0",
"stylelint": "^16.12.0",
"stylelint-config-clean-order": "^6.1.0",
"stylelint-config-recommended-vue": "^1.5.0",
"stylelint-config-standard-scss": "^14.0.0",
Expand All @@ -109,14 +110,13 @@
"tsconfig-paths": "^4.2.0",
"ttf2woff2": "^6.0.1",
"typescript": "^5.7.2",
"typescript-eslint": "^8.17.0",
"typescript-eslint": "^8.18.1",
"vinyl-ftp": "^0.6.1",
"vue-eslint-parser": "^9.4.3",
"yaml": "^2.6.1",
"yargs": "^17.7.2"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^6.7.1",
"@fortawesome/fontawesome-free": "^6.7.2",
"@paypal/paypal-js": "^8.1.2",
"@pixi/core": "^7.4.2",
"@pixi/events": "^7.4.2",
Expand Down
Loading

0 comments on commit c4de89e

Please sign in to comment.