Skip to content

Commit f3a98f6

Browse files
committed
refactor: regenerate assets
1 parent 96beaab commit f3a98f6

29 files changed

+621
-1337
lines changed

.codecov.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
codecov:
2+
branch: master
13
coverage:
24
range: '75...100'
35
status:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ tmp
2020

2121
# Ignore packaged files that probably shouldn't be committed
2222
*.tgz
23+
*.tar.gz
2324

2425
# Ignore relevant build artifacts in any subdir (with exceptions)
2526
*.tsbuildinfo
@@ -41,7 +42,6 @@ bower_components
4142
build/Release
4243
.vercel
4344
.next
44-
.turbo
4545
next-env.d.ts
4646

4747
# Ignore cloned GitHub wiki (do not regard it as a so-called "submodule")

.husky/commit-msg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
# TODO: make this work natively on Windows
3+
# TODO: replace these uglies with JS (mjs) scripts
44

55
beginswith() { case $2 in "$1"*) true;; *) false;; esac; }
66

@@ -10,7 +10,7 @@ if beginswith 'rebase' "$GIT_REFLOG_ACTION"; then
1010
fi
1111

1212
NODE_NO_WARNINGS=1 commitlint -e
13-
if [ -z "$GAC_VERIFY_SIMPLE" ]; then npm run test; fi
13+
if [ -z "$GAC_VERIFY_SIMPLE" ]; then npm run test:packages:all:unit; fi
1414
# TODO: bring back spellchecker:
1515
#echo
1616
#NODE_NO_WARNINGS=1 node spellcheck-commit.cjs

.husky/pre-commit

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
# TODO: make this work natively on Windows
3+
# TODO: replace these uglies with JS (mjs) scripts
44

55
beginswith() { case $2 in "$1"*) true;; *) false;; esac; }
66

@@ -10,4 +10,5 @@ if beginswith 'rebase' "$GIT_REFLOG_ACTION"; then
1010
fi
1111

1212
if [ -z "$GAC_VERIFY_SIMPLE" ]; then npm run lint:package; fi
13-
NODE_NO_WARNINGS=1 lint-staged --concurrent false
13+
NODE_NO_WARNINGS=1 lint-staged --concurrent false --config lint-staged.config.mjs
14+
symbiote clean --env NODE_NO_WARNINGS=1 --only-empty-directories --hush --scope unlimited

.husky/pre-push

Lines changed: 70 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,87 @@
11
#!/bin/sh
22

3-
# TODO: make this work natively on Windows
3+
# TODO: replace these uglies with JS (mjs) scripts
44

55
beginswith() { case $2 in "$1"*) true;; *) false;; esac; }
6+
prepend() { while read -r line; do echo "${1}${line}"; done; }
67

78
if beginswith 'rebase' "$GIT_REFLOG_ACTION"; then
8-
echo 'husky-hook::pre-push: pushing commits in the middle of a rebase is not allowed!'
9+
echo 'husky-hook::pre-push: pushing commits in the middle of a rebase/merge/cherry-pick is not allowed!'
910
exit 1
1011
fi
1112

1213
echo 'husky-hook::pre-push: checking for commits that should not be pushed...'
14+
1315
log=$(git log HEAD --oneline --not --remotes)
1416

15-
# ? Make sure no commits to be pushed contain "mergeme" in their headers
16-
if echo "$log" | grep -q -i -e 'mergeme' -e '\[WIP\]' -e '\[NOPUSH\]'; then
17+
set +e
18+
19+
incompleteCommitsGrep=$(echo "$log" | grep -q -i -e 'mergeme' -e '\[WIP\]' -e '\[NOPUSH\]'; echo $?)
20+
21+
# ? In the below lines, 'x' is passed as the "zero parameter" so "$@" spits out
22+
# ? the right stuff. Stuff like this won't be an issue when we switch this to JS
23+
24+
interestingXxxFiles=$(git ls-tree -r --full-tree --name-only HEAD | grep -vE '(^|/)(\.husky|assets/templates/husky)/' | grep -vE '\.snap$')
25+
26+
incompleteXxxFilesGrep=$(echo "$interestingXxxFiles" | xargs -d '\n' -P 0 sh -c 'if grep -q -F -e "XXX: " "$@"; then exit 255; else true; fi' 'x' 1>/dev/null 2>&1; echo $?)
27+
28+
interestingPackageJsonFiles=$(echo "$interestingXxxFiles" | grep -E '^(packages/[^/]+/)?package\.json$')
29+
30+
incompletePackageJsonFilesGrep=$(echo "$interestingPackageJsonFiles" | xargs -d '\n' -P 0 sh -c 'if grep -q -i -P -e "--assets-preset [^\x22]*?(\x27|((basic|cli|lib|react|nextjs) [^\x22]*){3})" "$@"; then exit 255; else true; fi' 'x' 1>/dev/null 2>&1; echo $?)
31+
32+
interestingMdFiles=$(echo "$interestingXxxFiles" | grep '\.md$' | grep -vE '(^|/)(src|test|docs)/' | grep -vE '/CHANGELOG.md$')
33+
34+
incompleteMdFilesGrep=$(echo "$interestingMdFiles" | xargs -d '\n' -P 0 sh -c 'if grep -q -i -F -e "-✄-" "$@"; then exit 255; else true; fi' 'x' 1>/dev/null 2>&1; echo $?)
35+
36+
interestingTestFiles=$(echo "$interestingXxxFiles" | grep '\.test\.ts$')
37+
38+
incompleteTestFilesGrep=$(echo "$interestingTestFiles" | xargs -d '\n' -P 0 sh -c 'if grep -q -i -E -e "(it|test|describe)\.only\(" "$@"; then exit 255; else true; fi' 'x' 1>/dev/null 2>&1; echo $?)
39+
40+
set -e
41+
42+
# ? Make sure no commits to be pushed contain "mergeme" etc in their headers, no
43+
# ? relevant markdown files contain "-✄-" in their contents, no files anywhere
44+
# ? anywhere contain "XXX: " in their contents, no test files contain
45+
# ? erroneously focused tests, and no package.json files have incomplete scripts
46+
if [ "$incompleteCommitsGrep" = 0 ] || [ "$incompleteMdFilesGrep" != 0 ] || [ "$incompleteXxxFilesGrep" != 0 ] || [ "$incompleteTestFilesGrep" != 0 ] || [ "$incompletePackageJsonFilesGrep" != 0 ]; then
1747
echo 'husky-hook::pre-push: BAD COMMIT(S) DETECTED!'
1848
echo 'husky-hook::pre-push: merge, delete, reword, or otherwise rectify the following commits before trying again:'
19-
echo
20-
echo "$log" | grep -i -e 'mergeme' -e '\[WIP\]' -e '\[NOPUSH\]'
49+
50+
if [ "$incompleteCommitsGrep" = 0 ]; then
51+
echo
52+
echo 'husky-hook::pre-push: incomplete commits (e.g. WIP, mergeme, NOPUSH):'
53+
echo
54+
echo "$log" | grep -i -e 'mergeme' -e '\[WIP\]' -e '\[NOPUSH\]' | prepend ''
55+
fi
56+
57+
if [ "$incompleteMdFilesGrep" != 0 ]; then
58+
echo
59+
echo 'husky-hook::pre-push: markdown files at HEAD with unmerged replacer regions:'
60+
echo
61+
echo "$interestingMdFiles" | xargs -d '\n' -P 0 grep -i -l -H -F -e '-✄-' | prepend ''
62+
fi
63+
64+
if [ "$incompleteXxxFilesGrep" != 0 ]; then
65+
echo
66+
echo 'husky-hook::pre-push: files at HEAD with "XXX" error comments:'
67+
echo
68+
echo "$interestingXxxFiles" | xargs -d '\n' -P 0 grep -l -H -F -e 'XXX: ' | prepend ''
69+
fi
70+
71+
if [ "$incompleteTestFilesGrep" != 0 ]; then
72+
echo
73+
echo 'husky-hook::pre-push: files at HEAD with erroneously focused tests:'
74+
echo
75+
echo "$interestingTestFiles" | xargs -d '\n' -P 0 grep -i -l -H -E -e '(it|test|describe)\.only\(' | prepend ''
76+
fi
77+
78+
if [ "$incompletePackageJsonFilesGrep" != 0 ]; then
79+
echo
80+
echo 'husky-hook::pre-push: package.json files at HEAD with incomplete scripts:'
81+
echo
82+
echo "$interestingPackageJsonFiles" | xargs -d '\n' -P 0 grep -i -l -H -P -e "--assets-preset [^\x22]*?(\x27|((basic|cli|lib|react|nextjs) [^\x22]*){3})" | prepend ''
83+
fi
84+
2185
echo
2286
exit 2;
2387
else

.ncurc.cjs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
// @ts-check
22
'use strict';
33

4-
// TODO: publish latest rejoinder package first, then update configs to use it
5-
//const { createDebugLogger } = require('rejoinder');
4+
const { createDebugLogger } = require('rejoinder');
65

7-
/*const debug = createDebugLogger({ namespace: 'symbiote:config:ncurc' });*/
6+
const debug = createDebugLogger({ namespace: 'symbiote:config:ncurc' });
87

98
// * https://www.npmjs.com/package/npm-check-updates#configuration-files
109
module.exports = {
@@ -15,4 +14,4 @@ module.exports = {
1514
]
1615
};
1716

18-
/*debug('exported config: %O', module.exports);*/
17+
debug('exported config: %O', module.exports);

.prettierignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ ignore.*
3030
**/build/**
3131
# ? This negation must end in "/**" to be interpreted properly.
3232
!**/src/**/build/**
33-
docs
33+
# ? Preceding AND proceeding asterisks (**) are needed to match any docs subdir
34+
# ? in monorepos and allow subsequent negations to be interpreted properly.
35+
**/docs/**
36+
# ? This negation must end in "/**" to be interpreted properly.
37+
!**/src/**/docs/**
3438
dist
3539
coverage
3640
.vercel
@@ -45,7 +49,8 @@ node_modules
4549
package-lock.json
4650

4751
# Ignore test fixtures in any subdir (which may depend on remaining as they are)
48-
fixtures
52+
# ? This must end in "/**" to be interpreted properly.
53+
**/test/**/fixtures/**
4954
__*__
5055

5156
# Ignore things that prettier isn't good at in any subdir

.remarkrc.mjs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22

33
import { deepMergeConfig } from '@-xun/symbiote/assets';
44
import { assertEnvironment, moduleExport } from '@-xun/symbiote/assets/.remarkrc.mjs';
5+
import { createDebugLogger } from 'rejoinder';
56

6-
// TODO: publish latest rejoinder package first, then update configs to use it
7-
//import { createDebugLogger } from 'rejoinder';
8-
9-
/*const debug = createDebugLogger({ namespace: 'symbiote:config:remarkrc' });*/
7+
const debug = createDebugLogger({ namespace: 'symbiote:config:remarkrc' });
108

119
const config = deepMergeConfig(moduleExport(await assertEnvironment()), {
1210
// Any custom configs here will be deep merged with moduleExport
1311
});
1412

1513
export default config;
1614

17-
/*debug('exported config: %O', config);*/
15+
debug('exported config: %O', config);

.vscode/launch.example.json

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -25,78 +25,6 @@
2525
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
2626
},
2727

28-
// ! Note that these settings do NOT affect MANUALLY LAUNCHED debug
29-
// ! terminals! To affect stepping while using the debug terminal
30-
// ! manually, you'll need to configure settings.json (non-workspace) or
31-
// ! *.code-workspace (workspace) and set
32-
// ! `debug.javascript.terminalOptions.skipFiles/smartStep` appropriately.
33-
// * You MAY need to reload vscode/vscode-jest before changes take effect!
34-
// ? Set to false to step through node internals
35-
"smartStep": true,
36-
// ? Selectively comment out entries for deeper debugging
37-
"skipFiles": [
38-
"<node_internals>/**",
39-
"**/node_modules/**"
40-
41-
//"!**/node_modules/*jest*/**"
42-
//"!**/node_modules/@-xun/**"
43-
]
44-
},
45-
{
46-
"type": "node",
47-
"name": "jest-active-file",
48-
"request": "launch",
49-
"program": "${workspaceFolder}/node_modules/.bin/jest",
50-
"args": ["--runInBand", "--watchAll=false", "${file}"],
51-
"cwd": "${workspaceFolder}",
52-
"console": "integratedTerminal",
53-
"internalConsoleOptions": "neverOpen",
54-
"env": {
55-
"NODE_ENV": "test",
56-
"NODE_OPTIONS": "--no-warnings --experimental-vm-modules",
57-
"DEBUG_COLORS": "false"
58-
},
59-
"windows": {
60-
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
61-
},
62-
63-
// ! Note that these settings do NOT affect MANUALLY LAUNCHED debug
64-
// ! terminals! To affect stepping while using the debug terminal
65-
// ! manually, you'll need to configure settings.json (non-workspace) or
66-
// ! *.code-workspace (workspace) and set
67-
// ! `debug.javascript.terminalOptions.skipFiles/smartStep` appropriately.
68-
// * You MAY need to reload vscode/vscode-jest before changes take effect!
69-
// ? Set to false to step through node internals
70-
"smartStep": true,
71-
// ? Selectively comment out entries for deeper debugging
72-
"skipFiles": [
73-
"<node_internals>/**",
74-
"**/node_modules/**"
75-
76-
//"!**/node_modules/*jest*/**"
77-
//"!**/node_modules/@-xun/**"
78-
]
79-
},
80-
{
81-
"type": "node",
82-
"name": "jest-transpiled",
83-
"request": "launch",
84-
"program": "${workspaceFolder}/node_modules/.bin/jest",
85-
"args": ["--runInBand", "--watchAll=false", "${file}"],
86-
"cwd": "${workspaceFolder}",
87-
"console": "integratedTerminal",
88-
"internalConsoleOptions": "neverOpen",
89-
"sourceMaps": false,
90-
"env": {
91-
"NODE_ENV": "test",
92-
"NODE_OPTIONS": "--no-warnings --experimental-vm-modules",
93-
"DEBUG_COLORS": "false",
94-
"SYMBIOTE_TEST_JEST_TRANSPILED": "true"
95-
},
96-
"windows": {
97-
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
98-
},
99-
10028
// ! Note that these settings do NOT affect MANUALLY LAUNCHED debug
10129
// ! terminals! To affect stepping while using the debug terminal
10230
// ! manually, you'll need to configure settings.json (non-workspace) or

ARCHITECTURE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ document.
1313

1414
---
1515

16+
<br />
17+
1618
<!-- symbiote-template-region-end -->
1719

1820
There are as of yet no notable deviations or additions. See the linked document

0 commit comments

Comments
 (0)