-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ['monoculture'], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# cabal | ||
|
||
![dependencies via madge](./graph.svg) | ||
|
||
Useful tooling for Sets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { curry } from 'ramda' | ||
|
||
export const hasOrAdd = curry(function _hasOrAdd(set, x) { | ||
const had = set.has(x) | ||
if (!had) { | ||
set.add(x) | ||
} | ||
return had | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const config = require('../../shared/jest-config/jest.config') | ||
module.exports = { | ||
...config, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const PKG = require('./package.json') | ||
const sd = (script, description = '') => | ||
!!description ? { script, description } : { script } | ||
|
||
module.exports = { | ||
scripts: { | ||
autotest: { | ||
...sd( | ||
'nps -c ./package-scripts.cjs autotest.rebuild test', | ||
'rebuild and test autotests' | ||
), | ||
rebuild: sd( | ||
`drgen -i ${['./cabal.js'].join( | ||
' ' | ||
)} -o autotests --processor doctor-general-jest`, | ||
'generate tests with `doctor-general`!' | ||
), | ||
}, | ||
clean: sd('rm -r dist', 'clean the build!'), | ||
lint: sd('eslint --fix .', 'lint!'), | ||
test: { | ||
...sd('jest --coverage --verbose', 'test!'), | ||
silent: sd( | ||
'jest --silent --reporters=jest-silent-reporter --coverageReporters=none', | ||
'test, quietly.' | ||
), | ||
ci: sd( | ||
'jest --ci --json --coverage --testLocationInResults --outputFile=ci-report.json', | ||
'test for CI!' | ||
), | ||
watch: sd('jest --watch', 'test with watch-mode!'), | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"name": "cabal", | ||
"version": "0.0.1", | ||
"description": "tooling for Sets 🍽️", | ||
"main": "cabal.js", | ||
"type": "module", | ||
"repository": "brekk/monoculture", | ||
"author": "brekk", | ||
"license": "ISC", | ||
"private": true, | ||
"exports": { | ||
".": "./cabal.js" | ||
}, | ||
"dependencies": { | ||
"envtrace": "0.0.2", | ||
"fluture": "14.0.0", | ||
"ramda": "0.29.1" | ||
}, | ||
"devDependencies": { | ||
"@testing-library/jest-dom": "6.1.5", | ||
"dotenv-cli": "7.3.0", | ||
"eslint-config-monoculture": "workspace:shared/eslint-config-monoculture", | ||
"jest": "29.7.0", | ||
"jest-config": "workspace:shared/jest-config", | ||
"nps": "^5.10.0" | ||
}, | ||
"scripts": { | ||
"nps": "dotenv -- nps -c ./package-scripts.cjs", | ||
"autotest": "dotenv -- nps -c ./package-scripts.cjs autotest", | ||
"autotest:rebuild": "dotenv -- nps -c ./package-scripts.cjs autotest.rebuild", | ||
"clean": "dotenv -- nps -c ./package-scripts.cjs clean", | ||
"lint": "dotenv -- nps -c ./package-scripts.cjs lint", | ||
"test": "dotenv -- nps -c ./package-scripts.cjs test", | ||
"test:ci": "dotenv -- nps -c ./package-scripts.cjs test.ci", | ||
"test:silent": "dotenv -- nps -c ./package-scripts.cjs test.silent", | ||
"test:watch": "dotenv -- nps -c ./package-scripts.cjs test.watch" | ||
} | ||
} |