Skip to content

Commit

Permalink
fix: minify json assets via @aminya/minijson
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Sep 7, 2024
1 parent cb3bbf1 commit d54a821
Show file tree
Hide file tree
Showing 13 changed files with 717 additions and 145 deletions.
18 changes: 1 addition & 17 deletions dist/legacy/gcc_matcher.json
Original file line number Diff line number Diff line change
@@ -1,17 +1 @@
{
"problemMatcher": [
{
"owner": "gcc",
"pattern": [
{
"regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
]
}
]
}
{"problemMatcher":[{"owner":"gcc","pattern":[{"regexp":"^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$","file":1,"line":2,"column":3,"severity":4,"message":5}]}]}
18 changes: 1 addition & 17 deletions dist/legacy/llvm_matcher.json
Original file line number Diff line number Diff line change
@@ -1,17 +1 @@
{
"problemMatcher": [
{
"owner": "llvm",
"pattern": [
{
"regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
]
}
]
}
{"problemMatcher":[{"owner":"llvm","pattern":[{"regexp":"^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$","file":1,"line":2,"column":3,"severity":4,"message":5}]}]}
19 changes: 1 addition & 18 deletions dist/legacy/msvc_matcher.json
Original file line number Diff line number Diff line change
@@ -1,18 +1 @@
{
"problemMatcher": [
{
"owner": "msvc",
"pattern": [
{
"regexp": "^(?:\\s+\\d+>)?(\\S.*)\\((\\d+),?(\\d+)?(?:,\\d+,\\d+)?\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"code": 5,
"message": 6
}
]
}
]
}
{"problemMatcher":[{"owner":"msvc","pattern":[{"regexp":"^(?:\\s+\\d+>)?(\\S.*)\\((\\d+),?(\\d+)?(?:,\\d+,\\d+)?\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$","file":1,"line":2,"column":3,"severity":4,"code":5,"message":6}]}]}
19 changes: 1 addition & 18 deletions dist/legacy/python_matcher.json
Original file line number Diff line number Diff line change
@@ -1,18 +1 @@
{
"problemMatcher": [
{
"owner": "python",
"pattern": [
{
"regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)$",
"file": 1,
"line": 2
},
{
"regexp": "^\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$",
"message": 2
}
]
}
]
}
{"problemMatcher":[{"owner":"python","pattern":[{"regexp":"^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)$","file":1,"line":2},{"regexp":"^\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$","message":2}]}]}
18 changes: 1 addition & 17 deletions dist/modern/gcc_matcher.json
Original file line number Diff line number Diff line change
@@ -1,17 +1 @@
{
"problemMatcher": [
{
"owner": "gcc",
"pattern": [
{
"regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
]
}
]
}
{"problemMatcher":[{"owner":"gcc","pattern":[{"regexp":"^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$","file":1,"line":2,"column":3,"severity":4,"message":5}]}]}
18 changes: 1 addition & 17 deletions dist/modern/llvm_matcher.json
Original file line number Diff line number Diff line change
@@ -1,17 +1 @@
{
"problemMatcher": [
{
"owner": "llvm",
"pattern": [
{
"regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
]
}
]
}
{"problemMatcher":[{"owner":"llvm","pattern":[{"regexp":"^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$","file":1,"line":2,"column":3,"severity":4,"message":5}]}]}
19 changes: 1 addition & 18 deletions dist/modern/msvc_matcher.json
Original file line number Diff line number Diff line change
@@ -1,18 +1 @@
{
"problemMatcher": [
{
"owner": "msvc",
"pattern": [
{
"regexp": "^(?:\\s+\\d+>)?(\\S.*)\\((\\d+),?(\\d+)?(?:,\\d+,\\d+)?\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"code": 5,
"message": 6
}
]
}
]
}
{"problemMatcher":[{"owner":"msvc","pattern":[{"regexp":"^(?:\\s+\\d+>)?(\\S.*)\\((\\d+),?(\\d+)?(?:,\\d+,\\d+)?\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$","file":1,"line":2,"column":3,"severity":4,"code":5,"message":6}]}]}
19 changes: 1 addition & 18 deletions dist/modern/python_matcher.json
Original file line number Diff line number Diff line change
@@ -1,18 +1 @@
{
"problemMatcher": [
{
"owner": "python",
"pattern": [
{
"regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)$",
"file": 1,
"line": 2
},
{
"regexp": "^\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$",
"message": 2
}
]
}
]
}
{"problemMatcher":[{"owner":"python","pattern":[{"regexp":"^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)$","file":1,"line":2},{"regexp":"^\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$","message":2}]}]}
1 change: 0 additions & 1 deletion dprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"./.cache/",
"**/build",
"**/dist",
"**/github_brechtsanders_winlibs_mingw.json",
"dev/cpp_vcpkg_project"
],
"plugins": [
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
"tsconfig.json"
],
"scripts": {
"build": "turbo build && run-p lint.root.tsc build.vite build.vite.legacy && run-p copy.json",
"build": "turbo build && run-p lint.root.tsc build.vite build.vite.legacy && run-s build.json",
"build.vite": "cross-env NODE_ENV=production vite build",
"build.vite.legacy": "cross-env NODE_ENV=production TARGET=legacy vite build",
"build.json": "shx cp ./src/*/*.json ./dist/legacy/ && shx cp ./dist/legacy/*.json ./dist/modern && minijson --file ./dist/**/*.json",
"bump": "ncu -u -x numerous,execa,prettier,@types/node,eslint,@types/eslint && pnpm update && pnpx typesync && pnpm run clean",
"clean": "shx rm -rf ./dist ./packages/*/dist ./exe ./.parcel-cache && shx mkdir -p ./dist/legacy ./dist/modern ./dist/modern ",
"copy.json": "shx cp ./src/*/*.json ./dist/legacy/ && shx cp ./dist/legacy/*.json ./dist/modern",
"dev.vite": "cross-env NODE_ENV=development vite build --watch",
"dev.packages": "turbo dev",
"dev": "run-p dev.packages dev.vite",
Expand Down Expand Up @@ -59,6 +59,7 @@
"@actions/http-client": "^2.2.3",
"@actions/io": "^1.1.3",
"@actions/tool-cache": "^2.0.1",
"@aminya/minijson": "1.0.3",
"@babel/core": "^7.25.2",
"@biomejs/biome": "^1.8.3",
"@iarna/toml": "^2.2.5",
Expand Down
17 changes: 17 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

689 changes: 688 additions & 1 deletion src/gcc/github_brechtsanders_winlibs_mingw.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/utils/github/fetch-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export async function saveGitHubAssetList(
const jsonStringify = JsonStringify.configure({
deterministic: compareVersion,
})
const data = jsonStringify(assets)
const data = jsonStringify(assets, null, 2)

// write the assets to a json file
await writeFile(path, data)
Expand Down

0 comments on commit d54a821

Please sign in to comment.