-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
60 lines (60 loc) · 4.78 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
"name": "getargv-gh-pages",
"homepage": "https://getargv.narzt.cam",
"repository": {
"type": "git",
"url": "https://github.com/CamJN/getargv.git"
},
"funding": {
"type": "github",
"url": "https://github.com/CamJN"
},
"version": "0.23.0",
"description": "Marketing site for getargv",
"main": "build.mjs",
"scripts": {
"prestart": "npm run html",
"start": "(trap 'kill 0' SIGINT; node watch.mjs & /usr/bin/python3 -m http.server --directory ./docs/ 0)",
"build": "npm run js && npm run css && npm run html && npm run mandoc1 && npm run mandoc3",
"postbuild": "mkdir -p docs",
"css": "sass --style compressed assets/sass/main.scss:assets/css/main.css assets/sass/noscript.scss:assets/css/noscript.css assets/sass/mandoc_inject.scss:assets/css/mandoc_inject.css",
"prejs": "rm -f assets/js/* && tsc",
"js": "for file in assets/js/*.js; do uglifyjs --compress --mangle --source-map \"url='/${file/.js/.min.js}.map',content='${file}.map',filename='${file/.js/.min.js}.map'\" --output \"${file/.js/.min.js}\" -- \"$file\"; done",
"prehtml": "npm run stats && npm run projects && npm run license && npm run changelog",
"html": "for file in src/*-body.html; do node build.mjs \"$file\" > ${file%-body.html}.html ; done",
"prechangelog": "echo '<pre class=\"changelog\">' > src/changelog-body.html",
"changelog": "git log master --oneline | awk '{a=$1;$1=\"\";print \"<a href=\\\"https://github.com/CamJN/getargv/commit/\"a\"\\\">\"a\"</a>\"$0}' >> src/changelog-body.html",
"postchangelog": "echo '</pre>' >> src/changelog-body.html",
"projects": "fgrep '<li>' src/hallofshame-body.html | wc -l > src/projects.html",
"stats": "printf 'scale=3; %d / %d\\n' `git show master:test/src/unit_tests.c master:test/src/unit_tests.h master:test/src/common_unit_test.c master:test/src/common_unit_test.h | wc -l` `git show master:src/getargv.c master:src/getargv.h | wc -l` | /usr/bin/bc > src/stats.html",
"premandoc1": "npm run css",
"mandoc1": "git show master:man/getargv.1 | mandoc -T html -O 'style=assets/css/mandoc.css,man=x-man-page://%S/%N' > src/man1.html",
"postmandoc1": "/usr/bin/curl -sSL https://mandoc.bsd.lv/snapshots/mandoc.tar.gz | /usr/bin/tar -x --strip-components=1 --include='*mandoc.css' --to-stdout --file - | cat - assets/css/mandoc_inject.css > assets/css/mandoc.css",
"postmandoc3": "npm run postmandoc1",
"mandoc3": "git show master:man/libgetargv.3 | mandoc -T html -O 'style=assets/css/mandoc.css,man=x-man-page://%S/%N' > src/man3.html",
"prelicense": "echo '<pre>' > src/license-body.html",
"license": "git show master:LICENSE | sed -e 's/</\\</g' -e 's/>/\\>/g' >> src/license-body.html",
"postlicense": "echo '</pre>' >> src/license-body.html",
"presitemap": "echo \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\n<?xml-stylesheet type=\\\"text/xsl\\\" href=\\\"assets/sitemap.xsl\\\" ?>\n<urlset xmlns=\\\"http://www.sitemaps.org/schemas/sitemap/0.9\\\">\" > docs/sitemap.xml",
"sitemap": "find docs -name '*.html' \\! \\( -name index.html -o -path node_modules \\) | sed -Ee 's|docs/(.+)|<url><loc>https://getargv.narzt.cam/\\1</loc></url>|g' >> docs/sitemap.xml",
"postsitemap": "echo '</urlset>' >> docs/sitemap.xml",
"clean": "sed -e 's|^/||g' .gitignore | xargs rm -rf",
"predeploy": "npm run build",
"deploy": "find src -name '*.html' \\! \\( -path 'node_modules' -o -name '*-body.html' -o -name '*-sidebar.html' -o -name 'template.html' -o -name '*-blurb.html' \\) -depth 1 -exec fgrep -l '<html' {} \\; | xargs -J {} cp -r {} assets docs && rm -rf docs/assets/sass docs/assets/ts docs/assets/images/Full-Res $(find docs/assets/ -name '*.map' -o -name '*_inject.css' -o \\( -name '*.js' \\! -name '*.min.js' \\))",
"postdeploy": "npm run sitemap",
"prerelease": "npm version minor --no-git-tag-version",
"release": "git commit --all --amend --no-edit",
"postrelease": "echo \"web$(node -e 'console.log(require(process.env.npm_package_json).version);')\" | xargs -I {} git tag -s -m {} {}",
"images": "awk '/: +\\( [^)]+px +\\),/{gsub(/px/,\"\");print $4}' assets/sass/main.scss | awk '{print int($0*0.60) \"\\n\" int($0*0.92) \"\\n\" $0}' | while read res; do for file in images/Full-Res/*.{png,jpg} ; do sips --resampleWidth $res $file -o ${file%.*}.$res.${file##*.}; done ; done",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Camden Narzt",
"license": "SEE LICENSE IN LICENSE.txt",
"dependencies": {
"@tsconfig/recommended": "^1.0.3",
"chokidar": "^3.5.3",
"sass": "^1.69.5",
"typescript": "^5.3.2",
"uglify-js": "^3.17.4"
}
}