├── .editorconfig
├── .gitignore
├── .prettierignore
├── @packages
├── all-module-paths
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── docs
│ │ └── src
│ │ │ ├── index.md
│ │ │ └── main.md
│ ├── package.json
│ ├── src
│ │ ├── index.js
│ │ └── main.js
│ └── test
│ │ └── index.js
├── babel-preset-optimise
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── docs
│ │ └── src
│ │ │ └── index.md
│ ├── package.json
│ ├── src
│ │ └── index.js
│ └── test
│ │ └── index.js
├── gitclone-cli
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── docs
│ │ └── src
│ │ │ ├── cli.md
│ │ │ └── index.md
│ ├── package.json
│ └── src
│ │ ├── cli.js
│ │ └── index.js
├── gitclone-defaults
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── docs
│ │ └── src
│ │ │ └── index.md
│ ├── package.json
│ ├── src
│ │ └── index.js
│ └── test
│ │ └── index.js
├── glob-cache
│ ├── .verb.logo.md
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── LICENSE.md
│ ├── README.md
│ ├── docs
│ │ └── src
│ │ │ └── index.md
│ ├── logo.png
│ ├── package.json
│ ├── src
│ │ └── index.js
│ └── test
│ │ ├── fixtures
│ │ ├── .gitkeep
│ │ ├── bar.js
│ │ └── big.js
│ │ └── index.js
├── jest-runner-docs
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── docs
│ │ └── src
│ │ │ ├── docks.md
│ │ │ ├── index.md
│ │ │ └── runner.md
│ ├── package.json
│ ├── src
│ │ ├── docks.js
│ │ ├── index.js
│ │ └── runner.js
│ └── test
│ │ └── index.js
├── jest-runner-node
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── docs
│ │ └── src
│ │ │ ├── config.md
│ │ │ ├── index.md
│ │ │ ├── require-module.md
│ │ │ └── runner.md
│ ├── foo.js
│ ├── package.json
│ ├── src
│ │ ├── config.js
│ │ ├── index.js
│ │ ├── require-module.js
│ │ └── runner.js
│ └── test
│ │ └── index.js
├── jest-runner-rollup
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── docs
│ │ └── src
│ │ │ ├── index.md
│ │ │ └── runner.md
│ ├── package.json
│ ├── src
│ │ ├── index.js
│ │ └── runner.js
│ └── test
│ │ └── index.js
├── koa-better-body
│ ├── .verb.head.md
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── docs
│ │ └── src
│ │ │ ├── index.md
│ │ │ └── utils.md
│ ├── example.js
│ ├── package.json
│ ├── recipes
│ │ ├── form
│ │ │ └── index.js
│ │ ├── formidable
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── uploads
│ │ │ │ └── .gitkeep
│ │ └── multipart
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── uploads
│ │ │ └── .gitkeep
│ ├── src
│ │ ├── index.js
│ │ └── utils.js
│ └── test
│ │ ├── buffer.js
│ │ ├── custom.js
│ │ ├── json.js
│ │ ├── multipart.js
│ │ ├── options.js
│ │ ├── text.js
│ │ └── urlencoded.js
├── parse-commit-message
│ ├── .eslintignore
│ ├── .eslintrc.cjs
│ ├── .github
│ │ └── workflows
│ │ │ └── ci.yml
│ ├── .prettierignore
│ ├── .prettierrc.cjs
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── bun.lockb
│ ├── cjs-dts-files.ts
│ ├── docs
│ │ └── src
│ │ │ ├── commit.md
│ │ │ ├── header.md
│ │ │ ├── index.md
│ │ │ ├── main.md
│ │ │ ├── plugins
│ │ │ ├── increment.md
│ │ │ ├── is-breaking-change.md
│ │ │ └── mentions.md
│ │ │ └── utils.md
│ ├── example.cjs
│ ├── package.json
│ ├── src
│ │ ├── commit.ts
│ │ ├── header.ts
│ │ ├── index.ts
│ │ ├── main.ts
│ │ ├── plugins
│ │ │ ├── increment.ts
│ │ │ ├── is-breaking-change.ts
│ │ │ └── mentions.ts
│ │ ├── types.ts
│ │ └── utils.ts
│ ├── test
│ │ └── header
│ │ │ ├── check.ts
│ │ │ ├── parse.ts
│ │ │ ├── stringify.ts
│ │ │ └── validate.ts
│ ├── tsconfig.json
│ └── tsup.config.ts
├── parse-function
│ ├── .verb.head.md
│ ├── .verb.logo.md
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── docs
│ │ └── src
│ │ │ ├── index.md
│ │ │ ├── plugins
│ │ │ ├── body.md
│ │ │ ├── initial.md
│ │ │ ├── params.md
│ │ │ └── props.md
│ │ │ └── utils.md
│ ├── package.json
│ ├── src
│ │ ├── index.js
│ │ ├── plugins
│ │ │ ├── body.js
│ │ │ ├── initial.js
│ │ │ ├── params.js
│ │ │ └── props.js
│ │ └── utils.js
│ └── test
│ │ ├── __snapshots__
│ │ └── index.js.snap
│ │ └── index.js
├── prettier-plugin-pkgjson
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── docs
│ │ └── src
│ │ │ └── index.md
│ ├── package.json
│ ├── src
│ │ └── index.js
│ └── test
│ │ └── index.js
├── recommended-bump-cli
│ ├── .eslintignore
│ ├── .eslintrc.cjs
│ ├── .github
│ │ └── workflows
│ │ │ └── ci.yml
│ ├── .prettierignore
│ ├── .prettierrc.cjs
│ ├── .verb.md
│ ├── README.md
│ ├── bun.lockb
│ ├── docs
│ │ └── src
│ │ │ └── cli.md
│ ├── package.json
│ ├── src
│ │ └── cli.js
│ └── tsconfig.json
├── recommended-bump
│ ├── .eslintignore
│ ├── .eslintrc.cjs
│ ├── .github
│ │ └── workflows
│ │ │ └── ci.yml
│ ├── .prettierignore
│ ├── .prettierrc.cjs
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── bun.lockb
│ ├── cjs-dts-files.ts
│ ├── docs
│ │ └── src
│ │ │ └── index.md
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── index.ts
│ ├── tsconfig.json
│ └── tsup.config.ts
└── stringify-github-short-url
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── docs
│ └── src
│ │ └── index.md
│ ├── package.json
│ ├── src
│ └── index.js
│ └── test
│ └── index.js
├── @tunnckocore
├── create-jest-runner
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── docs
│ │ └── src
│ │ │ ├── createJestRunner.md
│ │ │ ├── fail.md
│ │ │ ├── index.md
│ │ │ ├── pass.md
│ │ │ ├── skip.md
│ │ │ ├── toTestResult.md
│ │ │ ├── todo.md
│ │ │ └── utils.md
│ ├── package.json
│ ├── src
│ │ ├── createJestRunner.js
│ │ ├── fail.js
│ │ ├── index.js
│ │ ├── pass.js
│ │ ├── skip.js
│ │ ├── toTestResult.js
│ │ ├── todo.js
│ │ └── utils.js
│ └── test
│ │ ├── failing.test.js
│ │ ├── fixtures
│ │ ├── failing
│ │ │ ├── __src__
│ │ │ │ └── file1.js
│ │ │ └── jest.config.js
│ │ ├── passing
│ │ │ ├── __src__
│ │ │ │ └── file1.js
│ │ │ └── jest.config.js
│ │ ├── skipped
│ │ │ ├── __src__
│ │ │ │ └── file1.js
│ │ │ └── jest.config.js
│ │ └── todo
│ │ │ ├── __src__
│ │ │ └── file1.js
│ │ │ └── jest.config.js
│ │ ├── passing.test.js
│ │ ├── skipped.test.js
│ │ ├── support
│ │ ├── runJest.js
│ │ └── runner
│ │ │ ├── index.js
│ │ │ └── run.js
│ │ └── todo.test.js
├── create-project
│ └── package.json
├── execa
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── docs
│ │ └── src
│ │ │ ├── index.md
│ │ │ └── main.md
│ ├── package.json
│ ├── src
│ │ └── index.js
│ └── test
│ │ └── index.js
├── jest-runner-babel
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── docs
│ │ └── src
│ │ │ ├── index.md
│ │ │ └── runner.md
│ ├── package.json
│ ├── src
│ │ ├── index.js
│ │ └── runner.js
│ └── test
│ │ └── index.js
├── jest-runner-eslint
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── docs
│ │ └── src
│ │ │ ├── index.md
│ │ │ └── runner.md
│ ├── package.json
│ ├── src
│ │ ├── index.js
│ │ └── runner.js
│ └── test
│ │ └── index.js
├── p-all
│ ├── LICENSE
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ └── index.js
│ └── test
│ │ └── index.js
├── package-json
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── docs
│ │ └── src
│ │ │ └── index.md
│ ├── package.json
│ ├── src
│ │ └── index.js
│ └── test
│ │ └── index.js
├── prettier-config
│ ├── README.md
│ ├── package.json
│ └── src
│ │ ├── defaults.js
│ │ └── index.js
├── pretty-config
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── docs
│ │ └── src
│ │ │ ├── index.md
│ │ │ └── utils.md
│ ├── package.json
│ ├── src
│ │ ├── index.js
│ │ └── utils.js
│ └── test
│ │ └── index.js
├── semver-increment
│ ├── README.md
│ ├── package.json
│ └── src
│ │ ├── index.js
│ │ ├── parse-options.js
│ │ └── re.js
└── utils
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── docs
│ └── src
│ │ └── index.md
│ ├── package.json
│ ├── src
│ └── index.js
│ └── test
│ ├── fixtures
│ ├── lerna
│ │ ├── @tunnckocore
│ │ │ └── barry
│ │ │ │ └── package.json
│ │ ├── cov
│ │ │ └── index.html
│ │ ├── lerna.json
│ │ ├── package.json
│ │ └── packages
│ │ │ ├── foo
│ │ │ └── package.json
│ │ │ └── numb
│ │ │ └── package.json
│ └── yarn-workspaces
│ │ ├── @hela
│ │ └── fab
│ │ │ ├── package.json
│ │ │ └── src
│ │ │ └── index.js
│ │ ├── @tunnckocore
│ │ └── qux
│ │ │ ├── package.json
│ │ │ └── src
│ │ │ └── index.js
│ │ ├── coverage
│ │ └── lcov-report
│ │ │ └── index.html
│ │ └── package.json
│ └── index.js
├── asia
├── README.md
├── asia-cli
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── bin.js
│ │ └── index.js
│ └── test
│ │ └── index.js
├── asia-core
│ ├── README.md
│ ├── example.js
│ ├── package.json
│ ├── src
│ │ ├── index.js
│ │ └── utils.js
│ └── test
│ │ └── index.js
└── asia
│ ├── README.md
│ ├── asia.config.js
│ ├── deno-example.js
│ ├── logo.png
│ ├── node-example.js
│ ├── package.json
│ ├── src
│ ├── cache.js
│ ├── index.js
│ ├── main.js
│ └── mod.ts
│ └── test
│ └── index.js
├── hela-workspace.json
├── hela.config.foo.js
├── hela.config.js
├── modules
├── arr-includes
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── docs
│ │ └── src
│ │ │ ├── index.md
│ │ │ └── main.md
│ ├── package.json
│ ├── src
│ │ └── index.js
│ └── test
│ │ └── index.js
├── ens-collections
│ ├── README.md
│ ├── collections
│ │ ├── 0x10k-club.json
│ │ ├── 0x99-club.json
│ │ ├── 0x999-club.json
│ │ ├── 0xemojis.json
│ │ ├── 1-hex-club.json
│ │ ├── 100k-club.json
│ │ ├── 10k-club.json
│ │ ├── 2-hex-club.json
│ │ ├── 24-clock-times.json
│ │ ├── 24h-club.json
│ │ ├── 3-digit-palindromes.json
│ │ ├── 3-hex-club.json
│ │ ├── 3-letter-all-vowels.json
│ │ ├── 3-letter-dictionary.json
│ │ ├── 3-letter-first-names.json
│ │ ├── 3-letter-months.json
│ │ ├── 3-letter-palindromes.json
│ │ ├── 3-letters.json
│ │ ├── 360-degree-club.json
│ │ ├── 365-club.json
│ │ ├── 4-digit-palindromes.json
│ │ ├── 4-letter-dictionary.json
│ │ ├── 5-digit-palindromes.json
│ │ ├── 5-letter-dictionary.json
│ │ ├── 6-digit-palindromes.json
│ │ ├── 99-temperature-club.json
│ │ ├── 999-club.json
│ │ ├── arabic-10k-club.json
│ │ ├── arabic-3-digit-palindromes.json
│ │ ├── arabic-999-club.json
│ │ ├── binary-club.json
│ │ ├── bip39-club.json
│ │ ├── braille-999-club.json
│ │ ├── capital-cities.json
│ │ ├── countries.json
│ │ ├── country-codes.json
│ │ ├── country-leaders.json
│ │ ├── double-triples-club.json
│ │ ├── english-adjectives.json
│ │ ├── english-nouns.json
│ │ ├── english-verbs.json
│ │ ├── ens-date-club.json
│ │ ├── ens-full-date-club.json
│ │ ├── ethmoji-99-club.json
│ │ ├── ethmoji-999-club.json
│ │ ├── ethmoji-double-club.json
│ │ ├── ethmoji-single-club.json
│ │ ├── ethmoji-triple-club.json
│ │ ├── first-names-female.json
│ │ ├── first-names-male.json
│ │ ├── flag-country-club.json
│ │ ├── full-months.json
│ │ ├── gen1-pokemons.json
│ │ ├── got-houses-club.json
│ │ ├── greek-alphabet.json
│ │ ├── harry-potter-club.json
│ │ ├── hindi-10k-club.json
│ │ ├── hindi-999-club.json
│ │ ├── hyphens-ll.json
│ │ ├── hyphens-ln-nl.json
│ │ ├── hyphens-nn.json
│ │ ├── hyphens-nnn.json
│ │ ├── jurassic-ens.json
│ │ ├── languages-of-the-world.json
│ │ ├── marvel-club.json
│ │ ├── mmdd-club.json
│ │ ├── mnemonic-club.json
│ │ ├── naruto-names.json
│ │ ├── nasdaq-index-club.json
│ │ ├── ncaa-college-abbrev.json
│ │ ├── palindrome-cities.json
│ │ ├── pokemon-trainer-dao-japanese.json
│ │ ├── pokemon-trainer-dao.json
│ │ ├── poker-club.json
│ │ ├── pre-punk-club.json
│ │ ├── psalms-club.json
│ │ ├── roman-numerals-club.json
│ │ ├── single-digit-multiply.json
│ │ ├── substances-club.json
│ │ └── the-cents-club.json
│ ├── logos
│ │ ├── 0x10k-club.png
│ │ ├── 0x99-club.png
│ │ ├── 0x999-club.png
│ │ ├── 0xemojis.png
│ │ ├── 1-hex-club.png
│ │ ├── 100k-club.png
│ │ ├── 10k-club.png
│ │ ├── 2-hex-club.png
│ │ ├── 24-clock-times.png
│ │ ├── 24h-club.png
│ │ ├── 3-digit-palindromes.png
│ │ ├── 3-hex-club.png
│ │ ├── 3-letter-all-vowels.png
│ │ ├── 3-letter-dictionary.png
│ │ ├── 3-letter-first-names.png
│ │ ├── 3-letter-palindromes.png
│ │ ├── 3-letters.png
│ │ ├── 360-degree-club.png
│ │ ├── 365-club.png
│ │ ├── 4-digit-palindromes.png
│ │ ├── 4-letter-dictionary.png
│ │ ├── 5-digit-palindromes.png
│ │ ├── 5-letter-dictionary.png
│ │ ├── 6-digit-palindromes.png
│ │ ├── 99-temperature-club.png
│ │ ├── 999-club.png
│ │ ├── arabic-10k-club.png
│ │ ├── arabic-3-digit-palindromes.png
│ │ ├── arabic-999-club.png
│ │ ├── binary-club.png
│ │ ├── bip39-club.png
│ │ ├── braille-999-club.png
│ │ ├── capital-cities.png
│ │ ├── countries.png
│ │ ├── country-codes.png
│ │ ├── country-leaders.png
│ │ ├── english-adjectives.png
│ │ ├── english-nouns.png
│ │ ├── english-verbs.png
│ │ ├── ens-date-club.png
│ │ ├── ens-full-date-club.png
│ │ ├── ethmoji-99-club.png
│ │ ├── ethmoji-999-club.png
│ │ ├── ethmoji-double-club.png
│ │ ├── ethmoji-single-club.png
│ │ ├── ethmoji-triple-club.png
│ │ ├── first-names-female.png
│ │ ├── first-names-male.png
│ │ ├── flag-country-club.png
│ │ ├── gen1-pokemons.png
│ │ ├── greek-alphabet.png
│ │ ├── harry-potter-club.png
│ │ ├── hindi-10k-club.png
│ │ ├── hindi-999-club.png
│ │ ├── hyphens-ll.png
│ │ ├── hyphens-ln-nl.png
│ │ ├── hyphens-nn.png
│ │ ├── hyphens-nnn.png
│ │ ├── jurassic-ens.png
│ │ ├── languages-of-the-world.png
│ │ ├── marvel-club.png
│ │ ├── mmdd-club.png
│ │ ├── mnemonic-club.png
│ │ ├── naruto-names.png
│ │ ├── nasdaq-index-club.png
│ │ ├── palindrome-cities.png
│ │ ├── pokemon-trainer-dao-japanese.png
│ │ ├── pokemon-trainer-dao.png
│ │ ├── poker-club.png
│ │ ├── pre-punk-club.png
│ │ ├── psalms-club.png
│ │ ├── roman-numerals-club.png
│ │ ├── single-digit-multiply.png
│ │ ├── the-969s.png
│ │ └── the-cents-club.png
│ ├── package.json
│ └── src
│ │ └── index.js
├── formidable-mini
│ ├── benchmark
│ │ ├── bench-multipart-fields-100mb-big.js
│ │ ├── bench-multipart-fields-100mb-small.js
│ │ ├── bench-multipart-files-100mb-big.js
│ │ ├── bench-multipart-files-100mb-small.js
│ │ ├── bench-urlencoded-fields-100pairs-small.js
│ │ ├── bench-urlencoded-fields-900pairs-small-alt.js
│ │ └── package.json
│ ├── example.js
│ ├── fixture.js
│ ├── package.json
│ └── src
│ │ ├── FormidableFile.js
│ │ ├── index.js
│ │ └── multipart.js
├── gitcommit
│ ├── package.json
│ ├── src
│ │ └── index.js
│ └── test
│ │ └── index.js
├── ip-filter
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── LICENSE.md
│ ├── README.md
│ ├── docs
│ │ └── src
│ │ │ └── index.md
│ ├── package.json
│ ├── src
│ │ └── index.js
│ └── test
│ │ └── index.js
├── kind-error
│ └── package.json
└── to-file-path
│ ├── .verb.md
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── docs
│ └── src
│ │ └── index.md
│ ├── package.json
│ ├── src
│ └── index.js
│ └── test
│ └── test.js
├── package.json
├── scripts
├── build-mappings-for-transfer-in.js
├── caching.js
├── clean-node-modules.js
├── create-package.js
└── eslint-linter-loading.js
└── xaxa
├── README.md
├── eslint-config-xaxa
├── README.md
├── package.json
└── src
│ ├── index.js
│ └── main.js
└── xaxa
├── README.md
├── package.json
└── src
├── bin.js
└── index.js
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig is awesome: https://EditorConfig.org
2 |
3 | # top-most EditorConfig file
4 | root = true
5 |
6 | [*]
7 | indent_style = space
8 | indent_size = 2
9 | end_of_line = lf
10 | charset = utf-8
11 | trim_trailing_whitespace = true
12 | insert_final_newline = true
13 | max_line_length = 80
14 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.tsbuildinfo
2 | *.*cache
3 |
4 | # Build environment
5 | dist
6 |
7 | # Package managers lockfiles
8 | package-lock.json
9 | shrinkwrap.json
10 | pnpm-lock.json
11 |
12 | # Logs
13 | logs
14 | *.log
15 | *~
16 |
17 | # Runtime data
18 | pids
19 | *.pid
20 | *.seed
21 | *.pid.lock
22 |
23 | # Directory for instrumented libs generated by jscoverage/JSCover
24 | lib-cov
25 |
26 | # Coverage directory used by tools like istanbul
27 | coverage
28 |
29 | # nyc test coverage
30 | .nyc_output
31 |
32 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
33 | .grunt
34 |
35 | # Bower dependency directory (https://bower.io/)
36 | bower_components
37 |
38 | # node-waf configuration
39 | .lock-wscript
40 |
41 | # Compiled binary addons (https://nodejs.org/api/addons.html)
42 | build/Release
43 |
44 | # Dependency directories
45 | node_modules/
46 | jspm_packages/
47 |
48 | # TypeScript v1 declaration files
49 | typings/
50 |
51 | # Optional npm cache directory
52 | .npm
53 |
54 | # Optional eslint cache
55 | .eslintcache
56 |
57 | # Optional REPL history
58 | .node_repl_history
59 |
60 | # Output of 'npm pack'
61 | *.tgz
62 |
63 | # Yarn Integrity file
64 | .yarn-integrity
65 |
66 | # dotenv environment variables file
67 | .env
68 |
69 | # next.js build output
70 | .next
71 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | CHANGELOG.md
2 | fixtures
3 | *.tsbuildinfo
4 | *.*cache
5 |
6 | # Build environment
7 | dist
8 |
9 | # Package managers lockfiles
10 | package-lock.json
11 | shrinkwrap.json
12 | pnpm-lock.json
13 |
14 | # Logs
15 | logs
16 | *.log
17 | *~
18 |
19 | # Runtime data
20 | pids
21 | *.pid
22 | *.seed
23 | *.pid.lock
24 |
25 | # Directory for instrumented libs generated by jscoverage/JSCover
26 | lib-cov
27 |
28 | # Coverage directory used by tools like istanbul
29 | coverage
30 |
31 | # nyc test coverage
32 | .nyc_output
33 |
34 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
35 | .grunt
36 |
37 | # Bower dependency directory (https://bower.io/)
38 | bower_components
39 |
40 | # node-waf configuration
41 | .lock-wscript
42 |
43 | # Compiled binary addons (https://nodejs.org/api/addons.html)
44 | build/Release
45 |
46 | # Dependency directories
47 | node_modules/
48 | jspm_packages/
49 |
50 | # TypeScript v1 declaration files
51 | typings/
52 |
53 | # Optional npm cache directory
54 | .npm
55 |
56 | # Optional eslint cache
57 | .eslintcache
58 |
59 | # Optional REPL history
60 | .node_repl_history
61 |
62 | # Output of 'npm pack'
63 | *.tgz
64 |
65 | # Yarn Integrity file
66 | .yarn-integrity
67 |
68 | # dotenv environment variables file
69 | .env
70 |
71 | # next.js build output
72 | .next
73 |
--------------------------------------------------------------------------------
/@packages/all-module-paths/.verb.md:
--------------------------------------------------------------------------------
1 | ## API
2 |
3 |
4 |
5 | {%= include(process.cwd() + "/docs/src/index.md") %}
6 | {%= include(process.cwd() + "/docs/src/main.md") %}
7 |
8 |
9 |
--------------------------------------------------------------------------------
/@packages/all-module-paths/docs/src/index.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/all-module-paths/docs/src/index.md
--------------------------------------------------------------------------------
/@packages/all-module-paths/docs/src/main.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/all-module-paths/docs/src/main.md
--------------------------------------------------------------------------------
/@packages/all-module-paths/src/main.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const path = require('path');
4 | const esmLoader = require('esm');
5 | // const pkg = require('../package.json');
6 |
7 | const esmRequire = esmLoader(module);
8 |
9 | const mod = esmRequire(path.join(__dirname, 'index.js'));
10 |
11 | const ___exportsWithoutDefault = Object.keys(mod || {})
12 | .filter((x) => x !== 'default')
13 | .reduce((acc, key) => {
14 | acc[key] = mod[key];
15 | return acc;
16 | }, {});
17 |
18 | module.exports = Object.assign(mod.default, ___exportsWithoutDefault);
19 |
--------------------------------------------------------------------------------
/@packages/babel-preset-optimise/.verb.md:
--------------------------------------------------------------------------------
1 | ## Usage
2 |
3 | ```js
4 | module.exports = {
5 | presets: ['babel-preset-optimise'],
6 | };
7 | ```
8 |
9 | _**Note:** initially it was meant to be called `babel-preset-optimize`, but the
10 | package was squatted before I get able to push all this things. Born in
11 | discussion with [@JounQin](https://github.com/JounQin) in
12 | [1stG/configs issue#8](https://github.com/1stG/configs/issues/8)._
13 |
14 | ## What it includes?
15 |
16 | It uses the most recent and modern preset by the Babel Team -
17 | [@babel/preset-modules](https://ghub.now.sh/@babel/preset-modules), plus
18 | optionally the TypeScript and the React presets. It also includes a several
19 | optimization plugins from the Babel Minify project which are very well curated
20 | for best and small output.
21 |
22 | ## API
23 |
24 |
25 |
26 | {%= include(process.cwd() + "/docs/src/index.md") %}
27 |
28 |
29 |
--------------------------------------------------------------------------------
/@packages/babel-preset-optimise/docs/src/index.md:
--------------------------------------------------------------------------------
1 | _Generated using [jest-runner-docs](https://ghub.now.sh/jest-runner-docs)._
2 |
3 | ### [babelPresetOptimize](./src/index.js#L22)
4 |
5 | Be aware that when you use `minifyBuiltins: true` you _MAY_ get a bigger output,
6 | but that's not always guaranteed, just try for your case.
7 |
8 | If you want to use JSX (React) pass `options.jsx: true`. If you want to use JSX
9 | (React) + TypeScript pass both `{ jsx: true, typescript: true }`. If you wan to
10 | use Preact + TypeScript, `{ jsx: { pragma: 'h' }, typescript: true }`, if
11 | `options.jsx` is an object, it is directly passed to `preset-react`.
12 |
13 |
14 |
15 | #### Signature
16 |
17 | ```ts
18 | function(api, options)
19 | ```
20 |
21 |
22 |
23 | #### Params
24 |
25 | - `options` **{object}** - optionally control what can be included
26 | - `options.jsx` **{boolean}** - default `false`, pass `true` if you want
27 | `react`; pass an object for more customization (passed to react preset)
28 | - `options.commonjs` **{boolean}** - default `false`, pass non-falsey value to
29 | transform ESModules to CommonJS
30 | - `options.typescript` **{boolean}** - default `false`, includes the TypeScript
31 | preset
32 | - `options.development` **{boolean}** - default `false`, disables few plugins;
33 | when it is `true` and `options.jsx` is enabled (true or object) we add
34 | `options.jsx.development: true` too
35 | - `options.minifyBuiltins` **{boolean}** - default `false`, includes
36 | [babel-plugin-minify-builtins][]
37 |
--------------------------------------------------------------------------------
/@packages/gitclone-cli/.verb.md:
--------------------------------------------------------------------------------
1 | ## API
2 |
3 |
4 |
5 | {%= include(process.cwd() + "/docs/src/index.md") %}
6 | {%= include(process.cwd() + "/docs/src/cli.md") %}
7 |
8 |
9 |
--------------------------------------------------------------------------------
/@packages/gitclone-cli/docs/src/cli.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/gitclone-cli/docs/src/cli.md
--------------------------------------------------------------------------------
/@packages/gitclone-cli/docs/src/index.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/gitclone-cli/docs/src/index.md
--------------------------------------------------------------------------------
/@packages/gitclone-cli/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "gitclone-cli",
3 | "version": "1.2.7",
4 | "licenseStart": 2015,
5 | "license": "MPL-2.0",
6 | "description": "Simple command line interface for the `git clone` command, using [gitclone][] package",
7 | "author": "Charlike Mike Reagent (https://tunnckocore.com)",
8 | "homepage": "https://tunnckocore.com/opensource",
9 | "funding": [
10 | "https://ko-fi.com/tunnckoCore/commissions",
11 | "https://github.com/sponsors/tunnckoCore",
12 | "https://patreon.com/tunnckoCore"
13 | ],
14 | "repository": {
15 | "type": "git",
16 | "url": "https://github.com/tunnckoCore/opensource.git",
17 | "directory": "@packages/gitclone-cli"
18 | },
19 | "files": [
20 | "src"
21 | ],
22 | "bin": {
23 | "gitclone": "src/cli.js",
24 | "gitclone-cli": "src/cli.js"
25 | },
26 | "engines": {
27 | "node": ">=8.11"
28 | },
29 | "publishConfig": {
30 | "access": "public",
31 | "tag": "latest"
32 | },
33 | "scripts": {},
34 | "dependencies": {
35 | "git-username": "^1.0.0",
36 | "gitclone": "^2.0.0",
37 | "sade": "^1.7.0"
38 | },
39 | "cov": {
40 | "color": "grey"
41 | },
42 | "keywords": [
43 | "cli",
44 | "clone",
45 | "cmd",
46 | "command",
47 | "developer-experience",
48 | "development",
49 | "dx",
50 | "flexible",
51 | "gh",
52 | "ghclone",
53 | "git",
54 | "gitc",
55 | "gitclone",
56 | "github",
57 | "github-clone",
58 | "hela",
59 | "interface",
60 | "tunnckocore-oss",
61 | "tunnckocorehq"
62 | ],
63 | "verb": {
64 | "readme": "../../readme-template.md",
65 | "run": true,
66 | "toc": {
67 | "render": true,
68 | "method": "preWrite",
69 | "maxdepth": 4
70 | },
71 | "layout": "empty",
72 | "tasks": [
73 | "readme"
74 | ],
75 | "lint": {
76 | "reflinks": true
77 | },
78 | "reflinks": [
79 | "gitclone"
80 | ],
81 | "related": {
82 | "list": []
83 | }
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/@packages/gitclone-cli/src/cli.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | 'use strict';
4 |
5 | const username = require('git-username');
6 | const gitclone = require('gitclone');
7 | const sade = require('sade');
8 | const pkg = require('../package.json');
9 |
10 | sade('gitclone [repository]', true)
11 | .version(pkg.version)
12 | .describe('Clone a git repository')
13 | .example('owner/repo')
14 | .example('repo')
15 | .example('tunnckoCoreLabs/charlike -s')
16 | .example('verbose/verb#dev')
17 | .example('micromatch/micromatch')
18 | .example('micromatch/micromatch --dest mm')
19 | .example('facebook/jest')
20 | .example('-o facebook -n jest')
21 | .option('-s, --ssh', 'Clone SSH, not https', false)
22 | .option('-n, --name', 'Repository name, like `charlike`')
23 | .option('-o, --owner', 'Owner of the repository', username())
24 | .option('-r, --repo', 'Repository slug, like `facebook/jest`')
25 | .option('-b, --branch', 'Specific branch or sha hash', 'master')
26 | .option('-d, --dest', 'Destination place')
27 | .action((repository, argv) => {
28 | let repo = repository;
29 | const opts = { ...argv };
30 |
31 | gitclone.options = { stdio: 'inherit' };
32 |
33 | if (!repo) {
34 | gitclone(opts);
35 | return;
36 | }
37 | if (repo.includes('#')) {
38 | const parts = repo.split('#');
39 | repo = parts[0];
40 | opts.branch = parts[1];
41 | }
42 |
43 | if (repo.includes('/')) {
44 | gitclone(repo, opts);
45 | } else {
46 | opts.name = repo;
47 | gitclone(opts);
48 | }
49 | })
50 | .parse(process.argv);
51 |
--------------------------------------------------------------------------------
/@packages/gitclone-cli/src/index.js:
--------------------------------------------------------------------------------
1 | // noop
2 |
--------------------------------------------------------------------------------
/@packages/gitclone-defaults/.verb.md:
--------------------------------------------------------------------------------
1 | ## API
2 |
3 |
4 |
5 | {%= include(process.cwd() + "/docs/src/index.md") %}
6 |
7 |
8 |
--------------------------------------------------------------------------------
/@packages/glob-cache/.verb.logo.md:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
--------------------------------------------------------------------------------
/@packages/glob-cache/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/glob-cache/logo.png
--------------------------------------------------------------------------------
/@packages/glob-cache/test/fixtures/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/glob-cache/test/fixtures/.gitkeep
--------------------------------------------------------------------------------
/@packages/glob-cache/test/fixtures/bar.js:
--------------------------------------------------------------------------------
1 | export default () => 123;
2 |
--------------------------------------------------------------------------------
/@packages/glob-cache/test/fixtures/big.js:
--------------------------------------------------------------------------------
1 | import bar from './bar';
2 |
3 | export const foo = bar();
4 |
5 | export default foo;
6 |
--------------------------------------------------------------------------------
/@packages/jest-runner-docs/.verb.md:
--------------------------------------------------------------------------------
1 | ## API
2 |
3 |
4 |
5 | {%= include(process.cwd() + "/docs/src/runner.md") %}
6 | {%= include(process.cwd() + "/docs/src/docks.md") %}
7 | {%= include(process.cwd() + "/docs/src/index.md") %}
8 |
9 |
10 |
--------------------------------------------------------------------------------
/@packages/jest-runner-docs/docs/src/docks.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/jest-runner-docs/docs/src/docks.md
--------------------------------------------------------------------------------
/@packages/jest-runner-docs/docs/src/index.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/jest-runner-docs/docs/src/index.md
--------------------------------------------------------------------------------
/@packages/jest-runner-docs/docs/src/runner.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/jest-runner-docs/docs/src/runner.md
--------------------------------------------------------------------------------
/@packages/jest-runner-docs/src/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const { join } = require('path');
4 | const { createJestRunner } = require('@tunnckocore/create-jest-runner');
5 |
6 | module.exports = createJestRunner(join(__dirname, 'runner.js'));
7 |
--------------------------------------------------------------------------------
/@packages/jest-runner-docs/test/index.js:
--------------------------------------------------------------------------------
1 | import mod from '../src/runner.js';
2 |
3 | test('make tests for jest-runner-docs package', async () => {
4 | expect(typeof mod).toStrictEqual('function');
5 | });
6 |
--------------------------------------------------------------------------------
/@packages/jest-runner-node/.verb.md:
--------------------------------------------------------------------------------
1 | ## API
2 |
3 |
4 |
5 | {%= include(process.cwd() + "/docs/src/config.md") %}
6 | {%= include(process.cwd() + "/docs/src/runner.md") %}
7 | {%= include(process.cwd() + "/docs/src/require-module.md") %}
8 | {%= include(process.cwd() + "/docs/src/index.md") %}
9 |
10 |
11 |
--------------------------------------------------------------------------------
/@packages/jest-runner-node/docs/src/config.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/jest-runner-node/docs/src/config.md
--------------------------------------------------------------------------------
/@packages/jest-runner-node/docs/src/index.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/jest-runner-node/docs/src/index.md
--------------------------------------------------------------------------------
/@packages/jest-runner-node/docs/src/require-module.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/jest-runner-node/docs/src/require-module.md
--------------------------------------------------------------------------------
/@packages/jest-runner-node/docs/src/runner.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/jest-runner-node/docs/src/runner.md
--------------------------------------------------------------------------------
/@packages/jest-runner-node/foo.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const assert = require('assert');
4 | const test = require('asia');
5 |
6 | test('foo bar qux', () => {
7 | assert.strictEqual(1, 123, 'should NOT be okay');
8 | });
9 |
10 | test('two failing tests qux', () => {
11 | assert.strictEqual(444_441, 33_333, 'should NOT be okay');
12 | });
13 |
14 | test('passing ok', () => {
15 | assert.strictEqual(typeof test, 'function', 'should not fail');
16 | });
17 |
--------------------------------------------------------------------------------
/@packages/jest-runner-node/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jest-runner-node",
3 | "version": "0.4.8",
4 | "licenseStart": 2020,
5 | "license": "MPL-2.0",
6 | "description": "Running Node.js files, through Jest",
7 | "author": "Charlike Mike Reagent (https://tunnckocore.com)",
8 | "homepage": "https://tunnckocore.com/opensource",
9 | "funding": [
10 | "https://ko-fi.com/tunnckoCore/commissions",
11 | "https://github.com/sponsors/tunnckoCore",
12 | "https://patreon.com/tunnckoCore"
13 | ],
14 | "repository": {
15 | "type": "git",
16 | "url": "https://github.com/tunnckoCore/opensource.git",
17 | "directory": "@packages/jest-runner-node"
18 | },
19 | "main": "src/index.js",
20 | "module": "src/index.js",
21 | "files": [
22 | "src"
23 | ],
24 | "engines": {
25 | "node": ">=10.13"
26 | },
27 | "publishConfig": {
28 | "access": "public",
29 | "tag": "latest"
30 | },
31 | "scripts": {},
32 | "dependencies": {
33 | "@tunnckocore/create-jest-runner": "^1.3.7",
34 | "execa": "^4.0.0"
35 | },
36 | "jest": {
37 | "coverageThreshold": {
38 | "src/**/*.js": {
39 | "statements": 100,
40 | "branches": 100,
41 | "functions": 100,
42 | "lines": 100
43 | }
44 | }
45 | },
46 | "cov": {
47 | "value": 100,
48 | "color": "green"
49 | },
50 | "keywords": [
51 | "developer-experience",
52 | "development",
53 | "dx",
54 | "hela",
55 | "jest-runner",
56 | "jest-runner-node",
57 | "node-runner",
58 | "nodejs",
59 | "tunnckocore-oss",
60 | "tunnckocorehq"
61 | ],
62 | "verb": {
63 | "readme": "../../readme-template.md",
64 | "run": true,
65 | "toc": {
66 | "render": true,
67 | "method": "preWrite",
68 | "maxdepth": 4
69 | },
70 | "layout": "empty",
71 | "tasks": [
72 | "readme"
73 | ],
74 | "lint": {
75 | "reflinks": true
76 | },
77 | "reflinks": [],
78 | "related": {
79 | "list": []
80 | }
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/@packages/jest-runner-node/src/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const { join } = require('path');
4 | const { createJestRunner } = require('@tunnckocore/create-jest-runner');
5 |
6 | module.exports = createJestRunner(join(__dirname, 'runner.js'));
7 |
--------------------------------------------------------------------------------
/@packages/jest-runner-node/src/require-module.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* eslint-disable global-require, import/no-dynamic-require */
4 | module.exports.require = (modPath) => require(modPath);
5 |
--------------------------------------------------------------------------------
/@packages/jest-runner-node/src/runner.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const path = require('path');
4 | const execa = require('execa');
5 | const { pass, fail } = require('@tunnckocore/create-jest-runner');
6 |
7 | process.env.NODE_ENV = 'node';
8 |
9 | module.exports = async function jestRunnerNode({ testPath, config }) {
10 | const start = new Date();
11 | const nodeCmd = process.env.JEST_RUNNER_NODE_CMD;
12 |
13 | const proc = execa.command(`${nodeCmd || `node ${testPath}`}`, {
14 | env: process.env,
15 | cwd: nodeCmd ? path.dirname(testPath) : config.cwd,
16 | stdio: 'inherit',
17 | });
18 |
19 | const testResults = await new Promise((resolve) => {
20 | proc
21 | .then(() => {
22 | resolve(
23 | pass({
24 | start,
25 | end: new Date(),
26 | test: {
27 | title: 'Jest Node.js',
28 | path: testPath,
29 | },
30 | }),
31 | );
32 | })
33 | .catch((err) => {
34 | const lines = err.message.split('\n');
35 | const message = lines
36 | .filter((x) => !x.includes('Command failed'))
37 | .join('\n')
38 | .trim();
39 |
40 | // const atLines = lines.filter(
41 | // (x) => /at:?\s+/gi.test(x) || x.includes('not ok'),
42 | // );
43 | // const msg = atLines.length > 0 ? atLines.join('\n') : message;
44 | // const notOkLines = lines.filter((x) => x.includes('not ok'));
45 |
46 | resolve(
47 | fail({
48 | start,
49 | end: new Date(),
50 | test: {
51 | title: 'Jest Node.js',
52 | path: testPath,
53 | errorMessage: message,
54 | },
55 | }),
56 | );
57 | });
58 | });
59 |
60 | return testResults;
61 | };
62 |
--------------------------------------------------------------------------------
/@packages/jest-runner-node/test/index.js:
--------------------------------------------------------------------------------
1 | const mod = require('../src');
2 |
3 | test('todo tests for jest-runner-node package', async () => {
4 | expect(typeof mod).toStrictEqual('function');
5 | });
6 |
--------------------------------------------------------------------------------
/@packages/jest-runner-rollup/.verb.md:
--------------------------------------------------------------------------------
1 | ## API
2 |
3 |
4 |
5 | {%= include(process.cwd() + "/docs/src/runner.md") %}
6 | {%= include(process.cwd() + "/docs/src/index.md") %}
7 |
8 |
9 |
--------------------------------------------------------------------------------
/@packages/jest-runner-rollup/docs/src/index.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/jest-runner-rollup/docs/src/index.md
--------------------------------------------------------------------------------
/@packages/jest-runner-rollup/docs/src/runner.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/jest-runner-rollup/docs/src/runner.md
--------------------------------------------------------------------------------
/@packages/jest-runner-rollup/src/index.js:
--------------------------------------------------------------------------------
1 | const { join } = require('path');
2 | const { createJestRunner } = require('@tunnckocore/create-jest-runner');
3 |
4 | module.exports = createJestRunner(join(__dirname, 'runner.js'));
5 |
--------------------------------------------------------------------------------
/@packages/jest-runner-rollup/test/index.js:
--------------------------------------------------------------------------------
1 | import mod from '../src/runner.js';
2 |
3 | test('make tests for jest-runner-rollup package', async () => {
4 | expect(typeof mod).toStrictEqual('function');
5 | });
6 |
--------------------------------------------------------------------------------
/@packages/koa-better-body/docs/src/index.md:
--------------------------------------------------------------------------------
1 | _Generated using [jest-runner-docs](https://ghub.now.sh/jest-runner-docs)._
2 |
3 | ### [koaBetterBody](./src/index.js#L36)
4 |
5 | > Robust body parser for [koa][]@1, also works for `koa@2` (with deprecations).
6 | > Will also work for future `koa@3` with [koa-convert][].
7 |
8 |
9 |
10 | #### Signature
11 |
12 | ```ts
13 | function(options)
14 | ```
15 |
16 |
17 |
18 | #### Params
19 |
20 | - `options` **{object}** - see more on [options section](#options)
21 | - `returns` **{GeneratorFunction}** - plugin for Koa
22 |
23 |
24 |
25 | #### Examples
26 |
27 | ```js
28 | var koa = require('koa');
29 | var body = require('koa-better-body');
30 | var app = koa();
31 |
32 | app
33 | .use(body())
34 | .use(function* () {
35 | console.log(this.request.body); // if buffer or text
36 | console.log(this.request.files); // if multipart or urlencoded
37 | console.log(this.request.fields); // if json
38 | })
39 | .listen(8080, function () {
40 | console.log('koa server start listening on port 8080');
41 | });
42 | ```
43 |
--------------------------------------------------------------------------------
/@packages/koa-better-body/docs/src/utils.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/koa-better-body/docs/src/utils.md
--------------------------------------------------------------------------------
/@packages/koa-better-body/example.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* eslint-disable unicorn/no-abusive-eslint-disable */
4 |
5 | /* eslint-disable */
6 |
7 | const app = require('koa')();
8 | const router = require('koa-router')();
9 |
10 | router.post('/upload', body(), function* (next) {
11 | console.log(this.request.files);
12 | console.log(this.request.fields);
13 |
14 | // there's no `.body` when `multipart`,
15 | // `urlencoded` or `json` request
16 | console.log(this.request.body);
17 |
18 | // print it to the API requester
19 | this.body = JSON.stringify(
20 | {
21 | fields: this.request.fields,
22 | files: this.request.files,
23 | body: this.request.body || null,
24 | },
25 | null,
26 | 2,
27 | );
28 |
29 | yield next;
30 | });
31 |
32 | app.use(router.routes());
33 | app.listen(4292);
34 |
35 | const { format } = require('util');
36 | const body = require('./src/index');
37 |
38 | const host = 'http://localhost:4292';
39 | const cmd = 'curl -i %s/upload -F "source=@%s/.editorconfig"';
40 |
41 | console.log('Try it out with below CURL for `koa-better-body` repository.');
42 | console.log(format(cmd, host, __dirname));
43 |
--------------------------------------------------------------------------------
/@packages/koa-better-body/recipes/form/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const app = require('koa')();
4 | const route = require('koa-route');
5 | const body = require('../../src/index');
6 |
7 | const controller = {
8 | *home(next) {
9 | this.body = ``;
17 | },
18 | *upload(next) {
19 | this.body = JSON.stringify(
20 | {
21 | files: this.request.files,
22 | fields: this.request.fields,
23 | },
24 | null,
25 | 2,
26 | );
27 | },
28 | };
29 |
30 | app.use(
31 | body({
32 | querystring: require('qs'),
33 | formLimit: '6mb',
34 | }),
35 | );
36 | app.use(route.get('/', controller.home));
37 | app.use(route.post('/', controller.upload));
38 | app.listen(4290);
39 |
--------------------------------------------------------------------------------
/@packages/koa-better-body/recipes/formidable/README.md:
--------------------------------------------------------------------------------
1 | ## formidable instance
2 |
3 | Now you can send your own `formidable.IncomingForm` instance via
4 | `options.IncomingForm`. It means you can do something beyond default behavior,
5 | such as handling image upload.
6 |
7 | Below is the simple demo of custom `formidable.IncomingForm` instance and event
8 | handling. Check [formidable](https://github.com/felixge/node-formidable) for
9 | more info.
10 |
11 | ```js
12 | 'use strict';
13 |
14 | var app = require('koa')();
15 | var path = require('path');
16 | var IncomingForm = require('formidable');
17 | var body = require('koa-better-body');
18 |
19 | var form = new IncomingForm();
20 |
21 | form.keepExtensions = true;
22 | form.encoding = 'utf-8';
23 | form.uploadDir = path.join(__dirname, 'uploads');
24 |
25 | form.on('field', function (name, value) {
26 | console.log(name, value); // name is user, value is test
27 | });
28 | form.on('file', function (name, file) {
29 | console.log(name); // => foo
30 | console.log(file); // => README.md
31 | console.log(file.path); // => full filepath to where is uploaded
32 | });
33 | form.on('end', function (name, file) {
34 | console.log('finish parse');
35 | });
36 |
37 | app
38 | .use(
39 | body({
40 | IncomingForm: form,
41 | }),
42 | )
43 | .use(function* () {
44 | console.log(this.body.user); // => test
45 | console.log(this.request.files); // or `this.body.files`
46 | console.log(this.body.files.foo.name); // => README.md
47 | console.log(this.body.files.foo.path); // => full filepath to where is uploaded
48 | });
49 |
50 | app.listen(4290, function () {
51 | console.log('Koa server start listening on port 4290');
52 | console.log(
53 | 'curl -i http://localhost:4290/ -F "foo=@%s/README.md" -F user=test',
54 | __dirname,
55 | );
56 | });
57 | ```
58 |
59 | ## Try it
60 |
61 | > You can try above example by running:
62 |
63 | ```
64 | node recipes/formidable
65 | ```
66 |
--------------------------------------------------------------------------------
/@packages/koa-better-body/recipes/formidable/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const app = require('koa')();
4 | const path = require('path');
5 | const IncomingForm = require('formidable');
6 | const body = require('../../src/index');
7 |
8 | const form = new IncomingForm();
9 |
10 | form.keepExtensions = true;
11 | form.encoding = 'utf-8';
12 | form.uploadDir = path.join(__dirname, 'uploads');
13 |
14 | form.on('field', (name, value) => {
15 | console.log(name, value); // name is user, value is test
16 | });
17 | form.on('file', (name, file) => {
18 | console.log(name); // => foo
19 | console.log(file); // => README.md
20 | console.log(file.path); // => full filepath to where is uploaded
21 | });
22 | form.on('end', (name, file) => {
23 | console.log('finish parse');
24 | });
25 |
26 | app
27 | .use(
28 | body({
29 | IncomingForm: form,
30 | }),
31 | )
32 | .use(function* () {
33 | console.log(this.body.user); // => test
34 | console.log(this.request.files); // or `this.body.files`
35 | console.log(this.body.files.foo.name); // => README.md
36 | console.log(this.body.files.foo.path); // => full filepath to where is uploaded
37 | });
38 |
39 | app.listen(4290, () => {
40 | console.log('Koa server start listening on port 4290');
41 | console.log(
42 | 'curl -i http://localhost:4290/ -F "foo=@%s/README.md" -F user=test',
43 | __dirname,
44 | );
45 | });
46 |
--------------------------------------------------------------------------------
/@packages/koa-better-body/recipes/formidable/uploads/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/koa-better-body/recipes/formidable/uploads/.gitkeep
--------------------------------------------------------------------------------
/@packages/koa-better-body/recipes/multipart/README.md:
--------------------------------------------------------------------------------
1 | ## multipart
2 |
3 | text text text...
4 |
5 | ```js
6 | 'use strict';
7 |
8 | var app = require('koa')();
9 | var path = require('path');
10 | var body = require('koa-better-body');
11 |
12 | app
13 | .use(
14 | body({
15 | encoding: 'utf-8',
16 | uploadDir: path.join(__dirname, 'uploads'),
17 | keepExtensions: true,
18 | }),
19 | )
20 | .use(function* () {
21 | console.log(this.request.files); // or `this.body.files`
22 | console.log(this.body.files.foo.name); // => README.md
23 | console.log(this.body.files.foo.path); // => full filepath to where is uploaded
24 | });
25 |
26 | app.listen(4290, function () {
27 | console.log('Koa server start listening on port 4290');
28 | console.log(
29 | 'curl -i http://localhost:4290/ -F "foo=@%s/README.md"',
30 | __dirname,
31 | );
32 | });
33 | ```
34 |
35 | ## Try it
36 |
37 | > You can try above example by running:
38 |
39 | ```
40 | node recipes/multipart
41 | ```
42 |
--------------------------------------------------------------------------------
/@packages/koa-better-body/recipes/multipart/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const app = require('koa')();
4 | const path = require('path');
5 | const body = require('../../src/index');
6 |
7 | app
8 | .use(
9 | body({
10 | encoding: 'utf-8',
11 | uploadDir: path.join(__dirname, 'uploads'),
12 | keepExtensions: true,
13 | }),
14 | )
15 | .use(function* () {
16 | console.log(this.request.files); // or `this.body.files`
17 | console.log(this.body.files.foo.name); // => README.md
18 | console.log(this.body.files.foo.path); // => full filepath to where is uploaded
19 | });
20 |
21 | app.listen(4290, () => {
22 | console.log('Koa server start listening on port 4290');
23 | console.log(
24 | 'curl -i http://localhost:4290/ -F "foo=@%s/README.md"',
25 | __dirname,
26 | );
27 | });
28 |
--------------------------------------------------------------------------------
/@packages/koa-better-body/recipes/multipart/uploads/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/koa-better-body/recipes/multipart/uploads/.gitkeep
--------------------------------------------------------------------------------
/@packages/koa-better-body/src/index.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * koa-better-body
3 | *
4 | * Copyright (c) 2014-2016 Charlike Mike Reagent <@tunnckoCore> (http://www.tunnckocore.tk)
5 | * Released under the MIT license.
6 | */
7 |
8 | import { defaultOptions, setParsers, isValid, parseBody } from './utils.js';
9 |
10 | /**
11 | * > Robust body parser for [koa][]@1, also works for `koa@2` (with deprecations).
12 | * Will also work for future `koa@3` with [koa-convert][].
13 | *
14 | * @example
15 | * var koa = require('koa')
16 | * var body = require('koa-better-body')
17 | * var app = koa()
18 | *
19 | * app
20 | * .use(body())
21 | * .use(function * () {
22 | * console.log(this.request.body) // if buffer or text
23 | * console.log(this.request.files) // if multipart or urlencoded
24 | * console.log(this.request.fields) // if json
25 | * })
26 | * .listen(8080, function () {
27 | * console.log('koa server start listening on port 8080')
28 | * })
29 | *
30 | * @name koaBetterBody
31 | * @param {object} `options` see more on [options section](#options)
32 | * @return {GeneratorFunction} - plugin for Koa
33 | * @api public
34 | */
35 |
36 | export default function koaBetterBody(options) {
37 | const opts = defaultOptions(options);
38 |
39 | // eslint-disable-next-line consistent-return
40 | return function* plugin(next) {
41 | if (opts.strict && !isValid(this.method)) {
42 | return yield* next;
43 | }
44 |
45 | try {
46 | setParsers(this, opts);
47 | yield* parseBody(this, opts, next);
48 | } catch (err) {
49 | if (!opts.onError) throw err;
50 | opts.onError(err, this);
51 | }
52 |
53 | yield* next;
54 | };
55 | }
56 |
--------------------------------------------------------------------------------
/@packages/koa-better-body/test/custom.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * koa-better-body
3 | *
4 | * Copyright (c) 2014-2016 Charlike Mike Reagent <@tunnckoCore> (http://www.tunnckocore.tk)
5 | * Released under the MIT license.
6 | */
7 |
8 | import request from 'supertest';
9 | import Koa from 'koa';
10 | import betterBody from '../src/index.js';
11 |
12 | function koa() {
13 | return new Koa();
14 | }
15 |
16 | test('should accept opts.extendTypes.custom `foo/bar-x` as text', async () => {
17 | const server = koa()
18 | .use(
19 | betterBody({
20 | extendTypes: {
21 | custom: ['foo/bar-x'],
22 | },
23 |
24 | handler: function* handler(ctx, opts) {
25 | expect(typeof ctx).toStrictEqual('object');
26 | expect(typeof this).toStrictEqual('object');
27 | expect(typeof ctx.request.text).toStrictEqual('function');
28 | expect(typeof this.request.text).toStrictEqual('function');
29 |
30 | this.request.body = yield this.request.text(opts);
31 | },
32 | }),
33 | )
34 | .use(function* abc(next) {
35 | expect(this.request.body).toStrictEqual('message=lol');
36 | this.body = this.request.body;
37 | yield* next;
38 | })
39 | // eslint-disable-next-line require-yield
40 | .use(function* abc() {
41 | expect(this.body).toStrictEqual('message=lol');
42 | });
43 |
44 | await new Promise((resolve, reject) => {
45 | request(server.callback())
46 | .post('/')
47 | .type('foo/bar-x')
48 | .send('message=lol')
49 | .expect(200)
50 | .expect('message=lol')
51 | .end((err) => (err ? reject(err) : resolve()));
52 | });
53 | });
54 |
--------------------------------------------------------------------------------
/@packages/koa-better-body/test/text.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable jest/expect-expect */
2 | /* eslint-disable require-yield */
3 |
4 | /*!
5 | * koa-better-body
6 | *
7 | * Copyright (c) 2014-2016 Charlike Mike Reagent <@tunnckoCore> (http://www.tunnckocore.tk)
8 | * Released under the MIT license.
9 | */
10 |
11 | import request from 'supertest';
12 | import Koa from 'koa';
13 | import betterBody from '../src/index.js';
14 |
15 | function koa() {
16 | return new Koa();
17 | }
18 |
19 | test('should get the raw text body', async () => {
20 | const server = koa()
21 | .use(betterBody())
22 | .use(function* sasa() {
23 | expect(this.request.fields).toBeUndefined();
24 | expect(this.request.body).toStrictEqual('message=lol');
25 | this.body = this.request.body;
26 | });
27 |
28 | await new Promise((resolve, reject) => {
29 | request(server.callback())
30 | .post('/')
31 | .type('text')
32 | .send('message=lol')
33 | .expect(200)
34 | .expect('message=lol')
35 | .end((err) => (err ? reject(err) : resolve()));
36 | });
37 | });
38 |
39 | test('should throw if the body is too large', async () => {
40 | const server = koa().use(betterBody({ textLimit: '2b' }));
41 |
42 | await new Promise((resolve, reject) => {
43 | request(server.callback())
44 | .post('/')
45 | .type('text')
46 | .send('foobar')
47 | .expect(413)
48 | .end((err) => (err ? reject(err) : resolve()));
49 | });
50 | });
51 |
--------------------------------------------------------------------------------
/@packages/parse-commit-message/.eslintignore:
--------------------------------------------------------------------------------
1 | __backup_packages
2 |
3 | CHANGELOG.md
4 | fixtures
5 | *.tsbuildinfo
6 | *.*cache
7 |
8 | # Build environment
9 | dist
10 | .cache
11 |
12 | # Package managers lockfiles
13 | package-lock.json
14 | shrinkwrap.json
15 | pnpm-lock.json
16 |
17 | # Logs
18 | logs
19 | *.log
20 | *~
21 |
22 | # Runtime data
23 | pids
24 | *.pid
25 | *.seed
26 | *.pid.lock
27 |
28 | # Directory for instrumented libs generated by jscoverage/JSCover
29 | lib-cov
30 |
31 | # Coverage directory used by tools like istanbul
32 | coverage
33 |
34 | # nyc test coverage
35 | .nyc_output
36 |
37 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
38 | .grunt
39 |
40 | # Bower dependency directory (https://bower.io/)
41 | bower_components
42 |
43 | # node-waf configuration
44 | .lock-wscript
45 |
46 | # Compiled binary addons (https://nodejs.org/api/addons.html)
47 | build/Release
48 |
49 | # Dependency directories
50 | node_modules/
51 | jspm_packages/
52 |
53 | # TypeScript v1 declaration files
54 | typings/
55 |
56 | # Optional npm cache directory
57 | .npm
58 |
59 | # Optional eslint cache
60 | .eslintcache
61 |
62 | # Optional REPL history
63 | .node_repl_history
64 |
65 | # Output of 'npm pack'
66 | *.tgz
67 |
68 | # Yarn Integrity file
69 | .yarn-integrity
70 |
71 | # dotenv environment variables file
72 | .env
73 |
74 | # next.js build output
75 | .next
76 |
77 | .astro
78 | .netlify
79 |
--------------------------------------------------------------------------------
/@packages/parse-commit-message/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const { eslintConfig } = require('eslint-config-tunnckocore');
4 |
5 | module.exports = eslintConfig;
6 |
--------------------------------------------------------------------------------
/@packages/parse-commit-message/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: ci
2 | on:
3 | push:
4 | branches:
5 | - master
6 | pull_request:
7 |
8 | jobs:
9 | my-job:
10 | name: build & test
11 | runs-on: ubuntu-latest
12 | steps:
13 | # ...
14 | - uses: actions/checkout@v4
15 | - uses: oven-sh/setup-bun@v2
16 |
17 | # run any `bun` or `bunx` command
18 | - run: bun install
19 | - run: bun run lint
20 | - run: bun run test
21 | - run: bun run build
22 |
--------------------------------------------------------------------------------
/@packages/parse-commit-message/.prettierignore:
--------------------------------------------------------------------------------
1 | __backup_packages
2 | docs
3 | CHANGELOG.md
4 | fixtures
5 | *.tsbuildinfo
6 | *.*cache
7 |
8 | *lock*
9 |
10 | # Build environment
11 | dist
12 | .cache
13 |
14 | # Package managers lockfiles
15 | package-lock.json
16 | shrinkwrap.json
17 | pnpm-lock.json
18 |
19 | # Logs
20 | logs
21 | *.log
22 | *~
23 |
24 | # Runtime data
25 | pids
26 | *.pid
27 | *.seed
28 | *.pid.lock
29 |
30 | # Directory for instrumented libs generated by jscoverage/JSCover
31 | lib-cov
32 |
33 | # Coverage directory used by tools like istanbul
34 | coverage
35 |
36 | # nyc test coverage
37 | .nyc_output
38 |
39 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
40 | .grunt
41 |
42 | # Bower dependency directory (https://bower.io/)
43 | bower_components
44 |
45 | # node-waf configuration
46 | .lock-wscript
47 |
48 | # Compiled binary addons (https://nodejs.org/api/addons.html)
49 | build/Release
50 |
51 | # Dependency directories
52 | node_modules/
53 | jspm_packages/
54 |
55 | # TypeScript v1 declaration files
56 | typings/
57 |
58 | # Optional npm cache directory
59 | .npm
60 |
61 | # Optional eslint cache
62 | .eslintcache
63 |
64 | # Optional REPL history
65 | .node_repl_history
66 |
67 | # Output of 'npm pack'
68 | *.tgz
69 |
70 | # Yarn Integrity file
71 | .yarn-integrity
72 |
73 | # dotenv environment variables file
74 | .env
75 |
76 | # next.js build output
77 | .next
78 |
79 | .astro
80 | .netlify
81 |
--------------------------------------------------------------------------------
/@packages/parse-commit-message/.prettierrc.cjs:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const { prettierConfig } = require('eslint-config-tunnckocore');
4 |
5 | module.exports = prettierConfig;
6 |
--------------------------------------------------------------------------------
/@packages/parse-commit-message/.verb.md:
--------------------------------------------------------------------------------
1 | ## API
2 |
3 |
4 |
5 | {%= include(process.cwd() + "/docs/src/plugins/is-breaking-change.md") %}
6 | {%= include(process.cwd() + "/docs/src/plugins/mentions.md") %}
7 | {%= include(process.cwd() + "/docs/src/header.md") %}
8 | {%= include(process.cwd() + "/docs/src/index.md") %}
9 | {%= include(process.cwd() + "/docs/src/commit.md") %}
10 | {%= include(process.cwd() + "/docs/src/utils.md") %}
11 | {%= include(process.cwd() + "/docs/src/main.md") %}
12 | {%= include(process.cwd() + "/docs/src/plugins/increment.md") %}
13 | {%= include(process.cwd() + "/docs/src/types.md") %}
14 |
15 |
16 |
--------------------------------------------------------------------------------
/@packages/parse-commit-message/bun.lockb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/parse-commit-message/bun.lockb
--------------------------------------------------------------------------------
/@packages/parse-commit-message/cjs-dts-files.ts:
--------------------------------------------------------------------------------
1 | import fs from 'node:fs/promises';
2 | import path from 'node:path';
3 | import proc from 'node:process';
4 |
5 | const cwd = proc.cwd();
6 | const ctsDtsFiles = (await fs.readdir('./dist'))
7 | .filter((x) => x.endsWith('.d.ts'))
8 | .map((x) => path.join(cwd, 'dist', x.replace('.ts', '.cts')));
9 |
10 | for await (const outfile of ctsDtsFiles) {
11 | // console.log(outfile, path.basename(outfile).replace('cts', 'ts'));
12 | const regularDtsFile = path.basename(outfile).replace('cts', 'ts');
13 | await Bun.write(outfile, `export * from './${regularDtsFile}';`);
14 | }
15 |
--------------------------------------------------------------------------------
/@packages/parse-commit-message/docs/src/plugins/increment.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | _Generated using [jest-runner-docs](https://ghub.now.sh/jest-runner-docs)._
4 |
5 | ### [incrementPlugin](./src/plugins/increment.ts#L27)
6 |
7 | A plugin that adds `increment` property to the `commit`.
8 | It is already included in the `plugins` named export,
9 | and in `mappers` named export.
10 |
11 | **Note: Since v4 this plugin doesn't add `isBreaking` property, use the `isBreaking` plugin instead.**
12 |
13 |
14 |
15 |
16 | #### Params
17 |
18 | - `commit` **{Commit}** - a standard `Commit` object
19 | - `options` **{object}** - options to control the header regex and case sensitivity
20 | - `options.headerRegex` **{RegExp|string}** - string regular expression or instance of RegExp
21 | - `options.caseSensitive` **{boolean}** - whether or not to be case sensitive, defaults to `false`
22 | - `returns` **{Commit}** - plus `{ increment: 'major' | 'minor' | 'patch' | '' }`
23 |
24 | _See the [.plugins](#plugins) and [.mappers](#mappers) examples._
25 |
26 |
27 |
28 | #### Examples
29 |
30 | ```js
31 | import { mappers, plugins } from 'parse-commit-message';
32 |
33 | console.log(mappers.increment); // => [Function: incrementPlugin]
34 | console.log(plugins[1]); // => [Function: incrementPlugin]
35 | ```
36 |
37 |
--------------------------------------------------------------------------------
/@packages/parse-commit-message/docs/src/plugins/is-breaking-change.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | _Generated using [jest-runner-docs](https://ghub.now.sh/jest-runner-docs)._
4 |
5 | ### [isBreakingChangePlugin](./src/plugins/is-breaking-change.ts#L31)
6 |
7 | A plugin that adds `isBreakingChange` and `isBreaking` (_deprecated_) properties
8 | to the `commit`. It is already included in the `plugins` named export,
9 | and in `mappers` named export. Be aware that there's a difference between
10 | the utility `isBreakingChange` which has named export (as everything from `src/utils`)
11 | and this plugin function.
12 |
13 | **Note: This plugin was included in v4 release version, previously was part of the `increment` plugin.**
14 |
15 |
16 |
17 | #### Signature
18 |
19 | ```ts
20 | function(commit: Commit, options?: Options)
21 | ```
22 |
23 |
24 |
25 | #### Params
26 |
27 | - `commit` **{Commit}** - a standard `Commit` object
28 | - `options` **{object}** - options to control the header regex and case sensitivity
29 | - `options.headerRegex` **{RegExp|string}** - string regular expression or instance of RegExp
30 | - `options.caseSensitive` **{boolean}** - whether or not to be case sensitive, defaults to `false`
31 | - `returns` **{Commit}** - plus `{ isBreakingChange: boolean }`
32 |
33 | _See the [.plugins](#plugins) and [.mappers](#mappers) examples._
34 |
35 |
36 |
37 | #### Examples
38 |
39 | ```js
40 | import { mappers, plugins } from 'parse-commit-message';
41 |
42 | console.log(mappers.isBreakingChange); // => [Function: isBreakingChangePlugin]
43 | console.log(plugins[2]); // => [Function: isBreakingChangePlugin]
44 | ```
45 |
46 |
--------------------------------------------------------------------------------
/@packages/parse-commit-message/docs/src/plugins/mentions.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | _Generated using [jest-runner-docs](https://ghub.now.sh/jest-runner-docs)._
4 |
5 | ### [mentionsPlugin](./src/plugins/mentions.ts#L29)
6 |
7 | A plugin that adds `mentions` array property to the `commit`.
8 | It is already included in the `plugins` named export,
9 | and in `mappers` named export.
10 | Basically each entry in that array is an object,
11 | directly returned from the [collect-mentions][].
12 |
13 |
14 |
15 | #### Signature
16 |
17 | ```ts
18 | function(commit: Commit, options?: Options): { mentions: Mention[] }
19 | ```
20 |
21 |
22 |
23 | #### Params
24 |
25 | - `commit` **{Commit}** - a standard `Commit` object
26 | - `options` **{object}** - options to control the header regex and case sensitivity
27 | - `options.headerRegex` **{RegExp|string}** - string regular expression or instance of RegExp
28 | - `options.caseSensitive` **{boolean}** - whether or not to be case sensitive, defaults to `false`
29 | - `returns` **{Commit}** - plus `{ mentions: Array }`
30 |
31 | _See the [.plugins](#plugins) and [.mappers](#mappers) examples._
32 |
33 |
34 |
35 | #### Examples
36 |
37 | ```js
38 | import { mappers, plugins } from 'parse-commit-message';
39 |
40 | console.log(mappers.mentions); // => [Function: mentionsPlugin]
41 | console.log(plugins[0]); // => [Function: mentionsPlugin]
42 | ```
43 |
44 |
--------------------------------------------------------------------------------
/@packages/parse-commit-message/docs/src/utils.md:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/@packages/parse-commit-message/example.cjs:
--------------------------------------------------------------------------------
1 | const { parseHeader } = require('./dist/index.cjs');
2 |
3 | const str = 'fix: some commit message';
4 |
5 | console.log(str, parseHeader(str));
6 |
--------------------------------------------------------------------------------
/@packages/parse-commit-message/src/plugins/increment.ts:
--------------------------------------------------------------------------------
1 | import type { Commit, Options } from '../types.ts';
2 | import { isBreakingChange, normalizeCommit } from '../utils.ts';
3 |
4 | /**
5 | * A plugin that adds `increment` property to the `commit`.
6 | * It is already included in the `plugins` named export,
7 | * and in `mappers` named export.
8 | *
9 | * **Note: Since v4 this plugin doesn't add `isBreaking` property, use the `isBreaking` plugin instead.**
10 | *
11 | * _See the [.plugins](#plugins) and [.mappers](#mappers) examples._
12 | *
13 | * @example
14 | * import { mappers, plugins } from 'parse-commit-message';
15 | *
16 | * console.log(mappers.increment); // => [Function: incrementPlugin]
17 | * console.log(plugins[1]); // => [Function: incrementPlugin]
18 | *
19 | * @name incrementPlugin
20 | * @param {Commit} commit a standard `Commit` object
21 | * @param {object} options options to control the header regex and case sensitivity
22 | * @param {RegExp|string} options.headerRegex string regular expression or instance of RegExp
23 | * @param {boolean} options.caseSensitive whether or not to be case sensitive, defaults to `false`
24 | * @returns {Commit} plus `{ increment: 'major' | 'minor' | 'patch' }`
25 | * @public
26 | */
27 | export default function incrementPlugin(
28 | commit: Commit,
29 | options?: Options,
30 | ): { increment: 'major' | 'minor' | 'patch' } {
31 | const opts = { normalize: true, ...options };
32 | const cmt: Commit = opts.normalize ? normalizeCommit(commit, opts) : commit;
33 | const isBreaking = isBreakingChange(cmt);
34 | let commitIncrement: 'major' | 'minor' | 'patch' | boolean = false;
35 |
36 | if (/fix|bugfix|patch/i.test(cmt.header.type)) {
37 | commitIncrement = 'patch';
38 | }
39 | if (/feat|feature|minor/i.test(cmt.header.type)) {
40 | commitIncrement = 'minor';
41 | }
42 | if (isBreaking) {
43 | commitIncrement = 'major';
44 | }
45 |
46 | if (!commitIncrement) {
47 | // @ts-expect-error bruh.. you're not accepting `void | { obj.. }` in return type while plugins can, so fvck off
48 | return {};
49 | }
50 |
51 | return { increment: commitIncrement };
52 | }
53 |
--------------------------------------------------------------------------------
/@packages/parse-commit-message/src/plugins/is-breaking-change.ts:
--------------------------------------------------------------------------------
1 | // import mixinDeep from 'mixin-deep';
2 |
3 | import type { Commit, Options } from '../types.ts';
4 | import { /* cleaner, */ isBreakingChange, normalizeCommit } from '../utils.ts';
5 |
6 | /**
7 | * A plugin that adds `isBreakingChange` and `isBreaking` (_deprecated_) properties
8 | * to the `commit`. It is already included in the `plugins` named export,
9 | * and in `mappers` named export. Be aware that there's a difference between
10 | * the utility `isBreakingChange` which has named export (as everything from `src/utils`)
11 | * and this plugin function.
12 | *
13 | * **Note: This plugin was included in v4 release version, previously was part of the `increment` plugin.**
14 | *
15 | * _See the [.plugins](#plugins) and [.mappers](#mappers) examples._
16 | *
17 | * @example
18 | * import { mappers, plugins } from 'parse-commit-message';
19 | *
20 | * console.log(mappers.isBreakingChange); // => [Function: isBreakingChangePlugin]
21 | * console.log(plugins[2]); // => [Function: isBreakingChangePlugin]
22 | *
23 | * @name isBreakingChangePlugin
24 | * @param {Commit} commit a standard `Commit` object
25 | * @param {object} options options to control the header regex and case sensitivity
26 | * @param {RegExp|string} options.headerRegex string regular expression or instance of RegExp
27 | * @param {boolean} options.caseSensitive whether or not to be case sensitive, defaults to `false`
28 | * @returns {Commit} plus `{ isBreakingChange: boolean }`
29 | * @public
30 | */
31 | export default function isBreakingChangePlugin(commit: Commit, options?: Options) {
32 | const opts = { normalize: true, ...options };
33 | const cmt = opts.normalize ? normalizeCommit(commit, opts) : commit;
34 | const isBreaking = isBreakingChange(cmt);
35 |
36 | return {
37 | isBreakingChange: isBreaking,
38 | isBreaking, // ! deprecated
39 | };
40 | // return mixinDeep(cleaner(cmt), {
41 | // isBreakingChange: isBreaking,
42 | // isBreaking, // ! deprecated
43 | // });
44 | }
45 |
--------------------------------------------------------------------------------
/@packages/parse-commit-message/src/plugins/mentions.ts:
--------------------------------------------------------------------------------
1 | import getMentions from 'collect-mentions';
2 |
3 | import type { Commit, Mention, Options } from '../types.ts';
4 | import { normalizeCommit /* getValue */ } from '../utils.ts';
5 |
6 | /**
7 | * A plugin that adds `mentions` array property to the `commit`.
8 | * It is already included in the `plugins` named export,
9 | * and in `mappers` named export.
10 | * Basically each entry in that array is an object,
11 | * directly returned from the [collect-mentions][].
12 | *
13 | * _See the [.plugins](#plugins) and [.mappers](#mappers) examples._
14 | *
15 | * @example
16 | * import { mappers, plugins } from 'parse-commit-message';
17 | *
18 | * console.log(mappers.mentions); // => [Function: mentionsPlugin]
19 | * console.log(plugins[0]); // => [Function: mentionsPlugin]
20 | *
21 | * @name mentionsPlugin
22 | * @param {Commit} commit a standard `Commit` object
23 | * @param {object} options options to control the header regex and case sensitivity
24 | * @param {RegExp|string} options.headerRegex string regular expression or instance of RegExp
25 | * @param {boolean} options.caseSensitive whether or not to be case sensitive, defaults to `false`
26 | * @returns {Commit} plus `{ mentions: Array }`
27 | * @public
28 | */
29 | export default function mentionsPlugin(commit: Commit, options?: Options): { mentions: Mention[] } {
30 | const opts = { normalize: true, mentionsWithDot: false, ...options };
31 | const cmt = opts.normalize ? normalizeCommit(commit, opts) : commit;
32 |
33 | const commitMentions = [
34 | getMentions(
35 | cmt.header?.subject || ((cmt.header as any)?.value as any) || '',
36 | opts.mentionsWithDot,
37 | ),
38 | ]
39 | .flat()
40 | .concat(getMentions(cmt.body || '', opts.mentionsWithDot))
41 | .concat(getMentions(cmt.footer || '', opts.mentionsWithDot));
42 |
43 | return { mentions: commitMentions };
44 | }
45 |
--------------------------------------------------------------------------------
/@packages/parse-commit-message/src/types.ts:
--------------------------------------------------------------------------------
1 | export type Result = {
2 | error?: Error;
3 | value?: T;
4 | };
5 |
6 | export type Mention = {
7 | index: number;
8 | handle: string;
9 | mention: string;
10 | };
11 |
12 | export type Header = {
13 | type: string;
14 | scope?: string | null;
15 | subject: string;
16 | };
17 |
18 | export type SimpleHeader = {
19 | value: string;
20 | };
21 |
22 | export type GenericCommit = {
23 | header: T;
24 | body?: string | null;
25 | footer?: string | null;
26 | increment?: string;
27 | isBreaking?: boolean;
28 | mentions?: Array;
29 | };
30 |
31 | export type Commit = GenericCommit;
32 | export type BasicCommit = GenericCommit;
33 |
34 | export type PossibleCommit = string | Commit | BasicCommit | Commit[] | BasicCommit[];
35 |
36 | export type Plugin = (
37 | commit: PossibleCommit,
38 | normalize?: boolean,
39 | ) => void | Record | Commit | BasicCommit;
40 | export type Plugins = Plugin | Array;
41 |
42 | export type Mappers = {
43 | mentions: Plugin;
44 | isBreaking: Plugin;
45 | isBreakingChange: Plugin;
46 | };
47 |
48 | export type Options = {
49 | caseSensitive?: boolean;
50 | headerRegex?: RegExp | string;
51 | mentionsWithDot?: boolean;
52 | normalize?: boolean;
53 | };
54 |
--------------------------------------------------------------------------------
/@packages/parse-commit-message/test/header/parse.ts:
--------------------------------------------------------------------------------
1 | import { expect, test } from 'bun:test';
2 |
3 | import { parseHeader } from '../../src/header.ts';
4 |
5 | test('.parseHeader throw if not a string given', () => {
6 | // @ts-expect-error yeah
7 | expect(() => parseHeader(123)).toThrow(TypeError);
8 | // @ts-expect-error yeah
9 | expect(() => parseHeader(123)).toThrow(/expect `header` to be non empty string/);
10 | expect(() => parseHeader('')).toThrow(/expect `header` to be non empty string/);
11 | });
12 |
13 | test('.parseHeader throw when invalid conventional commits', () => {
14 | expect(() => parseHeader('fix bar qux')).toThrow(Error);
15 | expect(() => parseHeader('fix bar qux')).toThrow(/\[optional scope]: /);
16 | });
17 |
18 | test('.parseHeader NOT throw when header is valid by conventional commits', () => {
19 | const one = parseHeader('fix: zzz qux');
20 | const two = parseHeader('fix(cli): aaaa qux');
21 | const res = parseHeader('fix(cli): qqqqq qux\n\nSome awesome body');
22 |
23 | expect(one && typeof one === 'object').toBe(true);
24 | expect(two && typeof two === 'object').toBe(true);
25 | expect(res && typeof res === 'object').toBe(true);
26 | });
27 |
28 | test('.parseHeader correctly header string without scope', () => {
29 | const result = parseHeader('fix: bar qux');
30 |
31 | expect(result).toMatchObject({
32 | type: 'fix',
33 | scope: null,
34 | subject: 'bar qux',
35 | });
36 | });
37 |
38 | test('.parseHeader header string with scope', () => {
39 | expect(parseHeader('fix(cli): bar qux')).toMatchObject({
40 | type: 'fix',
41 | scope: 'cli',
42 | subject: 'bar qux',
43 | });
44 | });
45 |
--------------------------------------------------------------------------------
/@packages/parse-commit-message/test/header/stringify.ts:
--------------------------------------------------------------------------------
1 | import { expect, test } from 'bun:test';
2 |
3 | import { stringifyHeader } from '../../src/header.ts';
4 |
5 | test('.stringifyHeader throw if invalid header is given', () => {
6 | // @ts-expect-error bruh, yeah, I know it's invalid
7 | expect(() => stringifyHeader(1234)).toThrow(TypeError);
8 | // @ts-expect-error bruh, yeah, I know it's invalid
9 | expect(() => stringifyHeader({ type: 'foo' })).toThrow(TypeError);
10 | // @ts-expect-error bruh, yeah, I know it's invalid
11 | expect(() => stringifyHeader()).toThrow(TypeError);
12 | });
13 |
14 | test('.stringifyHeader object', () => {
15 | const header = { type: 'fix', scope: 'huh', subject: 'yeah yeah' };
16 | const result = stringifyHeader(header);
17 |
18 | expect(result).toStrictEqual('fix(huh): yeah yeah');
19 | });
20 |
21 | test('.stringifyHeader object without scope', () => {
22 | const header = { type: 'fix', subject: 'yeah yeah' };
23 | const result = stringifyHeader(header);
24 |
25 | expect(result).toStrictEqual('fix: yeah yeah');
26 | });
27 |
28 | test('.stringifyHeader simple header object with just { value: string } ', () => {
29 | const str = stringifyHeader({ value: 'fix(bar): ok ok' });
30 |
31 | expect(str).toStrictEqual('fix(bar): ok ok');
32 | });
33 |
34 | test('.stringifyHeader throw when {value} and not valid conventional commit header', () => {
35 | // ? not sure if it make sense to throw,
36 | // ? and at all, does such case make any sense...
37 |
38 | expect(() =>
39 | stringifyHeader({
40 | value: 'foo bar qux',
41 | }),
42 | ).toThrow(TypeError);
43 | });
44 |
--------------------------------------------------------------------------------
/@packages/parse-commit-message/test/header/validate.ts:
--------------------------------------------------------------------------------
1 | import { expect, test } from 'bun:test';
2 |
3 | import { validateHeader } from '../../src/header.ts';
4 |
5 | test('.validateHeader should return { error }', () => {
6 | // @ts-expect-error bruh, yeah, I know it's invalid
7 | const res = validateHeader({ type: 'fix' });
8 |
9 | expect(res.error).toBeTruthy();
10 | expect(res.value).toBeFalsy();
11 | expect(res.error?.message).toMatch(/header\.subject should be non empty string/);
12 | });
13 |
14 | test('.validateHeader should return { value }', () => {
15 | const result = validateHeader({ type: 'fix', subject: 'bar qux' });
16 | expect(result).toMatchObject({
17 | value: { type: 'fix', scope: null, subject: 'bar qux' },
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/@packages/parse-commit-message/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/tsconfig",
3 | "extends": ["eslint-config-tunnckocore/tsconfig.json"],
4 | "include": ["**/*.ts", "**/*.cjs"],
5 | "exclude": ["node_modules", "dist"],
6 | "compilerOptions": {
7 | "allowJs": true,
8 | "checkJs": true,
9 | },
10 | // "compilerOptions": {
11 | // // Enable latest features
12 | // "lib": ["ESNext", "DOM"],
13 | // "target": "ESNext",
14 | // "module": "ESNext",
15 | // "moduleDetection": "force",
16 | // "jsx": "react-jsx",
17 | // "allowJs": true,
18 |
19 | // // Bundler mode
20 | // "moduleResolution": "bundler",
21 | // "allowImportingTsExtensions": true,
22 | // "verbatimModuleSyntax": true,
23 | // "noEmit": true,
24 |
25 | // // Best practices
26 | // "strict": true,
27 | // "skipLibCheck": true,
28 | // "noFallthroughCasesInSwitch": true,
29 |
30 | // // Some stricter flags (disabled by default)
31 | // "noUnusedLocals": false,
32 | // "noUnusedParameters": false,
33 | // "noPropertyAccessFromIndexSignature": false,
34 |
35 | // "exactOptionalPropertyTypes": false,
36 | // "baseUrl": ".",
37 | // "strictNullChecks": true // add if using `base` template
38 | // }
39 | }
40 |
--------------------------------------------------------------------------------
/@packages/parse-commit-message/tsup.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'tsup';
2 |
3 | const cfg = {
4 | target: 'es2023',
5 | entry: ['src/index.ts'],
6 | splitting: false,
7 | clean: true,
8 | banner: { js: '// SPDX-License-Identifier: MPL-2.0' },
9 | cjsInterop: false,
10 | dts: true,
11 | format: 'esm',
12 | };
13 |
14 | // @ts-expect-error bro...
15 | export default defineConfig([{ ...cfg }, { ...cfg, format: 'cjs', dts: false }]);
16 |
--------------------------------------------------------------------------------
/@packages/parse-function/.verb.head.md:
--------------------------------------------------------------------------------
1 | ## Features
2 |
3 | - **Always up-to-date:** auto-publish new version when new version of dependency
4 | is out, [Renovate](https://renovateapp.com)
5 | - **Standard:** using StandardJS, Prettier, SemVer, Semantic Release and
6 | conventional commits
7 | - **Smart Plugins:** for extending the core API or the end [Result](#result),
8 | see [.use](#use) method and [Plugins Architecture](#plugins-architecture)
9 | - **Extensible:** using plugins for working directly on AST nodes, see the
10 | [Plugins Architecture](#plugins-architecture)
11 | - **ES2020+ Ready:** by using `.parseExpression` method of the Babel `v7.x`
12 | parser
13 | - **Customization:** allows switching the parser, through `options.parse`
14 | - **Support for:** arrow functions, default parameters, generators and
15 | async/await functions
16 | - **Stable:** battle-tested in production and against all parsers - [espree][],
17 | [acorn][], [@babel/parser](https://npmjs.com/packages/@babel/parser)
18 | - **Tested:** with [450+ tests](./test/index.js) for _200%_ coverage
19 |
--------------------------------------------------------------------------------
/@packages/parse-function/.verb.logo.md:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
--------------------------------------------------------------------------------
/@packages/parse-function/docs/src/plugins/body.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/parse-function/docs/src/plugins/body.md
--------------------------------------------------------------------------------
/@packages/parse-function/docs/src/plugins/initial.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/parse-function/docs/src/plugins/initial.md
--------------------------------------------------------------------------------
/@packages/parse-function/docs/src/plugins/params.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/parse-function/docs/src/plugins/params.md
--------------------------------------------------------------------------------
/@packages/parse-function/docs/src/plugins/props.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/parse-function/docs/src/plugins/props.md
--------------------------------------------------------------------------------
/@packages/parse-function/docs/src/utils.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/parse-function/docs/src/utils.md
--------------------------------------------------------------------------------
/@packages/parse-function/src/plugins/body.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable no-param-reassign, unicorn/consistent-function-scoping */
2 |
3 | /**
4 | * > Micro plugin to get the raw body, without the
5 | * surrounding curly braces. It also preserves
6 | * the whitespaces and newlines - they are original.
7 | *
8 | * @param {object} `node`
9 | * @param {object} `result`
10 | * @return {object} `result`
11 | * @private
12 | */
13 | export default () => (node, result) => {
14 | result.body = result.value.slice(node.body.start, node.body.end);
15 |
16 | const openCurly = result.body.charCodeAt(0) === 123;
17 | const closeCurly = result.body.charCodeAt(result.body.length - 1) === 125;
18 |
19 | if (openCurly && closeCurly) {
20 | result.body = result.body.slice(1, -1);
21 | }
22 |
23 | return result;
24 | };
25 |
--------------------------------------------------------------------------------
/@packages/parse-function/src/plugins/initial.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable no-param-reassign */
2 |
3 | import body from './body.js';
4 | import props from './props.js';
5 | import params from './params.js';
6 |
7 | /**
8 | * > Default plugin that handles regular functions,
9 | * arrow functions, generator functions
10 | * and ES6 object method notation.
11 | *
12 | * @param {object} `node`
13 | * @param {object} `result`
14 | * @return {object} `resul`
15 | * @private
16 | */
17 | export default (app) => (node, result) => {
18 | const isFn = node.type.endsWith('FunctionExpression');
19 | const isMethod = node.type === 'ObjectExpression';
20 |
21 | /* istanbul ignore next */
22 | if (!isFn && !isMethod) {
23 | return;
24 | }
25 |
26 | node = isMethod ? node.properties[0] : node;
27 | node.id = isMethod ? node.key : node.id;
28 |
29 | // babylon node.properties[0] is `ObjectMethod` that has `params` and `body`;
30 | // acorn node.properties[0] is `Property` that has `value`;
31 | if (node.type === 'Property') {
32 | const id = node.key;
33 | node = node.value;
34 | node.id = id;
35 | }
36 |
37 | result = props(app)(node, result);
38 | result = params(app)(node, result);
39 | result = body(app)(node, result);
40 |
41 | // eslint-disable-next-line consistent-return
42 | return result;
43 | };
44 |
--------------------------------------------------------------------------------
/@packages/parse-function/src/plugins/params.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable no-param-reassign, unicorn/consistent-function-scoping */
2 |
3 | /**
4 | * > Micro plugin to visit each of the params
5 | * in the given function and collect them into
6 | * an `result.args` array and `result.params` string.
7 | *
8 | * @param {object} `node`
9 | * @param {object} `result`
10 | * @return {object} `result`
11 | * @private
12 | */
13 | export default () => (node, result) => {
14 | for (const param of node.params) {
15 | const defaultArgsName =
16 | param.type === 'AssignmentPattern' && param.left && param.left.name;
17 |
18 | const restArgName =
19 | param.type === 'RestElement' && param.argument && param.argument.name;
20 |
21 | const name = param.name || defaultArgsName || restArgName;
22 |
23 | result.args.push(name);
24 |
25 | if (param.right && param.right.type === 'SequenceExpression') {
26 | const lastExpression = param.right.expressions.pop();
27 |
28 | result.defaults[name] = result.value.slice(
29 | lastExpression.start,
30 | lastExpression.end,
31 | );
32 | } else {
33 | result.defaults[name] = param.right
34 | ? result.value.slice(param.right.start, param.right.end)
35 | : undefined;
36 | }
37 | }
38 | result.params = result.args.join(', ');
39 |
40 | return result;
41 | };
42 |
--------------------------------------------------------------------------------
/@packages/parse-function/src/plugins/props.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable no-param-reassign */
2 | /**
3 | * > Set couple of hidden properties and
4 | * the name of the given function to
5 | * the returned result object. Notice that
6 | * if function is called "anonymous" then
7 | * the `result.isAnonymous` would be `false`, because
8 | * in reality it is named function. It would be `true`
9 | * only when function is really anonymous and don't have
10 | * any name.
11 | *
12 | * @param {object} `node`
13 | * @param {object} `result`
14 | * @return {object} `result`
15 | * @private
16 | */
17 | // eslint-disable-next-line unicorn/consistent-function-scoping
18 | export default () => (node, result) => {
19 | result.isArrow = node.type.startsWith('Arrow');
20 | result.isAsync = node.async || false;
21 | result.isGenerator = node.generator || false;
22 | result.isExpression = node.expression || false;
23 | result.isAnonymous = node.id === null;
24 | result.isNamed = !result.isAnonymous;
25 |
26 | // if real anonymous -> set to null,
27 | // notice that you can name you function `anonymous`, haha
28 | // and it won't be "real" anonymous, so `isAnonymous` will be `false`
29 |
30 | result.name = result.isAnonymous ? null : node.id.name;
31 |
32 | return result;
33 | };
34 |
--------------------------------------------------------------------------------
/@packages/parse-function/src/utils.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable no-param-reassign */
2 | import arrayify from 'arrify';
3 | import { parseExpression } from '@babel/parser';
4 |
5 | const utils = {};
6 |
7 | utils.arrayify = arrayify;
8 |
9 | /**
10 | * > Create default result object,
11 | * and normalize incoming arguments.
12 | *
13 | * @param {function|string} code
14 | * @return {object} result
15 | * @private
16 | */
17 | utils.setDefaults = function setDefaults(code) {
18 | const result = {
19 | name: null,
20 | body: '',
21 | args: [],
22 | params: '',
23 | };
24 |
25 | if (typeof code === 'function') {
26 | code = code.toString('utf8');
27 | }
28 |
29 | // makes result.isValid === false
30 | if (typeof code !== 'string') {
31 | code = '';
32 | }
33 |
34 | return utils.setHiddenDefaults(result, code || '');
35 | };
36 |
37 | /**
38 | * > Create hidden properties into
39 | * the result object.
40 | *
41 | * @param {object} result
42 | * @param {Function|string} code
43 | * @return {object} result
44 | * @private
45 | */
46 | utils.setHiddenDefaults = function setHiddenDefaults(result, code) {
47 | result.defaults = {};
48 | result.value = code;
49 | result.isValid = code.length > 0;
50 | result.isArrow = false;
51 | result.isAsync = false;
52 | result.isNamed = false;
53 | result.isAnonymous = false;
54 | result.isGenerator = false;
55 | result.isExpression = false;
56 |
57 | return result;
58 | };
59 |
60 | /**
61 | * > Get needed AST tree, depending on what
62 | * parse method is used.
63 | *
64 | * @param {object} result
65 | * @param {object} opts
66 | * @return {object} node
67 | * @private
68 | */
69 | utils.getNode = function getNode(result, opts) {
70 | if (typeof opts.parse === 'function') {
71 | result.value = `(${result.value})`;
72 |
73 | const ast = opts.parse(result.value, opts);
74 | const body = (ast.program && ast.program.body) || ast.body;
75 |
76 | return body[0].expression;
77 | }
78 |
79 | return parseExpression(result.value, opts);
80 | };
81 |
82 | export default utils;
83 |
--------------------------------------------------------------------------------
/@packages/prettier-plugin-pkgjson/.verb.md:
--------------------------------------------------------------------------------
1 | ## API
2 |
3 |
4 |
5 | {%= include(process.cwd() + "/docs/src/index.md") %}
6 |
7 |
8 |
--------------------------------------------------------------------------------
/@packages/prettier-plugin-pkgjson/docs/src/index.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/prettier-plugin-pkgjson/docs/src/index.md
--------------------------------------------------------------------------------
/@packages/prettier-plugin-pkgjson/test/index.js:
--------------------------------------------------------------------------------
1 | const mod = require('../src');
2 |
3 | test('todo tests for prettier-plugin-pkgjson package', async () => {
4 | expect(typeof mod).toStrictEqual('object');
5 | expect(mod).toHaveProperty('parsers');
6 | expect(mod).toHaveProperty('name');
7 | expect(mod.name).toStrictEqual('prettier-plugin-pkgjson');
8 | });
9 |
--------------------------------------------------------------------------------
/@packages/recommended-bump-cli/.eslintignore:
--------------------------------------------------------------------------------
1 | __backup_packages
2 |
3 | CHANGELOG.md
4 | fixtures
5 | *.tsbuildinfo
6 | *.*cache
7 |
8 | # Build environment
9 | dist
10 | .cache
11 |
12 | # Package managers lockfiles
13 | package-lock.json
14 | shrinkwrap.json
15 | pnpm-lock.json
16 |
17 | # Logs
18 | logs
19 | *.log
20 | *~
21 |
22 | # Runtime data
23 | pids
24 | *.pid
25 | *.seed
26 | *.pid.lock
27 |
28 | # Directory for instrumented libs generated by jscoverage/JSCover
29 | lib-cov
30 |
31 | # Coverage directory used by tools like istanbul
32 | coverage
33 |
34 | # nyc test coverage
35 | .nyc_output
36 |
37 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
38 | .grunt
39 |
40 | # Bower dependency directory (https://bower.io/)
41 | bower_components
42 |
43 | # node-waf configuration
44 | .lock-wscript
45 |
46 | # Compiled binary addons (https://nodejs.org/api/addons.html)
47 | build/Release
48 |
49 | # Dependency directories
50 | node_modules/
51 | jspm_packages/
52 |
53 | # TypeScript v1 declaration files
54 | typings/
55 |
56 | # Optional npm cache directory
57 | .npm
58 |
59 | # Optional eslint cache
60 | .eslintcache
61 |
62 | # Optional REPL history
63 | .node_repl_history
64 |
65 | # Output of 'npm pack'
66 | *.tgz
67 |
68 | # Yarn Integrity file
69 | .yarn-integrity
70 |
71 | # dotenv environment variables file
72 | .env
73 |
74 | # next.js build output
75 | .next
76 |
77 | .astro
78 | .netlify
79 |
--------------------------------------------------------------------------------
/@packages/recommended-bump-cli/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const { eslintConfig } = require('eslint-config-tunnckocore');
4 |
5 | module.exports = eslintConfig;
6 |
--------------------------------------------------------------------------------
/@packages/recommended-bump-cli/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: ci
2 | on:
3 | push:
4 | branches:
5 | - master
6 | pull_request:
7 |
8 | jobs:
9 | my-job:
10 | name: build & test
11 | runs-on: ubuntu-latest
12 | steps:
13 | # ...
14 | - uses: actions/checkout@v4
15 | - uses: oven-sh/setup-bun@v2
16 |
17 | # run any `bun` or `bunx` command
18 | - run: bun install
19 | - run: bun run lint
20 | - run: bun run test
21 | - run: bun run build
22 |
--------------------------------------------------------------------------------
/@packages/recommended-bump-cli/.prettierignore:
--------------------------------------------------------------------------------
1 | __backup_packages
2 | docs
3 | .verb.md
4 | CHANGELOG.md
5 | fixtures
6 | *.tsbuildinfo
7 | *.*cache
8 |
9 | *lock*
10 |
11 | # Build environment
12 | dist
13 | .cache
14 |
15 | # Package managers lockfiles
16 | package-lock.json
17 | shrinkwrap.json
18 | pnpm-lock.json
19 |
20 | # Logs
21 | logs
22 | *.log
23 | *~
24 |
25 | # Runtime data
26 | pids
27 | *.pid
28 | *.seed
29 | *.pid.lock
30 |
31 | # Directory for instrumented libs generated by jscoverage/JSCover
32 | lib-cov
33 |
34 | # Coverage directory used by tools like istanbul
35 | coverage
36 |
37 | # nyc test coverage
38 | .nyc_output
39 |
40 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
41 | .grunt
42 |
43 | # Bower dependency directory (https://bower.io/)
44 | bower_components
45 |
46 | # node-waf configuration
47 | .lock-wscript
48 |
49 | # Compiled binary addons (https://nodejs.org/api/addons.html)
50 | build/Release
51 |
52 | # Dependency directories
53 | node_modules/
54 | jspm_packages/
55 |
56 | # TypeScript v1 declaration files
57 | typings/
58 |
59 | # Optional npm cache directory
60 | .npm
61 |
62 | # Optional eslint cache
63 | .eslintcache
64 |
65 | # Optional REPL history
66 | .node_repl_history
67 |
68 | # Output of 'npm pack'
69 | *.tgz
70 |
71 | # Yarn Integrity file
72 | .yarn-integrity
73 |
74 | # dotenv environment variables file
75 | .env
76 |
77 | # next.js build output
78 | .next
79 |
80 | .astro
81 | .netlify
82 |
--------------------------------------------------------------------------------
/@packages/recommended-bump-cli/.prettierrc.cjs:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const { prettierConfig } = require('eslint-config-tunnckocore');
4 |
5 | module.exports = prettierConfig;
6 |
--------------------------------------------------------------------------------
/@packages/recommended-bump-cli/.verb.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/@packages/recommended-bump-cli/bun.lockb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/recommended-bump-cli/bun.lockb
--------------------------------------------------------------------------------
/@packages/recommended-bump-cli/docs/src/cli.md:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/@packages/recommended-bump-cli/src/cli.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | import proc from 'node:process';
4 | import { yaro } from 'yaro';
5 | import { getRawCommits } from 'git-raw-commits';
6 | import recommendedBump from 'recommended-bump';
7 |
8 | const rbc = yaro
9 | .command('', 'Calculate next version based on Conventional Commits')
10 | .option('--cwd', 'Working directory', proc.cwd())
11 | .option('--from', 'From git commit', 'HEAD~1')
12 | .option('--to', 'To git commit', 'HEAD')
13 | .action(async (flags) => {
14 | let increment;
15 |
16 | // console.log('foo');
17 |
18 | for await (const cmt of getRawCommits(flags)) {
19 | if (typeof increment !== 'string') {
20 | increment = recommendedBump(cmt).increment;
21 | }
22 | }
23 |
24 | if (increment) {
25 | console.log(increment);
26 | }
27 | });
28 |
29 | await yaro.run({
30 | commands: { rbc },
31 | // rootCommand: rbc,
32 | version: '3.0.0',
33 | name: 'recommended-bump-cli',
34 | showHelpOnEmpty: true,
35 | });
36 |
--------------------------------------------------------------------------------
/@packages/recommended-bump-cli/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/tsconfig",
3 | "extends": ["eslint-config-tunnckocore/tsconfig.json"],
4 | "include": ["**/*.ts", "**/*.cjs", "**/*.js"],
5 | "exclude": ["node_modules", "dist"],
6 | "compilerOptions": {
7 | "allowJs": true,
8 | "checkJs": true,
9 | },
10 | // "compilerOptions": {
11 | // // Enable latest features
12 | // "lib": ["ESNext", "DOM"],
13 | // "target": "ESNext",
14 | // "module": "ESNext",
15 | // "moduleDetection": "force",
16 | // "jsx": "react-jsx",
17 | // "allowJs": true,
18 |
19 | // // Bundler mode
20 | // "moduleResolution": "bundler",
21 | // "allowImportingTsExtensions": true,
22 | // "verbatimModuleSyntax": true,
23 | // "noEmit": true,
24 |
25 | // // Best practices
26 | // "strict": true,
27 | // "skipLibCheck": true,
28 | // "noFallthroughCasesInSwitch": true,
29 |
30 | // // Some stricter flags (disabled by default)
31 | // "noUnusedLocals": false,
32 | // "noUnusedParameters": false,
33 | // "noPropertyAccessFromIndexSignature": false,
34 |
35 | // "exactOptionalPropertyTypes": false,
36 | // "baseUrl": ".",
37 | // "strictNullChecks": true // add if using `base` template
38 | // }
39 | }
40 |
--------------------------------------------------------------------------------
/@packages/recommended-bump/.eslintignore:
--------------------------------------------------------------------------------
1 | __backup_packages
2 |
3 | CHANGELOG.md
4 | fixtures
5 | *.tsbuildinfo
6 | *.*cache
7 |
8 | # Build environment
9 | dist
10 | .cache
11 |
12 | # Package managers lockfiles
13 | package-lock.json
14 | shrinkwrap.json
15 | pnpm-lock.json
16 |
17 | # Logs
18 | logs
19 | *.log
20 | *~
21 |
22 | # Runtime data
23 | pids
24 | *.pid
25 | *.seed
26 | *.pid.lock
27 |
28 | # Directory for instrumented libs generated by jscoverage/JSCover
29 | lib-cov
30 |
31 | # Coverage directory used by tools like istanbul
32 | coverage
33 |
34 | # nyc test coverage
35 | .nyc_output
36 |
37 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
38 | .grunt
39 |
40 | # Bower dependency directory (https://bower.io/)
41 | bower_components
42 |
43 | # node-waf configuration
44 | .lock-wscript
45 |
46 | # Compiled binary addons (https://nodejs.org/api/addons.html)
47 | build/Release
48 |
49 | # Dependency directories
50 | node_modules/
51 | jspm_packages/
52 |
53 | # TypeScript v1 declaration files
54 | typings/
55 |
56 | # Optional npm cache directory
57 | .npm
58 |
59 | # Optional eslint cache
60 | .eslintcache
61 |
62 | # Optional REPL history
63 | .node_repl_history
64 |
65 | # Output of 'npm pack'
66 | *.tgz
67 |
68 | # Yarn Integrity file
69 | .yarn-integrity
70 |
71 | # dotenv environment variables file
72 | .env
73 |
74 | # next.js build output
75 | .next
76 |
77 | .astro
78 | .netlify
79 |
--------------------------------------------------------------------------------
/@packages/recommended-bump/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const { eslintConfig } = require('eslint-config-tunnckocore');
4 |
5 | module.exports = eslintConfig;
6 |
--------------------------------------------------------------------------------
/@packages/recommended-bump/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: ci
2 | on:
3 | push:
4 | branches:
5 | - master
6 | pull_request:
7 |
8 | jobs:
9 | my-job:
10 | name: build & test
11 | runs-on: ubuntu-latest
12 | steps:
13 | # ...
14 | - uses: actions/checkout@v4
15 | - uses: oven-sh/setup-bun@v2
16 |
17 | # run any `bun` or `bunx` command
18 | - run: bun install
19 | - run: bun run lint
20 | - run: bun run test
21 | - run: bun run build
22 |
--------------------------------------------------------------------------------
/@packages/recommended-bump/.prettierignore:
--------------------------------------------------------------------------------
1 | __backup_packages
2 | docs
3 | .verb.md
4 | CHANGELOG.md
5 | fixtures
6 | *.tsbuildinfo
7 | *.*cache
8 |
9 | *lock*
10 |
11 | # Build environment
12 | dist
13 | .cache
14 |
15 | # Package managers lockfiles
16 | package-lock.json
17 | shrinkwrap.json
18 | pnpm-lock.json
19 |
20 | # Logs
21 | logs
22 | *.log
23 | *~
24 |
25 | # Runtime data
26 | pids
27 | *.pid
28 | *.seed
29 | *.pid.lock
30 |
31 | # Directory for instrumented libs generated by jscoverage/JSCover
32 | lib-cov
33 |
34 | # Coverage directory used by tools like istanbul
35 | coverage
36 |
37 | # nyc test coverage
38 | .nyc_output
39 |
40 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
41 | .grunt
42 |
43 | # Bower dependency directory (https://bower.io/)
44 | bower_components
45 |
46 | # node-waf configuration
47 | .lock-wscript
48 |
49 | # Compiled binary addons (https://nodejs.org/api/addons.html)
50 | build/Release
51 |
52 | # Dependency directories
53 | node_modules/
54 | jspm_packages/
55 |
56 | # TypeScript v1 declaration files
57 | typings/
58 |
59 | # Optional npm cache directory
60 | .npm
61 |
62 | # Optional eslint cache
63 | .eslintcache
64 |
65 | # Optional REPL history
66 | .node_repl_history
67 |
68 | # Output of 'npm pack'
69 | *.tgz
70 |
71 | # Yarn Integrity file
72 | .yarn-integrity
73 |
74 | # dotenv environment variables file
75 | .env
76 |
77 | # next.js build output
78 | .next
79 |
80 | .astro
81 | .netlify
82 |
--------------------------------------------------------------------------------
/@packages/recommended-bump/.prettierrc.cjs:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const { prettierConfig } = require('eslint-config-tunnckocore');
4 |
5 | module.exports = prettierConfig;
6 |
--------------------------------------------------------------------------------
/@packages/recommended-bump/.verb.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | {%= include(process.cwd() + "/docs/src/index.md") %}
4 | {%= include(process.cwd() + "/docs/src/cli.md") %}
5 |
6 |
7 |
--------------------------------------------------------------------------------
/@packages/recommended-bump/bun.lockb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@packages/recommended-bump/bun.lockb
--------------------------------------------------------------------------------
/@packages/recommended-bump/cjs-dts-files.ts:
--------------------------------------------------------------------------------
1 | import fs from 'node:fs/promises';
2 | import path from 'node:path';
3 | import proc from 'node:process';
4 |
5 | const cwd = proc.cwd();
6 | const ctsDtsFiles = (await fs.readdir('./dist'))
7 | .filter((x) => x.endsWith('.d.ts'))
8 | .map((x) => path.join(cwd, 'dist', x.replace('.ts', '.cts')));
9 |
10 | for await (const outfile of ctsDtsFiles) {
11 | // console.log(outfile, path.basename(outfile).replace('cts', 'ts'));
12 | const regularDtsFile = path.basename(outfile).replace('cts', 'ts');
13 | await Bun.write(outfile, `export * from './${regularDtsFile}';`);
14 | }
15 |
--------------------------------------------------------------------------------
/@packages/recommended-bump/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/tsconfig",
3 | "extends": ["eslint-config-tunnckocore/tsconfig.json"],
4 | "include": ["**/*.ts", "**/*.cjs"],
5 | "exclude": ["node_modules", "dist"],
6 | "compilerOptions": {
7 | "allowJs": true,
8 | "checkJs": true,
9 | },
10 | // "compilerOptions": {
11 | // // Enable latest features
12 | // "lib": ["ESNext", "DOM"],
13 | // "target": "ESNext",
14 | // "module": "ESNext",
15 | // "moduleDetection": "force",
16 | // "jsx": "react-jsx",
17 | // "allowJs": true,
18 |
19 | // // Bundler mode
20 | // "moduleResolution": "bundler",
21 | // "allowImportingTsExtensions": true,
22 | // "verbatimModuleSyntax": true,
23 | // "noEmit": true,
24 |
25 | // // Best practices
26 | // "strict": true,
27 | // "skipLibCheck": true,
28 | // "noFallthroughCasesInSwitch": true,
29 |
30 | // // Some stricter flags (disabled by default)
31 | // "noUnusedLocals": false,
32 | // "noUnusedParameters": false,
33 | // "noPropertyAccessFromIndexSignature": false,
34 |
35 | // "exactOptionalPropertyTypes": false,
36 | // "baseUrl": ".",
37 | // "strictNullChecks": true // add if using `base` template
38 | // }
39 | }
40 |
--------------------------------------------------------------------------------
/@packages/recommended-bump/tsup.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'tsup';
2 |
3 | const cfg = {
4 | target: 'es2023',
5 | entry: ['src/index.ts'],
6 | splitting: false,
7 | clean: true,
8 | banner: { js: '// SPDX-License-Identifier: Apache-2.0' },
9 | cjsInterop: false,
10 | dts: true,
11 | format: 'esm',
12 | };
13 |
14 | export default defineConfig([
15 | // @ts-expect-error bruh
16 | { ...cfg },
17 | // @ts-expect-error bruh
18 | { ...cfg, format: 'cjs', dts: false },
19 | ]);
20 |
--------------------------------------------------------------------------------
/@packages/stringify-github-short-url/.verb.md:
--------------------------------------------------------------------------------
1 | ## API
2 |
3 |
4 |
5 | {%= include(process.cwd() + "/docs/src/index.md") %}
6 |
7 |
8 |
--------------------------------------------------------------------------------
/@packages/stringify-github-short-url/docs/src/index.md:
--------------------------------------------------------------------------------
1 | _Generated using [jest-runner-docs](https://ghub.now.sh/jest-runner-docs)._
2 |
3 | ### [stringifyGithubShortUrl](./src/index.js#L30)
4 |
5 | Generate github / npm shorthand from list of arguments or object.
6 |
7 |
8 |
9 | #### Signature
10 |
11 | ```ts
12 | function(owner, name, branch, npm)
13 | ```
14 |
15 |
16 |
17 | #### Params
18 |
19 | - `` **{string|object}** - user or org string, or object
20 | - `[name]` **{string}** - repo name
21 | - `[branch]` **{string}** - branch name
22 | - `[npm]` **{string}** - pass `true` if you want to generate npm shorthand
23 | - `returns` **{string}** - generated shorthand
24 |
25 |
26 |
27 | #### Examples
28 |
29 | ```js
30 | import stringify from 'stringify-github-short-url';
31 |
32 | stringify('jonschlinkert', 'micromatch'); // => 'jonschlinkert/micromatch'
33 | stringify('jonschlinkert', 'micromatch', 'dev'); // => 'jonschlinkert/micromatch#dev'
34 | stringify('gulpjs', 'gulp', 'v3.8.1', true); // => 'gulpjs/gulp@v3.8.1'
35 | stringify({
36 | owner: 'tunnckoCore',
37 | name: 'parse-function',
38 | }); // => 'tunnckoCore/parse-function'
39 | stringify({
40 | user: 'assemble',
41 | repo: 'assemble-core',
42 | }); // => 'assemble/assemble-core'
43 | ```
44 |
--------------------------------------------------------------------------------
/@packages/stringify-github-short-url/src/index.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable prefer-destructuring, no-param-reassign, max-params */
2 |
3 | /**
4 | * Generate github / npm shorthand from list
5 | * of arguments or object.
6 | *
7 | * @example
8 | * import stringify from 'stringify-github-short-url';
9 | *
10 | * stringify('jonschlinkert', 'micromatch'); // => 'jonschlinkert/micromatch'
11 | * stringify('jonschlinkert', 'micromatch', 'dev'); // => 'jonschlinkert/micromatch#dev'
12 | * stringify('gulpjs', 'gulp', 'v3.8.1', true); // => 'gulpjs/gulp@v3.8.1'
13 | * stringify({
14 | * owner: 'tunnckoCore',
15 | * name: 'parse-function'
16 | * }); // => 'tunnckoCore/parse-function'
17 | * stringify({
18 | * user: 'assemble',
19 | * repo: 'assemble-core'
20 | * }); // => 'assemble/assemble-core'
21 | *
22 | * @name stringifyGithubShortUrl
23 | * @param {string|object} `` user or org string, or object
24 | * @param {string} `[name]` repo name
25 | * @param {string} `[branch]` branch name
26 | * @param {string} `[npm]` pass `true` if you want to generate npm shorthand
27 | * @return {string} generated shorthand
28 | * @public
29 | */
30 | export default function stringifyGithubShortUrl(owner, name, branch, npm) {
31 | if (owner && typeof owner === 'object') {
32 | const params = owner;
33 | owner = params.owner || params.user;
34 | name = params.name || params.repo;
35 | branch = params.branch;
36 | npm = params.npm;
37 | }
38 |
39 | if (typeof owner !== 'string') {
40 | throw new TypeError(
41 | 'stringify-github-short-url: expects `owner` to be a string',
42 | );
43 | }
44 | if (typeof name !== 'string') {
45 | return owner;
46 | }
47 |
48 | const url = `${owner}/${name}`;
49 | if (typeof branch === 'string' && branch.length > 0) {
50 | return url + (npm === true ? '@' : '#') + branch;
51 | }
52 | return url;
53 | }
54 |
--------------------------------------------------------------------------------
/@packages/stringify-github-short-url/test/index.js:
--------------------------------------------------------------------------------
1 | import stringify from '../src/index.js';
2 |
3 | test('export default function', async () => {
4 | expect(typeof stringify).toStrictEqual('function');
5 | });
6 |
7 | test('should generate shorthand from arguments list', async () => {
8 | expect(stringify('assemble')).toStrictEqual('assemble');
9 | expect(stringify('assemble', 'verb')).toStrictEqual('assemble/verb');
10 | expect(stringify('assemble', 'verb', 'dev')).toStrictEqual(
11 | 'assemble/verb#dev',
12 | );
13 | expect(stringify('assemble', 'verb', 'v2.7.4', true)).toStrictEqual(
14 | 'assemble/verb@v2.7.4',
15 | );
16 | });
17 |
18 | test('should generate shorthand from object', async () => {
19 | expect(stringify({ owner: 'assemble' })).toStrictEqual('assemble');
20 | expect(stringify({ user: 'assemble' })).toStrictEqual('assemble');
21 | expect(stringify({ owner: 'assemble', name: 'verb' })).toStrictEqual(
22 | 'assemble/verb',
23 | );
24 | expect(stringify({ user: 'assemble', repo: 'verb' })).toStrictEqual(
25 | 'assemble/verb',
26 | );
27 | expect(
28 | stringify({ owner: 'assemble', name: 'verb', branch: 'dev' }),
29 | ).toStrictEqual('assemble/verb#dev');
30 | expect(
31 | stringify({ owner: 'assemble', name: 'verb', branch: 'v2.7.4', npm: true }),
32 | ).toStrictEqual('assemble/verb@v2.7.4');
33 | });
34 |
35 | test('should throw TypeError if first argument not a string', async () => {
36 | expect(() => stringify(123)).toThrow(TypeError);
37 | expect(() => stringify(123)).toThrow(/expects `owner` to be a string/);
38 | });
39 |
40 | test('should throw TypeError if `owner` prop not a string', async () => {
41 | expect(() => stringify({ owner: 123 })).toThrow(TypeError);
42 | expect(() => stringify({ owner: 123 })).toThrow(
43 | /expects `owner` to be a string/,
44 | );
45 | });
46 |
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/.verb.md:
--------------------------------------------------------------------------------
1 | ## API
2 |
3 |
4 |
5 | {%= include(process.cwd() + "/docs/src/index.md") %}
6 | {%= include(process.cwd() + "/docs/src/createJestRunner.md") %}
7 | {%= include(process.cwd() + "/docs/src/toTestResult.md") %}
8 | {%= include(process.cwd() + "/docs/src/fail.md") %}
9 | {%= include(process.cwd() + "/docs/src/skip.md") %}
10 | {%= include(process.cwd() + "/docs/src/pass.md") %}
11 | {%= include(process.cwd() + "/docs/src/todo.md") %}
12 | {%= include(process.cwd() + "/docs/src/utils.md") %}
13 |
14 |
15 |
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/docs/src/createJestRunner.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@tunnckocore/create-jest-runner/docs/src/createJestRunner.md
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/docs/src/fail.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@tunnckocore/create-jest-runner/docs/src/fail.md
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/docs/src/index.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@tunnckocore/create-jest-runner/docs/src/index.md
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/docs/src/pass.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@tunnckocore/create-jest-runner/docs/src/pass.md
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/docs/src/skip.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@tunnckocore/create-jest-runner/docs/src/skip.md
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/docs/src/toTestResult.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@tunnckocore/create-jest-runner/docs/src/toTestResult.md
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/docs/src/todo.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@tunnckocore/create-jest-runner/docs/src/todo.md
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/docs/src/utils.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@tunnckocore/create-jest-runner/docs/src/utils.md
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/src/fail.js:
--------------------------------------------------------------------------------
1 | const toTestResult = require('./toTestResult');
2 |
3 | module.exports = function fail({ start, end, test, errorMessage }) {
4 | return toTestResult({
5 | errorMessage: errorMessage || test.errorMessage,
6 | stats: {
7 | failures: 1,
8 | pending: 0,
9 | passes: 0,
10 | todo: 0,
11 | start,
12 | end,
13 | },
14 | tests: [{ duration: end - start, ...test }],
15 | jestTestPath: test.path,
16 | });
17 | };
18 |
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/src/index.js:
--------------------------------------------------------------------------------
1 | const createJestRunner = require('./createJestRunner');
2 | const { wrapper, tryCatch, tryLoadConfig, createFailed } = require('./utils');
3 | const pass = require('./pass');
4 | const fail = require('./fail');
5 | const skip = require('./skip');
6 | const todo = require('./todo');
7 |
8 | exports.default = {
9 | createJestRunner,
10 | createRunner: createJestRunner,
11 | defineJestRunner: wrapper,
12 | defineRunner: wrapper,
13 | runner: wrapper,
14 | wrapper,
15 | utils: {
16 | tryCatch,
17 | tryLoadConfig,
18 | createFailed,
19 | },
20 | pass,
21 | fail,
22 | skip,
23 | todo,
24 | };
25 |
26 | const ___exportsWithoutDefault = Object.keys(exports.default)
27 | .map((k) => {
28 | exports[k] = exports.default[k];
29 | return k;
30 | })
31 | .filter((x) => x !== 'default')
32 | .reduce((acc, key) => {
33 | acc[key] = exports[key];
34 | return acc;
35 | }, {});
36 |
37 | module.exports = Object.assign(exports.default, ___exportsWithoutDefault);
38 |
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/src/pass.js:
--------------------------------------------------------------------------------
1 | const toTestResult = require('./toTestResult');
2 |
3 | module.exports = function pass({ start, end, test }) {
4 | return toTestResult({
5 | stats: {
6 | failures: 0,
7 | pending: 0,
8 | passes: 1,
9 | todo: 0,
10 | start,
11 | end,
12 | },
13 | tests: [{ duration: end - start, ...test }],
14 | jestTestPath: test.path,
15 | });
16 | };
17 |
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/src/skip.js:
--------------------------------------------------------------------------------
1 | const toTestResult = require('./toTestResult');
2 |
3 | module.exports = function skip({ start, end, test }) {
4 | return toTestResult({
5 | stats: {
6 | failures: 0,
7 | pending: 1,
8 | passes: 0,
9 | todo: 0,
10 | start,
11 | end,
12 | },
13 | skipped: true,
14 | tests: [{ duration: end - start, ...test }],
15 | jestTestPath: test.path,
16 | });
17 | };
18 |
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/src/toTestResult.js:
--------------------------------------------------------------------------------
1 | module.exports = function toTestResult({
2 | stats,
3 | skipped,
4 | errorMessage,
5 | tests,
6 | jestTestPath,
7 | }) {
8 | return {
9 | console: null,
10 | failureMessage: errorMessage,
11 | numFailingTests: stats.failures,
12 | numPassingTests: stats.passes,
13 | numPendingTests: stats.pending,
14 | numTodoTests: stats.todo,
15 | perfStats: {
16 | end: new Date(stats.end).getTime(),
17 | start: new Date(stats.start).getTime(),
18 | },
19 | skipped,
20 | snapshot: {
21 | added: 0,
22 | fileDeleted: false,
23 | matched: 0,
24 | unchecked: 0,
25 | unmatched: 0,
26 | updated: 0,
27 | },
28 | sourceMaps: {},
29 | testExecError: null,
30 | testFilePath: jestTestPath,
31 | testResults: tests.map((test) => ({
32 | ancestorTitles: [],
33 | duration: test.duration,
34 | failureMessages: [test.errorMessage],
35 | fullName: test.testPath,
36 | numPassingAsserts: test.errorMessage ? 1 : 0,
37 | status: test.errorMessage ? 'failed' : 'passed',
38 | title: test.title || '',
39 | })),
40 | };
41 | };
42 |
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/src/todo.js:
--------------------------------------------------------------------------------
1 | const toTestResult = require('./toTestResult');
2 |
3 | module.exports = function todo({ start, end, test }) {
4 | return toTestResult({
5 | stats: {
6 | failures: 0,
7 | pending: 0,
8 | passes: 0,
9 | todo: 1,
10 | start,
11 | end,
12 | },
13 | tests: [{ duration: end - start, ...test }],
14 | jestTestPath: test.path,
15 | });
16 | };
17 |
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/test/failing.test.js:
--------------------------------------------------------------------------------
1 | import runJest from './support/runJest.js';
2 |
3 | it('Works when it has failing tests', async () => {
4 | const resultString = await runJest('failing');
5 | expect(resultString).toEqual(expect.stringContaining('1 failed, 1 total'));
6 | });
7 |
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/test/fixtures/failing/__src__/file1.js:
--------------------------------------------------------------------------------
1 | console.log();
2 |
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/test/fixtures/failing/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | runner: require.resolve('../../support/runner'),
3 | testMatch: ['**/__src__/**/*.js'],
4 | };
5 |
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/test/fixtures/passing/__src__/file1.js:
--------------------------------------------------------------------------------
1 | // ⚔️🏃
2 | console.log();
3 |
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/test/fixtures/passing/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | runner: require.resolve('../../support/runner'),
3 | testMatch: ['**/__src__/**/*.js'],
4 | };
5 |
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/test/fixtures/skipped/__src__/file1.js:
--------------------------------------------------------------------------------
1 | // 🙈
2 | console.log();
3 |
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/test/fixtures/skipped/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | runner: require.resolve('../../support/runner'),
3 | testMatch: ['**/__src__/**/*.js'],
4 | };
5 |
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/test/fixtures/todo/__src__/file1.js:
--------------------------------------------------------------------------------
1 | // 📃
2 | console.log();
3 |
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/test/fixtures/todo/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | runner: require.resolve('../../support/runner'),
3 | testMatch: ['**/__src__/**/*.js'],
4 | };
5 |
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/test/passing.test.js:
--------------------------------------------------------------------------------
1 | import runJest from './support/runJest.js';
2 |
3 | it('Works when it has only passing tests', async () => {
4 | const resultString = await runJest('passing');
5 | expect(resultString).toEqual(expect.stringContaining('1 passed, 1 total'));
6 | });
7 |
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/test/skipped.test.js:
--------------------------------------------------------------------------------
1 | import runJest from './support/runJest.js';
2 |
3 | it('Works when it has skipped tests', async () => {
4 | const resultString = await runJest('skipped');
5 | expect(resultString).toEqual(expect.stringContaining('1 skipped, 1 total'));
6 | });
7 |
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/test/support/runJest.js:
--------------------------------------------------------------------------------
1 | const execa = require('execa');
2 | const path = require('path');
3 | const { stripColor } = require('ansi-colors');
4 |
5 | const rootDir = path.dirname(path.dirname(__dirname));
6 |
7 | function normalize(output) {
8 | return output
9 | .replace(/\(?\d*\.?\d+m?s\)?/g, '')
10 | .replace(/, estimated/g, '')
11 | .replace(new RegExp(rootDir, 'g'), '/mocked-path-to-jest-runner-mocha')
12 | .replace(new RegExp('.*at .*\\n', 'g'), 'mocked-stack-trace')
13 | .replace(/.*at .*\\n/g, 'mocked-stack-trace')
14 | .replace(/(mocked-stack-trace)+/, ' at mocked-stack-trace')
15 | .replace(/\s+\n/g, '\n');
16 | }
17 |
18 | module.exports = function runJest(project, options = []) {
19 | // eslint-disable-next-line no-undef
20 | jest.setTimeout(15_000);
21 |
22 | return execa(
23 | 'jest',
24 | [
25 | '--useStderr',
26 | '--no-watchman',
27 | '--no-cache',
28 | '--projects',
29 | path.join(path.dirname(__dirname), 'fixtures', project),
30 | ].concat(options),
31 | {
32 | env: process.env,
33 | reject: false,
34 | },
35 | // eslint-disable-next-line promise/prefer-await-to-then
36 | ).then(
37 | ({ stdout, stderr }) =>
38 | `${stripColor(normalize(stderr))}\n${stripColor(normalize(stdout))}`,
39 | );
40 | };
41 |
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/test/support/runner/index.js:
--------------------------------------------------------------------------------
1 | const { createJestRunner } = require('../../../');
2 |
3 | module.exports = createJestRunner(require.resolve('./run'));
4 |
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/test/support/runner/run.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 | const { pass, fail, skip, todo } = require('../../../');
3 |
4 | module.exports = ({ testPath }) => {
5 | const start = Date.now();
6 | const contents = fs.readFileSync(testPath, 'utf8');
7 | const end = Date.now();
8 |
9 | if (contents.includes('⚔️🏃')) {
10 | return pass({ start, end, test: { path: testPath } });
11 | }
12 | if (contents.includes('🙈')) {
13 | return skip({ start, end, test: { path: testPath } });
14 | }
15 | if (contents.includes('📃')) {
16 | return todo({ start, end, test: { path: testPath } });
17 | }
18 | const errorMessage = 'Company policies require ⚔️ 🏃 in every file';
19 | return fail({
20 | start,
21 | end,
22 | test: { path: testPath, errorMessage, title: 'Check for ⚔️ 🏃' },
23 | });
24 | };
25 |
--------------------------------------------------------------------------------
/@tunnckocore/create-jest-runner/test/todo.test.js:
--------------------------------------------------------------------------------
1 | import runJest from './support/runJest.js';
2 |
3 | it('Works when it has todo tests', async () => {
4 | const resultString = await runJest('todo');
5 | expect(resultString).toEqual(expect.stringContaining('1 passed, 1 total'));
6 | expect(resultString).toEqual(expect.stringContaining('1 todo, 1 total'));
7 | });
8 |
--------------------------------------------------------------------------------
/@tunnckocore/create-project/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@tunnckocore/create-project",
3 | "version": "0.1.0",
4 | "description": "foo bar",
5 | "author": "Charlike Mike Reagent (https://tunnckocore.com)",
6 | "funding": [
7 | "https://ko-fi.com/tunnckoCore/commissions",
8 | "https://github.com/sponsors/tunnckoCore"
9 | ],
10 | "repository": {
11 | "type": "git",
12 | "url": "https://github.com/tunnckoCore/opensource.git",
13 | "directory": "@tunnckocore/create-project"
14 | },
15 | "type": "module",
16 | "main": "index.js",
17 | "engines": {
18 | "node": ">=16 <17 || >=18 <19 || >=20"
19 | },
20 | "publishConfig": {
21 | "access": "public",
22 | "tag": "latest"
23 | },
24 | "dependencies": {},
25 | "contributors": [
26 | "Charlike Mike Reagent (https://tunnckocore.com)"
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/@tunnckocore/execa/.verb.md:
--------------------------------------------------------------------------------
1 | ## API
2 |
3 |
4 |
5 | {%= include(process.cwd() + "/docs/src/index.md") %}
6 | {%= include(process.cwd() + "/docs/src/main.md") %}
7 |
8 |
9 |
--------------------------------------------------------------------------------
/@tunnckocore/execa/docs/src/main.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@tunnckocore/execa/docs/src/main.md
--------------------------------------------------------------------------------
/@tunnckocore/execa/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@tunnckocore/execa",
3 | "version": "6.0.0",
4 | "licenseStart": 2017,
5 | "license": "MPL-2.0",
6 | "description": "Thin layer on top of `execa` that allows executing multiple commands in parallel or in sequence with control for concurrency",
7 | "author": "Charlike Mike Reagent ",
8 | "homepage": "https://github.com/tunnckoCore/opensource/tree/master/@tunnckocore/execa",
9 | "funding": [
10 | "https://ko-fi.com/tunnckoCore/commissions",
11 | "https://github.com/sponsors/tunnckoCore"
12 | ],
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/tunnckoCore/opensource.git",
16 | "directory": "@tunnckocore/execa"
17 | },
18 | "type": "module",
19 | "main": "src/index.js",
20 | "files": [
21 | "src"
22 | ],
23 | "engines": {
24 | "node": ">=16 <17 || >=18 <19 || >=20"
25 | },
26 | "publishConfig": {
27 | "access": "public",
28 | "registry": "https://registry.npmjs.org",
29 | "tag": "latest"
30 | },
31 | "scripts": {
32 | "cov": "c8 asia --force",
33 | "test": "asia",
34 | "test:fresh": "asia --force"
35 | },
36 | "dependencies": {
37 | "execa": "^6.1.0",
38 | "p-map": "^5.5.0"
39 | },
40 | "keywords": [
41 | "bin",
42 | "binaries",
43 | "binary",
44 | "child",
45 | "concurrency",
46 | "develop",
47 | "exec",
48 | "execa",
49 | "execfile",
50 | "execute",
51 | "file",
52 | "fork",
53 | "local",
54 | "npm",
55 | "parallel",
56 | "path",
57 | "process",
58 | "sequence",
59 | "series",
60 | "shell",
61 | "spawn",
62 | "tunnckocorehq"
63 | ]
64 | }
65 |
--------------------------------------------------------------------------------
/@tunnckocore/execa/test/index.js:
--------------------------------------------------------------------------------
1 | import test from 'asia';
2 | import { expect } from 'expect';
3 |
4 | import {
5 | execa,
6 | execaSync,
7 | execaCommand,
8 | execaCommandSync,
9 | execaNode,
10 |
11 | // our api
12 | exec,
13 | shell,
14 | } from '../src/index.js';
15 |
16 | test('default export execa v2 and named {shell, exec}', () => {
17 | expect(typeof execa).toBe('function');
18 | expect(typeof execaSync).toBe('function');
19 | expect(typeof execaCommand).toBe('function');
20 | expect(typeof execaCommandSync).toBe('function');
21 | expect(typeof execaNode).toBe('function');
22 | expect(typeof shell).toBe('function');
23 | expect(typeof exec).toBe('function');
24 | });
25 |
26 | test('the `exec` accepts arguments with quotes', async () => {
27 | const results = await exec('echo "some content with spaces"');
28 | expect(results[0].all).toStrictEqual('"some content with spaces"');
29 | expect(results[0].stdout).toStrictEqual('"some content with spaces"');
30 |
31 | const res = await exec('echo something');
32 | expect(res[0].all).toStrictEqual('something');
33 | expect(res[0].stdout).toStrictEqual('something');
34 | });
35 |
36 | test('the `shell` should be able to access ENVs', async () => {
37 | // eslint-disable-next-line node/prefer-global/process
38 | const results = await shell('echo "foo-$HOME-bar"', { env: process.env });
39 |
40 | expect(results[0].stdout).toMatch(/foo-.*-bar/);
41 | });
42 |
--------------------------------------------------------------------------------
/@tunnckocore/jest-runner-babel/.verb.md:
--------------------------------------------------------------------------------
1 | ## API
2 |
3 |
4 |
5 | {%= include(process.cwd() + "/docs/src/index.md") %}
6 | {%= include(process.cwd() + "/docs/src/runner.md") %}
7 |
8 |
9 |
--------------------------------------------------------------------------------
/@tunnckocore/jest-runner-babel/docs/src/index.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@tunnckocore/jest-runner-babel/docs/src/index.md
--------------------------------------------------------------------------------
/@tunnckocore/jest-runner-babel/docs/src/runner.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@tunnckocore/jest-runner-babel/docs/src/runner.md
--------------------------------------------------------------------------------
/@tunnckocore/jest-runner-babel/src/index.js:
--------------------------------------------------------------------------------
1 | const { join } = require('path');
2 | const { createJestRunner } = require('@tunnckocore/create-jest-runner');
3 |
4 | module.exports = createJestRunner(join(__dirname, 'runner.js'));
5 |
--------------------------------------------------------------------------------
/@tunnckocore/jest-runner-babel/test/index.js:
--------------------------------------------------------------------------------
1 | import runner from '../src/runner.js';
2 |
3 | test('todo runner babel testing', () => {
4 | expect(typeof runner).toStrictEqual('function');
5 | });
6 |
--------------------------------------------------------------------------------
/@tunnckocore/jest-runner-eslint/.verb.md:
--------------------------------------------------------------------------------
1 | ## API
2 |
3 |
4 |
5 | {%= include(process.cwd() + "/docs/src/index.md") %}
6 | {%= include(process.cwd() + "/docs/src/runner.md") %}
7 |
8 |
9 |
--------------------------------------------------------------------------------
/@tunnckocore/jest-runner-eslint/docs/src/index.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@tunnckocore/jest-runner-eslint/docs/src/index.md
--------------------------------------------------------------------------------
/@tunnckocore/jest-runner-eslint/docs/src/runner.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@tunnckocore/jest-runner-eslint/docs/src/runner.md
--------------------------------------------------------------------------------
/@tunnckocore/jest-runner-eslint/src/index.js:
--------------------------------------------------------------------------------
1 | const { join } = require('path');
2 | const { createJestRunner } = require('@tunnckocore/create-jest-runner');
3 |
4 | module.exports = createJestRunner(join(__dirname, 'runner.js'));
5 |
--------------------------------------------------------------------------------
/@tunnckocore/jest-runner-eslint/test/index.js:
--------------------------------------------------------------------------------
1 | import runner from '../src/runner.js';
2 |
3 | test('todo jest-runner-eslint tests', () => {
4 | expect(typeof runner).toStrictEqual('function');
5 | });
6 |
--------------------------------------------------------------------------------
/@tunnckocore/p-all/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@tunnckocore/p-all",
3 | "version": "0.2.0",
4 | "licenseStart": 2022,
5 | "license": "Apache-2.0",
6 | "description": "Map or loop through promises, promise-returning or async functions, serially or in parallel, based on Promise.all! Has a hooks system: start, beforeEach, afterEach, finish.",
7 | "author": "Charlike Mike Reagent ",
8 | "homepage": "https://github.com/tunnckoCore/opensource/tree/master/@tunnckocore/p-all",
9 | "funding": [
10 | "https://ko-fi.com/tunnckoCore/commissions",
11 | "https://github.com/sponsors/tunnckoCore"
12 | ],
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/tunnckoCore/opensource.git",
16 | "directory": "@tunnckocore/p-all"
17 | },
18 | "type": "module",
19 | "main": "src/index.js",
20 | "files": [
21 | "src"
22 | ],
23 | "engines": {
24 | "node": ">=16 <17 || >=18 <19 || >=20"
25 | },
26 | "publishConfig": {
27 | "access": "public",
28 | "registry": "https://registry.npmjs.org",
29 | "tag": "latest"
30 | },
31 | "scripts": {
32 | "cov": "c8 asia --force",
33 | "test": "asia",
34 | "test:fresh": "asia --force"
35 | },
36 | "dependencies": {},
37 | "keywords": [
38 | "promises",
39 | "loop",
40 | "map",
41 | "parallel",
42 | "promise-map",
43 | "p-map",
44 | "p-map-series",
45 | "serially",
46 | "series",
47 | "promise map",
48 | "async functions",
49 | "promise-returning",
50 | "utility",
51 | "foreach",
52 | "for of",
53 | "forawait",
54 | "for loop",
55 | "for-await",
56 | "for await of"
57 | ],
58 | "contributors": [
59 | "Charlike Mike Reagent "
60 | ]
61 | }
62 |
--------------------------------------------------------------------------------
/@tunnckocore/package-json/.verb.md:
--------------------------------------------------------------------------------
1 | ## API
2 |
3 |
4 |
5 | {%= include(process.cwd() + "/docs/src/index.md") %}
6 |
7 |
8 |
--------------------------------------------------------------------------------
/@tunnckocore/package-json/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 |
3 | All notable changes to this project will be documented in this file.
4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5 |
6 | ## [2.0.4](https://github.com/tunnckoCore/opensource/compare/@tunnckocore/package-json@2.0.3...@tunnckocore/package-json@2.0.4) (2020-03-28)
7 |
8 | **Note:** Version bump only for package @tunnckocore/package-json
9 |
10 |
11 |
12 |
13 |
14 | ## [2.0.3](https://github.com/tunnckoCore/opensource/compare/@tunnckocore/package-json@2.0.2...@tunnckocore/package-json@2.0.3) (2020-03-28)
15 |
16 | **Note:** Version bump only for package @tunnckocore/package-json
17 |
18 |
19 |
20 |
21 |
22 | ## [2.0.2](https://github.com/tunnckoCore/opensource/compare/@tunnckocore/package-json@2.0.1...@tunnckocore/package-json@2.0.2) (2020-03-27)
23 |
24 | **Note:** Version bump only for package @tunnckocore/package-json
25 |
26 |
27 |
28 |
29 |
30 | ## [2.0.1](https://github.com/tunnckoCore/opensource/compare/@tunnckocore/package-json@2.0.0...@tunnckocore/package-json@2.0.1) (2020-02-29)
31 |
32 |
33 | ### Bug Fixes
34 |
35 | * **@tunnckocore/package-json:** update docs ([bfb816b](https://github.com/tunnckoCore/opensource/commit/bfb816b7ce3c976af0cb90c18037a0084407311b))
36 |
37 |
38 |
39 |
40 |
41 | # 2.0.0 (2020-02-29)
42 |
43 |
44 | * feat!: import @tunnckocore/package-json (#118) ([fefa037](https://github.com/tunnckoCore/opensource/commit/fefa037376d29d4396654231c4faf8fe2e797a5d)), closes [#118](https://github.com/tunnckoCore/opensource/issues/118)
45 |
46 |
47 | ### BREAKING CHANGES
48 |
49 | * uses JSDelivr and Unpkg under the hood.
50 |
51 | Signed-off-by: Charlike Mike Reagent
52 |
--------------------------------------------------------------------------------
/@tunnckocore/package-json/docs/src/index.md:
--------------------------------------------------------------------------------
1 | _Generated using [jest-runner-docs](https://ghub.now.sh/jest-runner-docs)._
2 |
3 | ### [packageJson](./src/index.js#L36)
4 |
5 | Get package metadata from the Unpkg instead of NPM registry. Optionally you can
6 | pass `endpoint` function and return the build the registry url.
7 |
8 |
9 |
10 | #### Signature
11 |
12 | ```ts
13 | function(packageName, endpoint)
14 | ```
15 |
16 |
17 |
18 | #### Params
19 |
20 | - `packageName` **{string}** - the package name, supports `pkg-name@1.2.2`
21 | (version) and `pkg-name@next` (dist-tag)
22 | - `endpoint` **{function}** - like `(name, tag) => url`
23 | - `returns` **{object}** - package metadata object
24 |
25 |
26 |
27 | #### Examples
28 |
29 | ```js
30 | import packageJson from '@tunnckocore/package-json';
31 |
32 | async function main() {
33 | console.log(await packageJson('eslint'));
34 | console.log(await packageJson('package-json@4.0.0'));
35 | console.log(await packageJson('ava@next'));
36 | console.log(await packageJson('@babel/core'));
37 | console.log(await packageJson('@tunnckocore/package-json'));
38 | }
39 |
40 | main().catch(console.error);
41 | ```
42 |
--------------------------------------------------------------------------------
/@tunnckocore/package-json/test/index.js:
--------------------------------------------------------------------------------
1 | import packageJson, { PackageJsonError } from '../src/index.js';
2 |
3 | test('return package metadata', async () => {
4 | const pkg = await packageJson('babel-preset-optimise');
5 | expect(pkg.name).toStrictEqual('babel-preset-optimise');
6 | });
7 |
8 | test('for specific version + scoped', async () => {
9 | const pkg = await packageJson('@tunnckocore/package-json@1.0.3');
10 | expect(pkg.version).toStrictEqual('1.0.3');
11 | expect(pkg.repository).toStrictEqual('tunnckoCoreLabs/package-json');
12 | });
13 |
14 | test('throw for not existing package', async () => {
15 | await expect(packageJson('ksjdf4jdhfkjsd')).rejects.toThrow(Error);
16 | await expect(packageJson('ksjdf4jdhfkjsd')).rejects.toThrow(PackageJsonError);
17 | await expect(packageJson('ksjdf4jdhfkjsd')).rejects.toThrow(
18 | /Package "ksjdf4jdhfkjsd" not found/,
19 | );
20 | });
21 |
22 | test('get package.json using custom `endpoint` option', async () => {
23 | const pkg = await packageJson(
24 | 'package-json@4.0.0',
25 | (name, tag) => `https://registry.npmjs.org/${name}/${tag}`,
26 | );
27 |
28 | expect(pkg.name).toStrictEqual('package-json');
29 | expect(pkg.version).toStrictEqual('4.0.0');
30 | });
31 |
--------------------------------------------------------------------------------
/@tunnckocore/prettier-config/README.md:
--------------------------------------------------------------------------------
1 | # @tunnckocore/prettier-config
2 |
3 | > Shareable Prettier config for all @tunnckoCore projects
4 |
5 | ```
6 | yarn add -D @tunnckocore/prettier-config
7 | ```
8 |
9 | on your config:
10 |
11 | ```json
12 | {
13 | "prettier": "@tunnckocore/prettier-config"
14 | }
15 | ```
16 |
--------------------------------------------------------------------------------
/@tunnckocore/prettier-config/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@tunnckocore/prettier-config",
3 | "version": "3.0.0",
4 | "licenseStart": 2019,
5 | "license": "Apache-2.0",
6 | "description": "Shareable Prettier config for all @tunnckoCore projects",
7 | "author": "Charlike Mike Reagent ",
8 | "homepage": "https://github.com/tunnckoCore/opensource/tree/master/@tunnckocore/prettier-config",
9 | "funding": [
10 | "https://ko-fi.com/tunnckoCore/commissions",
11 | "https://github.com/sponsors/tunnckoCore"
12 | ],
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/tunnckoCore/opensource.git",
16 | "directory": "@tunnckocore/prettier-config"
17 | },
18 | "type": "commonjs",
19 | "main": "src/index.js",
20 | "files": [
21 | "src"
22 | ],
23 | "engines": {
24 | "node": ">=16 <17 || >=18 <19 || >=20"
25 | },
26 | "publishConfig": {
27 | "access": "public",
28 | "registry": "https://registry.npmjs.org",
29 | "tag": "latest"
30 | },
31 | "scripts": {},
32 | "dependencies": {
33 | "prettier-plugin-pkgjson": "^0.2.8"
34 | },
35 | "peerDependencies": {
36 | "prettier": "^2.7.1"
37 | },
38 | "contributors": [
39 | "Charlike Mike Reagent "
40 | ]
41 | }
42 |
--------------------------------------------------------------------------------
/@tunnckocore/prettier-config/src/defaults.js:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: Apache-2.0
2 |
3 | /* eslint-disable unicorn/prefer-module */
4 |
5 | module.exports = {
6 | endOfLine: 'lf',
7 |
8 | printWidth: 80,
9 |
10 | // AirBnB Style forces using spaces, a tab is 2-space.
11 | // Here we force using tabs, 2-space tab.
12 | // More here: https://lea.verou.me/2012/01/why-tabs-are-clearly-superior/
13 | // and NEVER USE: https://dev.to/christoslitras/never-use-tabs-for-code-indentation-3ln2
14 | tabWidth: 2,
15 | useTabs: false,
16 |
17 | // That actually is enforced by AirBnB Style anyway.
18 | // Explicitness is the most important thing:
19 | // - Always is visible that this is function (because the parens).
20 | // - If you first write single param and decide to add new one,
21 | // then you should also add a parens around the both - that's mess.
22 | arrowParens: 'always',
23 |
24 | // Enforce single-quotes, because industry standard.
25 | singleQuote: true,
26 |
27 | // That actually is enforced by AirBnB Style anyway.
28 | // Always useful. And guaranteed that you won't see boring errors,
29 | // that eats your time, because of nothing real.
30 | trailingComma: 'all',
31 |
32 | // That actually is enforced by AirBnB Style anyway.
33 | // Enforce more clear object literals.
34 | // As seen in this example https://github.com/airbnb/javascript#objects--rest-spread
35 | bracketSpacing: true,
36 |
37 | // That actually is enforced by AirBnB Style anyway.
38 | // Enforcing bracket on the next line makes differentiate
39 | // where ends the tag and its properties and where starts the content of the tag.
40 | // https://prettier.io/docs/en/options.html#jsx-brackets
41 | bracketSameLine: false,
42 | };
43 |
--------------------------------------------------------------------------------
/@tunnckocore/prettier-config/src/index.js:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: Apache-2.0
2 |
3 | /* eslint-disable unicorn/prefer-module */
4 |
5 | const prettierDefaults = require('./defaults.js');
6 |
7 | module.exports = {
8 | ...prettierDefaults,
9 | overrides: [
10 | {
11 | files: ['**/.all-contributorsrc'],
12 | options: {
13 | parser: 'json',
14 | },
15 | },
16 | {
17 | files: ['**/*.json'],
18 | options: {
19 | parser: 'json-stringify',
20 | },
21 | },
22 | {
23 | files: ['**/package.json'],
24 | options: {
25 | parser: 'json-stringify',
26 | plugins: ['prettier-plugin-pkgjson'],
27 | },
28 | },
29 | {
30 | files: ['**/*.md'],
31 | options: {
32 | parser: 'markdown',
33 | proseWrap: 'always',
34 | },
35 | },
36 | {
37 | files: ['**/*.mdx'],
38 | options: {
39 | parser: 'mdx',
40 | proseWrap: 'always',
41 | },
42 | },
43 | ],
44 | };
45 |
--------------------------------------------------------------------------------
/@tunnckocore/pretty-config/.verb.md:
--------------------------------------------------------------------------------
1 | ## API
2 |
3 |
4 |
5 | {%= include(process.cwd() + "/docs/src/index.md") %}
6 | {%= include(process.cwd() + "/docs/src/utils.md") %}
7 |
8 |
9 |
--------------------------------------------------------------------------------
/@tunnckocore/pretty-config/docs/src/index.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@tunnckocore/pretty-config/docs/src/index.md
--------------------------------------------------------------------------------
/@tunnckocore/pretty-config/docs/src/utils.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@tunnckocore/pretty-config/docs/src/utils.md
--------------------------------------------------------------------------------
/@tunnckocore/pretty-config/src/index.js:
--------------------------------------------------------------------------------
1 | import { resolveConfig, resolveConfigPath } from './utils.js';
2 |
3 | export const searchPlaces = [
4 | '%s.config.js', // 7
5 | '.%s.config.js', // 7
6 | 'package.json', // 12 - pkg.eslint || pkg.eslintConfig || pkg.config.eslint
7 | '.%src.json', // 1
8 | // '.%src.json6', // 2
9 | '.%src.yaml', // 3
10 | '.%src.yml', // 4
11 | '.%src.js', // 5
12 | // '.%src.mjs', // 6
13 | // '%s.config.mjs', // 8
14 | '.%s.config.js', // 9
15 | // '.%s.config.mjs', // 10
16 | '.%src', // 11 - first try JSON, if fail to parse then fallback to YAML
17 | ];
18 |
19 | export async function prettyConfig(name, options) {
20 | if (typeof name !== 'string') {
21 | throw new TypeError('pretty-config: `name` is required argument');
22 | }
23 | if (name.length === 0) {
24 | throw new Error('pretty-config: expect `name` to be non-empty string');
25 | }
26 |
27 | const opts = {
28 | cwd: process.cwd(),
29 | name,
30 | searchPlaces,
31 | envSupport: true,
32 | ...options,
33 | };
34 | const configPath = resolveConfigPath(opts);
35 |
36 | // we return empty object,
37 | // because we don't have any config
38 | // and no errors
39 | if (!configPath) {
40 | return null;
41 | }
42 |
43 | const cfg = await resolveConfig(configPath, opts);
44 | const envName = process.env.NODE_ENV;
45 |
46 | if (opts.envSupport && cfg && cfg.env && cfg.env[envName]) {
47 | const config = { ...cfg, ...cfg.env[envName] };
48 | return { config, filepath: configPath };
49 | }
50 |
51 | return { config: cfg, filepath: configPath };
52 | }
53 |
54 | prettyConfig.searchPlaces = searchPlaces;
55 |
56 | export default prettyConfig;
57 | export { resolveConfig } from './utils.js';
58 | export { resolveConfigPath } from './utils.js';
59 |
--------------------------------------------------------------------------------
/@tunnckocore/pretty-config/test/index.js:
--------------------------------------------------------------------------------
1 | import mod from '../src/index.js';
2 |
3 | test('todo tests for @tunnckocore/pretty-config package', async () => {
4 | expect(typeof mod).toStrictEqual('function');
5 | });
6 |
--------------------------------------------------------------------------------
/@tunnckocore/semver-increment/README.md:
--------------------------------------------------------------------------------
1 | # @tunnckocore/semver-increment
2 |
3 | Trimmed down version of the `semver` package, with just `increment` (semver.inc)
4 | functionality and converted to ESM.
5 |
6 | ```js
7 | import { increment, SemVer } from '@tunnckocore/semver-increment';
8 |
9 | // SemVer = trimmed down SemVer class with just `inc` method.
10 |
11 | const nextVersion = increment('1.1.3', 'patch');
12 |
13 | console.log(nextVersion);
14 | ```
15 |
--------------------------------------------------------------------------------
/@tunnckocore/semver-increment/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@tunnckocore/semver-increment",
3 | "version": "0.2.0",
4 | "licenseStart": 2022,
5 | "license": "ISC",
6 | "description": "Trimmed down version of the `semver` package, with just `increment` (semver.inc) functionality and converted to ESM",
7 | "author": "Charlike Mike Reagent ",
8 | "homepage": "https://github.com/tunnckoCore/opensource/tree/master/@tunnckocore/semver-increment",
9 | "funding": [
10 | "https://ko-fi.com/tunnckoCore/commissions",
11 | "https://github.com/sponsors/tunnckoCore"
12 | ],
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/tunnckoCore/opensource.git",
16 | "directory": "@tunnckocore/semver-increment"
17 | },
18 | "type": "module",
19 | "main": "src/index.js",
20 | "files": [
21 | "src"
22 | ],
23 | "engines": {
24 | "node": ">=16 <17 || >=18 <19 || >=20"
25 | },
26 | "publishConfig": {
27 | "access": "public",
28 | "registry": "https://registry.npmjs.org",
29 | "tag": "latest"
30 | },
31 | "scripts": {},
32 | "dependencies": {},
33 | "keywords": [
34 | "tunnckocore",
35 | "semver",
36 | "increment",
37 | "semver fork",
38 | "minimal semver"
39 | ],
40 | "contributors": [
41 | "Charlike Mike Reagent "
42 | ]
43 | }
44 |
--------------------------------------------------------------------------------
/@tunnckocore/semver-increment/src/parse-options.js:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: ISC
2 |
3 | // `semver` contributors, ISC
4 | // June 27, commit c56a701f456539
5 | // https://github.com/npm/node-semver/blob/c56a701f456539/internal/re.js
6 |
7 | // parse out just the options we care about so we always get a consistent
8 | // obj with keys in a consistent order.
9 | const opts = ['includePrerelease', 'loose', 'rtl'];
10 |
11 | function parseOptions(options) {
12 | if (!options) return {};
13 | if (typeof options !== 'object') {
14 | return { loose: true };
15 | }
16 |
17 | return opts
18 | .filter((k) => options[k])
19 |
20 | .reduce((acc, k) => {
21 | acc[k] = true;
22 | return acc;
23 | }, {});
24 | }
25 |
26 | export default parseOptions;
27 |
28 | export { parseOptions };
29 |
--------------------------------------------------------------------------------
/@tunnckocore/utils/.verb.md:
--------------------------------------------------------------------------------
1 | ## API
2 |
3 |
4 |
5 | {%= include(process.cwd() + "/docs/src/index.md") %}
6 |
7 |
8 |
--------------------------------------------------------------------------------
/@tunnckocore/utils/docs/src/index.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/@tunnckocore/utils/docs/src/index.md
--------------------------------------------------------------------------------
/@tunnckocore/utils/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@tunnckocore/utils",
3 | "version": "1.3.8",
4 | "licenseStart": 2019,
5 | "license": "MPL-2.0",
6 | "description": "Utility functions and helpers for internal usage and monorepos",
7 | "author": "Charlike Mike Reagent (https://tunnckocore.com)",
8 | "homepage": "https://tunnckocore.com/opensource",
9 | "funding": [
10 | "https://ko-fi.com/tunnckoCore/commissions",
11 | "https://github.com/sponsors/tunnckoCore",
12 | "https://patreon.com/tunnckoCore"
13 | ],
14 | "repository": {
15 | "type": "git",
16 | "url": "https://github.com/tunnckoCore/opensource.git",
17 | "directory": "@tunnckocore/utils"
18 | },
19 | "main": "src/index.js",
20 | "module": "src/index.js",
21 | "files": [
22 | "src"
23 | ],
24 | "engines": {
25 | "node": ">=10.13"
26 | },
27 | "publishConfig": {
28 | "access": "public",
29 | "tag": "latest"
30 | },
31 | "scripts": {},
32 | "dependencies": {
33 | "cheerio": "^1.0.0-rc.3"
34 | },
35 | "jest": {
36 | "coverageThreshold": {
37 | "src/**/*.js": {
38 | "statements": 100,
39 | "branches": 100,
40 | "functions": 100,
41 | "lines": 100
42 | }
43 | }
44 | },
45 | "cov": {
46 | "value": 100,
47 | "color": "green"
48 | },
49 | "keywords": [
50 | "develop",
51 | "hela",
52 | "helpers",
53 | "monorepo",
54 | "monorepo helpers",
55 | "tunnckocore",
56 | "tunnckocorehq",
57 | "utilities",
58 | "utils"
59 | ],
60 | "verb": {
61 | "readme": "../../readme-template.md",
62 | "run": true,
63 | "toc": {
64 | "render": true,
65 | "method": "preWrite",
66 | "maxdepth": 4
67 | },
68 | "layout": "empty",
69 | "tasks": [
70 | "readme"
71 | ],
72 | "lint": {
73 | "reflinks": true
74 | },
75 | "reflinks": [],
76 | "related": {
77 | "list": []
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/@tunnckocore/utils/test/fixtures/lerna/@tunnckocore/barry/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@tunnckocore/barry"
3 | }
4 |
--------------------------------------------------------------------------------
/@tunnckocore/utils/test/fixtures/lerna/lerna.json:
--------------------------------------------------------------------------------
1 | {
2 | "packages": [
3 | "@tunnckocore/*",
4 | "packages/*"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/@tunnckocore/utils/test/fixtures/lerna/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "lerna-monorepo",
3 | "extensions": [
4 | "js",
5 | "jsx",
6 | "ts"
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/@tunnckocore/utils/test/fixtures/lerna/packages/foo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@helios/qux"
3 | }
4 |
--------------------------------------------------------------------------------
/@tunnckocore/utils/test/fixtures/lerna/packages/numb/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "numb"
3 | }
4 |
--------------------------------------------------------------------------------
/@tunnckocore/utils/test/fixtures/yarn-workspaces/@hela/fab/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@hela/fab"
3 | }
4 |
--------------------------------------------------------------------------------
/@tunnckocore/utils/test/fixtures/yarn-workspaces/@hela/fab/src/index.js:
--------------------------------------------------------------------------------
1 | export default 'fab';
2 |
--------------------------------------------------------------------------------
/@tunnckocore/utils/test/fixtures/yarn-workspaces/@tunnckocore/qux/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@tunnckocore/qux"
3 | }
4 |
--------------------------------------------------------------------------------
/@tunnckocore/utils/test/fixtures/yarn-workspaces/@tunnckocore/qux/src/index.js:
--------------------------------------------------------------------------------
1 | export default 'qux';
2 |
--------------------------------------------------------------------------------
/@tunnckocore/utils/test/fixtures/yarn-workspaces/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "some-fixture-yarn-workspaces",
4 | "workspaces": [
5 | "@tunnckocore/*",
6 | "@hela/*"
7 | ],
8 | "extensions": [
9 | "js",
10 | "ts"
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/asia/asia-cli/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "asia-cli",
3 | "version": "3.3.0",
4 | "licenseStart": 2017,
5 | "license": "MPL-2.0",
6 | "description": "Modern, fast, and innovative test runner with parallelism, concurrency, caching and incremental testing. Since 2017.",
7 | "author": "Charlike Mike Reagent ",
8 | "homepage": "https://github.com/tunnckoCore/opensource/tree/master/asia",
9 | "funding": [
10 | "https://ko-fi.com/tunnckoCore/commissions",
11 | "https://github.com/sponsors/tunnckoCore"
12 | ],
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/tunnckoCore/opensource.git",
16 | "directory": "asia/asia-cli"
17 | },
18 | "type": "module",
19 | "main": "src/index.js",
20 | "files": [
21 | "src"
22 | ],
23 | "bin": {
24 | "asia": "src/bin.js",
25 | "asia-cli": "src/bin.js"
26 | },
27 | "engines": {
28 | "node": ">=16 <17 || >=18 <19 || >=20"
29 | },
30 | "publishConfig": {
31 | "access": "public",
32 | "registry": "https://registry.npmjs.org",
33 | "tag": "latest"
34 | },
35 | "scripts": {},
36 | "dependencies": {
37 | "asia-core": "*",
38 | "fast-glob": "^3.2.11",
39 | "yaro": "*"
40 | },
41 | "keywords": [
42 | "testing",
43 | "innovative",
44 | "test",
45 | "runner",
46 | "concurrency",
47 | "parallel",
48 | "incremental",
49 | "incremental testing",
50 | "fast runner",
51 | "assertion",
52 | "promises",
53 | "async await",
54 | "async",
55 | "await",
56 | "function",
57 | "caching",
58 | "snapshots",
59 | "test framework",
60 | "test runner",
61 | "asia",
62 | "ava",
63 | "jest"
64 | ],
65 | "contributors": [
66 | "Charlike Mike Reagent "
67 | ]
68 | }
69 |
--------------------------------------------------------------------------------
/asia/asia-cli/src/bin.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | // SPDX-License-Identifier: Apache-2.0
4 |
5 | import process from 'node:process';
6 | import path from 'node:path';
7 | import { fileURLToPath } from 'node:url';
8 | import { createCli, command, isRequired } from 'yaro';
9 | import { readJSON, runAsia } from './index.js';
10 |
11 | const pkgRoot = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
12 | const pkg = readJSON(path.join(pkgRoot, 'package.json'));
13 | const cwd = process.cwd();
14 |
15 | const asia = command('[...patterns]', 'Run tests with ASIA test framework.')
16 | .option('--cwd', 'Working directory, defaults to `process.cwd()`.', cwd)
17 | .option('--verbose', 'Print more verbose output.', false)
18 |
19 | .option('-f, --force', 'Force running test without cache', false)
20 | .option('--cc, --cache-clean, --clean-cache', 'Clear the disk cache', false)
21 | .option('--only-failed', 'Print only failed tests', false)
22 |
23 | .option('-c, --config', 'Path to config file.', {
24 | default: 'asia.config.js',
25 | required: isRequired,
26 | })
27 | .option('--workspace-file', 'File path to write workspaces metadata.', {
28 | default: 'hela-workspace.json',
29 | required: isRequired,
30 | })
31 | .action(async (options, patterns) => {
32 | await runAsia(patterns, options);
33 | });
34 |
35 | await createCli({
36 | commands: { asia },
37 | version: pkg.version,
38 | name: 'asia',
39 | });
40 |
--------------------------------------------------------------------------------
/asia/asia-cli/src/index.js:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MPL-2.0
2 |
3 | import fs from 'node:fs';
4 | import path from 'node:path';
5 | import process from 'node:process';
6 | import fastGlob from 'fast-glob';
7 | import { parallel } from 'asia-core';
8 |
9 | export function readJSON(filepath) {
10 | return JSON.parse(fs.readFileSync(filepath, 'utf8'));
11 | }
12 |
13 | export const DEFAULT_IGNORE = [
14 | '**/node_modules/**',
15 | '**/bower_components/**',
16 | '**/flow-typed/**',
17 | '**/coverage/**',
18 | '**/{tmp,temp}/**',
19 | '**/*.min.js',
20 | '**/bundle.js',
21 | '**/.cache/**',
22 | '**/{fixture,fixtures}/**',
23 | '**/vendor/**',
24 | '**/dist/**',
25 | ];
26 |
27 | export const DEFAULT_PATTERNS = [
28 | '**/test.js',
29 | // "**/asia/node-example.js",
30 | // "**/asia-core/example.js",
31 | '**/*.spec.js',
32 | '**/*.test.js',
33 | '**/test/**/*.js',
34 | '**/tests/**/*.js',
35 | '**/__tests__/**/*.js',
36 | ].concat(DEFAULT_IGNORE.map((x) => `!${x}`));
37 |
38 | function arrayifiy(val) {
39 | if (!val) {
40 | return [];
41 | }
42 | if (Array.isArray(val)) {
43 | return val.flat();
44 | }
45 | return [val];
46 | }
47 |
48 | export async function runAsia(patterns, options = {}) {
49 | const flags = { ...options };
50 | const globs = arrayifiy(patterns);
51 | const input = globs.length > 0 ? globs : DEFAULT_PATTERNS;
52 |
53 | process.env.ASIA_NO_CACHE = flags.force === true ? '1' : undefined;
54 | process.env.ASIA_RELOAD = flags.cacheClean === true ? '1' : undefined;
55 | // NOTE: not needed, since we can just pass patterns
56 | // to filter out what we want to test
57 | // process.env.ASIA_MATCH = flags.filter ?? undefined;
58 | process.env.ASIA_ONLY_FAILED = flags.onlyFailed === true ? '1' : undefined;
59 |
60 | const testFiles = await fastGlob(input, flags);
61 |
62 | await parallel(testFiles, ({ value: testPath }) =>
63 | import(path.resolve(testPath)),
64 | );
65 | }
66 |
--------------------------------------------------------------------------------
/asia/asia-cli/test/index.js:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MPL-2.0
2 |
3 | import { strict as assert } from 'node:assert';
4 | import test from 'asia';
5 |
6 | import { runAsia } from '../src/index.js';
7 |
8 | test('check `runAsia` is a function', async () => {
9 | // emulate slowness
10 | // await new Promise((resolve) => setTimeout(resolve, 2000));
11 | assert.equal(typeof runAsia, 'function');
12 | });
13 |
--------------------------------------------------------------------------------
/asia/asia-core/example.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable promise/prefer-await-to-then */
2 | import { setTimeout as delay } from 'node:timers/promises';
3 | import asia from './src/index.js';
4 |
5 | // import asia, { loadConfig } from './src/index.js';
6 | // const config = await loadConfig("../asia.config.js");
7 | const { test, run } = asia(/* config */);
8 |
9 | test("some 'a' tst", () => delay(3000).then(() => 'a')); // 8
10 | test("some 'b' tst", () => delay(300).then(() => 'b')); // 2
11 | test("some 'c' tst", () => delay(1000).then(() => 'c')); // 5
12 | test("some 'd' tst", () => delay(100).then(() => 'd')); // 1
13 | test("some 'e' tst", () =>
14 | delay(2000).then(() => {
15 | throw new Error('the "e" error');
16 | })); // 6
17 | test("some 'f' tst", () => delay(1500).then(() => 'f')); // 7
18 | test("some 'g' tst", () => delay(560).then(() => 'g')); // 3
19 | test("some 'h' tst", () => delay(880).then(() => 'h')); // 4
20 |
21 | await run();
22 |
--------------------------------------------------------------------------------
/asia/asia-core/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "asia-core",
3 | "version": "3.3.0",
4 | "licenseStart": 2017,
5 | "license": "MPL-2.0",
6 | "description": "Modern, fast, and innovative test runner with parallelism, concurrency, caching and incremental testing. Since 2017.",
7 | "author": "Charlike Mike Reagent ",
8 | "homepage": "https://github.com/tunnckoCore/opensource/tree/master/asia",
9 | "funding": [
10 | "https://ko-fi.com/tunnckoCore/commissions",
11 | "https://github.com/sponsors/tunnckoCore"
12 | ],
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/tunnckoCore/opensource.git",
16 | "directory": "asia/asia-core"
17 | },
18 | "type": "module",
19 | "main": "src/index.js",
20 | "files": [
21 | "src",
22 | "example.js"
23 | ],
24 | "engines": {
25 | "node": ">=16 <17 || >=18 <19 || >=20"
26 | },
27 | "publishConfig": {
28 | "access": "public",
29 | "registry": "https://registry.npmjs.org",
30 | "tag": "latest"
31 | },
32 | "scripts": {},
33 | "dependencies": {
34 | "@tunnckocore/p-all": "*"
35 | },
36 | "keywords": [
37 | "testing",
38 | "innovative",
39 | "test",
40 | "runner",
41 | "concurrency",
42 | "parallel",
43 | "incremental",
44 | "incremental testing",
45 | "fast runner",
46 | "assertion",
47 | "promises",
48 | "async await",
49 | "async",
50 | "await",
51 | "function",
52 | "caching",
53 | "snapshots",
54 | "test framework",
55 | "test runner",
56 | "asia",
57 | "ava",
58 | "jest"
59 | ],
60 | "contributors": [
61 | "Charlike Mike Reagent "
62 | ]
63 | }
64 |
--------------------------------------------------------------------------------
/asia/asia-core/src/utils.js:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MPL-2.0
2 |
3 | // note: Sindre, MIT, `callsites`
4 | export function callplaces() {
5 | const _prepareStackTrace = Error.prepareStackTrace;
6 | Error.prepareStackTrace = (_, stack) => stack;
7 | // eslint-disable-next-line unicorn/error-message
8 | const stack = new Error().stack.slice(1);
9 | Error.prepareStackTrace = _prepareStackTrace;
10 | return stack;
11 | }
12 |
13 | export function cleanerStack(val) {
14 | return (val || '')
15 | .split('\n')
16 | .filter((x) => {
17 | const exclude = x.includes('asia/src') || x.includes('async Promise.all');
18 |
19 | if (exclude) {
20 | return false;
21 | }
22 |
23 | return true;
24 | })
25 | .map((x) => (x.trim().startsWith('at') ? ` ${x.trim()}` : x.trim()))
26 | .join('\n');
27 | }
28 |
29 | export const ansiWrap = (a, b, str) => `\u001B[${a}m${str}\u001B[${b}m`;
30 | export const ansiRed = (str) => ansiWrap(31, 39, str);
31 |
32 | export function basicReporter(item, cfg) {
33 | const idx = item.index + 1; // print from 1, not from 0.
34 | const onlyFailed = cfg.env?.ASIA_ONLY_FAILED === '1';
35 |
36 | if (item.status === 'rejected') {
37 | console.error(ansiRed('not ok %s - %s'), idx, item.reason.title);
38 | console.error('');
39 | console.error(item.reason.stack);
40 | console.error('');
41 | }
42 | if (!onlyFailed && item.status === 'fulfilled') {
43 | console.log('ok %s - %s', idx, item.value.title);
44 | }
45 | }
46 |
47 | // eslint-disable-next-line no-unused-vars
48 | export function filter(cfg, { title, testPath, callsites }) {
49 | const match = cfg?.env?.ASIA_MATCH || '';
50 |
51 | console.log(match);
52 | const byPath = match
53 | ? testPath.includes(match) || new RegExp(match).test(testPath)
54 | : false;
55 |
56 | const byTitle =
57 | byPath === false && match
58 | ? title.includes(match) || new RegExp(match).test(title)
59 | : false;
60 |
61 | return byPath || byTitle;
62 | }
63 |
--------------------------------------------------------------------------------
/asia/asia-core/test/index.js:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MPL-2.0
2 |
3 | import assert from 'node:assert/strict';
4 | import test from 'asia';
5 | import mod from '../src/index.js';
6 |
7 | // eslint-disable-next-line no-promise-executor-return
8 | const delay = async (ms) => new Promise((resolve) => setTimeout(resolve, ms));
9 |
10 | test('todo tests for asia-core package', async () => {
11 | await delay(2234);
12 | assert.equal(typeof mod, 'function');
13 | });
14 |
--------------------------------------------------------------------------------
/asia/asia/asia.config.js:
--------------------------------------------------------------------------------
1 | export default async () => ({
2 | // disabling file caching, with just regular Map
3 | // tests: new Map(),
4 | foo: 1,
5 | });
6 |
--------------------------------------------------------------------------------
/asia/asia/deno-example.js:
--------------------------------------------------------------------------------
1 | // for Deno
2 | import test from './src/mod.ts';
3 | // run with:
4 | // deno run --no-check --allow-net --allow-write --allow-read --allow-env deno-example.js
5 |
6 | // for Node
7 | // import test from "./src/index.js";
8 |
9 | /* eslint-disable promise/prefer-await-to-then, no-promise-executor-return */
10 |
11 | const delay = async (ms) => new Promise((resolve) => setTimeout(resolve, ms));
12 |
13 | test("some 'a' tst", () => delay(3000).then(() => 'a')); // 8
14 | test("some 'b' tst", () => delay(300).then(() => 'b')); // 2
15 | test("some 'c' tst", () => delay(1100).th5555en(() => 'c')); // 5
16 | test("some 'd' tst", () => delay(100).then(() => 'd')); // 1
17 | test("some 'e' tst", () =>
18 | delay(2000).then(() => {
19 | throw new Error('the "e" error');
20 | })); // 6
21 | test("some 'f' tst", () => delay(1500).then(() => 'f')); // 7
22 | test("some 'g' tst", () => delay(560).then(() => 'g')); // 3
23 | test("some 'h' tst", () => delay(880).then(() => 'h')); // 4
24 |
--------------------------------------------------------------------------------
/asia/asia/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/asia/asia/logo.png
--------------------------------------------------------------------------------
/asia/asia/node-example.js:
--------------------------------------------------------------------------------
1 | // for Deno
2 | // import test from "./src/mod.ts";
3 | // run with:
4 | // deno run --no-check --allow-net --allow-write --allow-read --allow-env deno-example.js
5 |
6 | // for Node
7 | import test from './src/index.js';
8 |
9 | // test.testPath = import.meta.url;
10 |
11 | /* eslint-disable promise/prefer-await-to-then, no-promise-executor-return */
12 |
13 | const delay = async (ms) => new Promise((resolve) => setTimeout(resolve, ms));
14 |
15 | test("some 'a' tst", () => delay(3000).then(() => 'a'), import.meta.url); // 8
16 | test("some 'b' tst", () => delay(300).then(() => 'b')); // 2
17 | test("some 'c' tst", () => delay(1100).th5555en(() => 'c')); // 5
18 | test("some 'd' tst", () => delay(100).then(() => 'd')); // 1
19 | test("some 'e' tst", () =>
20 | delay(2000).then(() => {
21 | throw new Error('the "e" error');
22 | })); // 6
23 | test("some 'f' tst", () => delay(1500).then(() => 'f')); // 7
24 | test("some 'g' tst", () => delay(560).then(() => 'g')); // 3
25 | test("some 'h' tst", () => delay(880).then(() => 'h')); // 4
26 |
--------------------------------------------------------------------------------
/asia/asia/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "asia",
3 | "version": "3.3.0",
4 | "licenseStart": 2017,
5 | "license": "MPL-2.0",
6 | "description": "Modern, fast, and innovative test runner with parallelism, concurrency, caching and incremental testing. Since 2017.",
7 | "author": "Charlike Mike Reagent ",
8 | "homepage": "https://github.com/tunnckoCore/opensource/tree/master/asia",
9 | "funding": [
10 | "https://ko-fi.com/tunnckoCore/commissions",
11 | "https://github.com/sponsors/tunnckoCore"
12 | ],
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/tunnckoCore/opensource.git",
16 | "directory": "asia/asia"
17 | },
18 | "type": "module",
19 | "main": "src/index.js",
20 | "files": [
21 | "src",
22 | "*-example.js",
23 | "logo.png"
24 | ],
25 | "engines": {
26 | "node": ">=16 <17 || >=18 <19 || >=20"
27 | },
28 | "publishConfig": {
29 | "access": "public",
30 | "registry": "https://registry.npmjs.org",
31 | "tag": "latest"
32 | },
33 | "scripts": {},
34 | "dependencies": {
35 | "asia-core": "*"
36 | },
37 | "keywords": [
38 | "testing",
39 | "innovative",
40 | "test",
41 | "runner",
42 | "concurrency",
43 | "parallel",
44 | "incremental",
45 | "incremental testing",
46 | "fast runner",
47 | "assertion",
48 | "promises",
49 | "async await",
50 | "async",
51 | "await",
52 | "function",
53 | "caching",
54 | "snapshots",
55 | "test framework",
56 | "test runner",
57 | "asia",
58 | "ava",
59 | "jest"
60 | ],
61 | "contributors": [
62 | "Charlike Mike Reagent "
63 | ]
64 | }
65 |
--------------------------------------------------------------------------------
/asia/asia/src/index.js:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MPL-2.0
2 |
3 | import path from 'node:path';
4 | import process from 'node:process';
5 | import fs from 'node:fs/promises';
6 | import asia, { loadConfig } from 'asia-core';
7 |
8 | import main from './main.js';
9 |
10 | const core = await main({
11 | fs,
12 | path,
13 | asia,
14 | loadConfig,
15 | cwd: process.cwd(),
16 | env: process.env,
17 | nextTick: process.nextTick,
18 | });
19 |
20 | export const { cwd, test, run, env, cache, Cache, config, configPath } = core;
21 |
22 | export default test;
23 |
--------------------------------------------------------------------------------
/asia/asia/src/main.js:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MPL-2.0
2 |
3 | import Cache from './cache.js';
4 |
5 | export default async function main(settings = {}) {
6 | const { cwd, path, fs, env, asia, loadConfig, nextTick } = settings;
7 | const configPath = path.resolve(cwd, 'asia.config.js');
8 | const config = await loadConfig(configPath);
9 | const cfg = { cwd, path, fs, env, ...config };
10 |
11 | const cache = env.ASIA_NO_CACHE === '1' ? new Map() : new Cache(cfg);
12 |
13 | if (env.ASIA_NO_AUTORUN === undefined) {
14 | // eslint-disable-next-line no-unused-expressions
15 | cache.prepare && (await cache.prepare());
16 | }
17 | if (env.ASIA_RELOAD === '1') {
18 | await cache.clear();
19 | }
20 | // console.log("config", config);
21 | const { test, run } = asia({
22 | tests: cache,
23 | env,
24 | ...config,
25 | });
26 |
27 | if (env.ASIA_NO_AUTORUN === undefined) {
28 | const start = async () => {
29 | await run();
30 | };
31 |
32 | if (nextTick) {
33 | nextTick(start);
34 | } else {
35 | setTimeout(start, 0);
36 | }
37 | }
38 |
39 | return {
40 | cwd,
41 | test,
42 | run,
43 | env,
44 | cache,
45 | Cache,
46 | config,
47 | configPath,
48 | };
49 | }
50 |
--------------------------------------------------------------------------------
/asia/asia/src/mod.ts:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MPL-2.0
2 |
3 | import * as path from 'https://deno.land/std/path/mod.ts';
4 | import asia, { loadConfig } from 'https://esm.sh/asia-core';
5 |
6 | import main from './main.js';
7 |
8 | const fs = {
9 | mkdir: Deno.mkdir,
10 | stat: Deno.stat,
11 | async readFile(...args) {
12 | return Deno.readTextFile(...args);
13 | },
14 | async writeFile(...args) {
15 | return Deno.writeTextFile(...args);
16 | },
17 | async rm(...args) {
18 | return Deno.remove(...args);
19 | },
20 | };
21 |
22 | const core = await main({
23 | fs,
24 | path,
25 | asia,
26 | loadConfig,
27 | cwd: Deno.cwd(),
28 | env: Deno.env.toObject(),
29 | });
30 |
31 | export const { cwd, test, run, env, cache, Cache, config, configPath } = core;
32 |
33 | export default test;
34 |
--------------------------------------------------------------------------------
/asia/asia/test/index.js:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MPL-2.0
2 |
3 | import assert from 'node:assert/strict';
4 | import test from 'asia';
5 | import mod from '../src/index.js';
6 |
7 | // eslint-disable-next-line no-promise-executor-return
8 | const delay = async (ms) => new Promise((resolve) => setTimeout(resolve, ms));
9 |
10 | test('todo tests for asia package', async () => {
11 | await delay(5000);
12 | assert.equal(typeof mod, 'function');
13 | });
14 |
--------------------------------------------------------------------------------
/hela.config.foo.js:
--------------------------------------------------------------------------------
1 | import { hela } from '@hela/core';
2 |
3 | export const cli = hela().option('--foo [bar]', 'some new global flag');
4 |
5 | export const init = cli
6 | .command('init', 'Initialize a project')
7 | .alias('innit', 'inti')
8 | .option('--foo [bar]', 'Some flag descr')
9 | .action(() => {
10 | console.log('init!!!');
11 | });
12 |
13 | export const ensInit = cli
14 | .command('ens init', 'initialize some ens things')
15 | .alias('intit', 'initit', 'inint')
16 | .action(({ options }, { settings }) => {
17 | console.log('ens initialized', options, settings);
18 | });
19 |
20 | export const ensCreate = cli
21 | .command('ens create [...names]', 'Create collection')
22 | .alias('create', 'creat', 'craet', 'craete', 'cr')
23 | .action(async ({ collection, names, options }, { globalOptions }) => {
24 | console.log('create!');
25 | console.log('collection:', collection);
26 | console.log('names:', names);
27 | console.log('options:', options);
28 | console.log('globalOptions:', globalOptions);
29 | });
30 |
--------------------------------------------------------------------------------
/hela.config.js:
--------------------------------------------------------------------------------
1 | import tckPreset from '@hela/preset-tunnckocore';
2 | import * as ensPreset from '@hela/preset-ens';
3 |
4 | export default async () => {
5 | const tck = await tckPreset();
6 | // const tck = {};
7 |
8 | return { ...tck, ...ensPreset };
9 | };
10 |
--------------------------------------------------------------------------------
/modules/arr-includes/.verb.md:
--------------------------------------------------------------------------------
1 | ## API
2 |
3 |
4 |
5 | {%= include(process.cwd() + "/docs/src/index.md") %}
6 | {%= include(process.cwd() + "/docs/src/main.md") %}
7 |
8 |
9 |
--------------------------------------------------------------------------------
/modules/arr-includes/docs/src/index.md:
--------------------------------------------------------------------------------
1 | _Generated using [jest-runner-docs](https://ghub.now.sh/jest-runner-docs)._
2 |
3 | ### [arrIncludes](./src/index.js#L33)
4 |
5 | Check if any of `values` exists on `arr`.
6 |
7 |
8 |
9 | #### Signature
10 |
11 | ```ts
12 | function(arr, values)
13 | ```
14 |
15 |
16 |
17 | #### Params
18 |
19 | - `arr` **{Array}** - array to check
20 | - `values` **{Array<string>}** - array or string
21 | - `returns` **{boolean|number}** - returns `false` if not found, `true` if
22 | **index is 0** from the array, otherwise `number` index
23 |
24 |
25 |
26 | #### Examples
27 |
28 | ```js
29 | import arrIncludes from 'arr-includes';
30 |
31 | console.log(arrIncludes([1, 'bar', 55], 2)); // => false
32 | console.log(arrIncludes([1, 'bar', 3], 3)); // => 2
33 |
34 | console.log(arrIncludes([1, 'bar', 3, true], false)); // => false
35 | console.log(arrIncludes([1, 'bar', 44, true], true)); // => 3
36 |
37 | console.log(arrIncludes(['foo', 'bar'], 'baz')); // => false
38 | console.log(arrIncludes(['foo', 'bar'], 'foo')); // => true
39 | console.log(arrIncludes(['qux', 'foo', 'bar'], 'foo')); // => 1
40 | console.log(arrIncludes([true, 'qqq', 'bar'], true)); // => true
41 | console.log(arrIncludes(['true', 'qqq', 'bar'], true)); // => false
42 | console.log(arrIncludes(['qqq', 'bar', true], true)); // => 2
43 | console.log(arrIncludes(['qqq', 'true', 'bar'], true)); // => false
44 | console.log(arrIncludes([false, 'foo', null, 'bar'], null)); // => 2
45 |
46 | console.log(arrIncludes(['foo', 'bar', 'qux'], ['a', 'b', 'c'])); // => false
47 | console.log(arrIncludes(['b', 'a', 'c'], ['a', 'b', 'c'])); // => 1
48 | console.log(arrIncludes(['foo', 'bb', 'b'], ['a', 'b'])); // => 2
49 | console.log(arrIncludes(['foo', 'bar', 'qux'], ['a', 'b', 'foo'])); // => true
50 | console.log(arrIncludes(['bar', 123, 'foo', 'qux'], ['a', 'b', 'foo'])); // => 2
51 | ```
52 |
--------------------------------------------------------------------------------
/modules/arr-includes/docs/src/main.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/arr-includes/docs/src/main.md
--------------------------------------------------------------------------------
/modules/arr-includes/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "arr-includes",
3 | "version": "3.0.0",
4 | "licenseStart": 2016,
5 | "license": "MPL-2.0",
6 | "description": "Return positive value if (any of the) passed value(s) exists in array, or optionally an index",
7 | "author": "Charlike Mike Reagent ",
8 | "homepage": "https://github.com/tunnckoCore/opensource/tree/master/modules/arr-includes",
9 | "funding": [
10 | "https://ko-fi.com/tunnckoCore/commissions",
11 | "https://github.com/sponsors/tunnckoCore"
12 | ],
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/tunnckoCore/opensource.git",
16 | "directory": "modules/arr-includes"
17 | },
18 | "type": "module",
19 | "main": "src/index.js",
20 | "files": [
21 | "src"
22 | ],
23 | "engines": {
24 | "node": ">=16 <17 || >=18 <19 || >=20"
25 | },
26 | "publishConfig": {
27 | "access": "public",
28 | "registry": "https://registry.npmjs.org",
29 | "tag": "latest"
30 | },
31 | "scripts": {
32 | "cov": "c8 asia --force",
33 | "test": "asia"
34 | },
35 | "dependencies": {},
36 | "keywords": [
37 | "arr",
38 | "arr-includes",
39 | "arr-utils",
40 | "array",
41 | "array-utils",
42 | "array-values",
43 | "checks",
44 | "developer-experience",
45 | "development",
46 | "dx",
47 | "exists",
48 | "hela",
49 | "in-array",
50 | "includes",
51 | "tunnckocore-oss",
52 | "tunnckocorehq",
53 | "validate",
54 | "values"
55 | ],
56 | "contributors": [
57 | "Charlike Mike Reagent "
58 | ]
59 | }
60 |
--------------------------------------------------------------------------------
/modules/ens-collections/collections/1-hex-club.json:
--------------------------------------------------------------------------------
1 | {
2 | "info": {
3 | "slug": "1-hex-club",
4 | "supply": 16,
5 | "verified": true,
6 | "links": [
7 | "https://hexclub.xyz/"
8 | ],
9 | "community": [
10 | "https://twitter.com/HexClubXYZ",
11 | "https://discord.gg/3y8xUv3bPB"
12 | ],
13 | "description": "0x1Hex Names.",
14 | "name": "1 Hex Club"
15 | },
16 | "data": {
17 | "0x0": "54150054000164941675390259045115203326037893245501150849182749919201908758544",
18 | "0x1": "62432108329564178383255170694663347557424097136529787829583401216295056205379",
19 | "0x2": "92509134768190587119088376435002208647851121060143263932875215089967733324690",
20 | "0x3": "1324904887013455203527194722010460967762793429137898373629911136958084583435",
21 | "0x4": "39559565985096985950136960230636863282131715541408245492006395963487729978751",
22 | "0x5": "89895729449727245069782143449625671226650153695515666490122487642977865065311",
23 | "0x6": "114057945720985919470111787414876516145593597370433740063318244375692300171747",
24 | "0x7": "1822456037698063798519625814596377223794249664416004701824279290106916706313",
25 | "0x8": "85750333000841917629567020274618543072183134513288368297458505951340434893273",
26 | "0x9": "9669844402299551906857692349088176001372704311109510007657791585924310205675",
27 | "0xa": "16616700541202236319934612924717497874380679914174379691914908572708845228651",
28 | "0xb": "96354477010080668891147147121403238835869388281529551645834553496373047517148",
29 | "0xc": "33314204243394313694088793663405028996052090447511995282417935822152511439544",
30 | "0xd": "34673565388308767452823437158462800187965698525573412180055552012355925318266",
31 | "0xe": "70704689372426046737619215963921903537788217614679998299931375718468900871004",
32 | "0xf": "21159738960378346334540840143390322631802868391463414097415359656949114549487"
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/modules/ens-collections/collections/3-letter-months.json:
--------------------------------------------------------------------------------
1 | {
2 | "info": {
3 | "slug": "3-letter-months",
4 | "supply": 12,
5 | "verified": false,
6 | "links": [],
7 | "community": [],
8 | "description": "Months in the Gregorian calendar abbreviated to 3 letters",
9 | "name": "3 Letter Months"
10 | },
11 | "data": {
12 | "apr": "51710016748691802371356882056228467454795871140216405229607671835206086078100",
13 | "aug": "75958480284524554810633550897160997678390846330996804397947974437040712511794",
14 | "dec": "103601924682907006367073138113732791246677174971425205036455503509478601205915",
15 | "feb": "37118193944790803849879112794230018722232052348639704076153913816534232212763",
16 | "jan": "114583604393215775459468301289512364740765854338150995721479231186789264185488",
17 | "jul": "57211805784429243405327086257048493811506658289904343549342163680560375747151",
18 | "jun": "53813042913610157550547339857858796870578549388014459785371290831045407456252",
19 | "mar": "23550433206357988250707791848435684884677736682543580726035294853671126523974",
20 | "may": "3669056128594919146974697450084099364707893044416239415617042546220763682592",
21 | "nov": "76338021615844943871942863296786023820798260665782400973431914383878457494980",
22 | "oct": "58752050930831250663675656606407141852988352833969773492242815164690321572305",
23 | "sep": "11456043622363470916996968767874400996288449184863880613780342484691141843802"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/modules/ens-collections/collections/full-months.json:
--------------------------------------------------------------------------------
1 | {
2 | "info": {
3 | "slug": "full-months",
4 | "supply": 12,
5 | "verified": false,
6 | "links": [],
7 | "community": [],
8 | "description": "Full Months in the Gregorian calendar",
9 | "name": "Full Months"
10 | },
11 | "data": {
12 | "april": "32204501216624945251598865820144571365295720223551708871190834676743801725878",
13 | "august": "112746113187120990392627080173438194880307600152498136335103491033336832433884",
14 | "december": "9863763023054027800903559758741768474913064009940911627745448074740977945554",
15 | "february": "23065025146163415490529764004436830175327179777007535725047190915903633357691",
16 | "january": "70370102992850348289409756990443583736934944636878062125634164608699068154283",
17 | "july": "50242184724701749407719232792357717213758555066266642151590263803436060170142",
18 | "june": "75836376597555778174869636041535557083431911231068425832382134202043967395163",
19 | "march": "11750511295129226206911022724516043670773786058290604346819203476119286767085",
20 | "may": "3669056128594919146974697450084099364707893044416239415617042546220763682592",
21 | "november": "22032433163512531367397864198897318819992252306019514456689820992308735920503",
22 | "october": "74883793989775991804367732347849963178063712349923059949019030161261291588987",
23 | "september": "67959500463021183592936743041099537028513716417125944885351887667236720703264"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/modules/ens-collections/logos/0x10k-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/0x10k-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/0x99-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/0x99-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/0x999-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/0x999-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/0xemojis.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/0xemojis.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/1-hex-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/1-hex-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/100k-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/100k-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/10k-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/10k-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/2-hex-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/2-hex-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/24-clock-times.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/24-clock-times.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/24h-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/24h-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/3-digit-palindromes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/3-digit-palindromes.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/3-hex-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/3-hex-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/3-letter-all-vowels.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/3-letter-all-vowels.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/3-letter-dictionary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/3-letter-dictionary.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/3-letter-first-names.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/3-letter-first-names.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/3-letter-palindromes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/3-letter-palindromes.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/3-letters.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/3-letters.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/360-degree-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/360-degree-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/365-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/365-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/4-digit-palindromes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/4-digit-palindromes.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/4-letter-dictionary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/4-letter-dictionary.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/5-digit-palindromes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/5-digit-palindromes.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/5-letter-dictionary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/5-letter-dictionary.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/6-digit-palindromes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/6-digit-palindromes.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/99-temperature-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/99-temperature-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/999-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/999-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/arabic-10k-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/arabic-10k-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/arabic-3-digit-palindromes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/arabic-3-digit-palindromes.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/arabic-999-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/arabic-999-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/binary-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/binary-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/bip39-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/bip39-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/braille-999-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/braille-999-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/capital-cities.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/capital-cities.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/countries.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/countries.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/country-codes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/country-codes.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/country-leaders.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/country-leaders.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/english-adjectives.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/english-adjectives.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/english-nouns.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/english-nouns.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/english-verbs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/english-verbs.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/ens-date-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/ens-date-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/ens-full-date-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/ens-full-date-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/ethmoji-99-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/ethmoji-99-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/ethmoji-999-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/ethmoji-999-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/ethmoji-double-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/ethmoji-double-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/ethmoji-single-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/ethmoji-single-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/ethmoji-triple-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/ethmoji-triple-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/first-names-female.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/first-names-female.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/first-names-male.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/first-names-male.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/flag-country-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/flag-country-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/gen1-pokemons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/gen1-pokemons.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/greek-alphabet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/greek-alphabet.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/harry-potter-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/harry-potter-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/hindi-10k-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/hindi-10k-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/hindi-999-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/hindi-999-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/hyphens-ll.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/hyphens-ll.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/hyphens-ln-nl.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/hyphens-ln-nl.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/hyphens-nn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/hyphens-nn.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/hyphens-nnn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/hyphens-nnn.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/jurassic-ens.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/jurassic-ens.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/languages-of-the-world.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/languages-of-the-world.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/marvel-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/marvel-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/mmdd-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/mmdd-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/mnemonic-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/mnemonic-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/naruto-names.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/naruto-names.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/nasdaq-index-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/nasdaq-index-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/palindrome-cities.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/palindrome-cities.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/pokemon-trainer-dao-japanese.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/pokemon-trainer-dao-japanese.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/pokemon-trainer-dao.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/pokemon-trainer-dao.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/poker-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/poker-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/pre-punk-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/pre-punk-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/psalms-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/psalms-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/roman-numerals-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/roman-numerals-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/single-digit-multiply.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/single-digit-multiply.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/the-969s.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/the-969s.png
--------------------------------------------------------------------------------
/modules/ens-collections/logos/the-cents-club.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunnckoCore/opensource/a45321fb1f44e323762d1c1c464f1a2594447063/modules/ens-collections/logos/the-cents-club.png
--------------------------------------------------------------------------------
/modules/ens-collections/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ens-collections",
3 | "version": "0.4.0",
4 | "licenseStart": 2022,
5 | "license": "Apache-2.0",
6 | "description": "Utilities for creating, managing and working with standardized ENS-based collections.",
7 | "author": "Charlike Mike Reagent ",
8 | "homepage": "https://github.com/tunnckoCore/opensource/tree/master/modules/ens-collections",
9 | "funding": [
10 | "https://ko-fi.com/tunnckoCore/commissions",
11 | "https://github.com/sponsors/tunnckoCore"
12 | ],
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/tunnckoCore/opensource.git",
16 | "directory": "modules/ens-collections"
17 | },
18 | "type": "module",
19 | "main": "src/index.js",
20 | "files": [
21 | "src"
22 | ],
23 | "engines": {
24 | "node": ">=16 <17 || >=18 <19 || >=20"
25 | },
26 | "publishConfig": {
27 | "access": "public",
28 | "registry": "https://registry.npmjs.org",
29 | "tag": "latest"
30 | },
31 | "scripts": {},
32 | "dependencies": {
33 | "@tunnckocore/p-all": "^0.2.0",
34 | "bn.js": "5.2.1",
35 | "idna-uts46-hx": "^4.0.3",
36 | "keccak256": "1.0.6"
37 | },
38 | "contributors": [
39 | "Charlike Mike Reagent "
40 | ]
41 | }
42 |
--------------------------------------------------------------------------------
/modules/formidable-mini/benchmark/package.json:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/modules/formidable-mini/fixture.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * useful-error
3 | *
4 | * Copyright (c) 2016 Charlike Mike Reagent <@tunnckoCore> (http://www.tunnckocore.tk)
5 | * Released under the MIT license.
6 | */
7 |
8 | /* eslint-disable */
9 | 'use strict';
10 |
11 | const util = require('util');
12 | const utils = require('./utils');
13 |
14 | module.exports = utils.errorBase('UsefulError', function (message, options) {
15 | if (typeof message === 'object') {
16 | options = message;
17 | message = false;
18 | }
19 |
20 | const format =
21 | options && typeof options.format === 'function'
22 | ? options.format
23 | : defaultFormat;
24 | const opts = utils.extend(
25 | {
26 | showStack: true,
27 | message: (message && message.length && message) || false,
28 | },
29 | options,
30 | );
31 |
32 | opts.message =
33 | typeof opts.message === 'function'
34 | ? opts.message.call(this, opts)
35 | : typeof opts.message === 'string'
36 | ? opts.message
37 | : '';
38 |
39 | utils.delegate(this, opts);
40 | utils.errorFormat(this, format);
41 |
42 | if (this.showStack === false && hasOwn(this, 'stack')) {
43 | delete this.stack;
44 | }
45 | });
46 |
47 | /**
48 | * > Default error `toString` method formatting.
49 | *
50 | * @param {String} `headline`
51 | * @return {String}
52 | */
53 |
54 | function defaultFormat(headline) {
55 | return util.format(
56 | '%s (at %s:%s:%s)',
57 | headline,
58 | this.filename,
59 | this.line,
60 | this.column,
61 | );
62 | }
63 |
64 | /**
65 | * > Has own property util.
66 | *
67 | * @param {OBject} `self`
68 | * @param {String} `key`
69 | * @return {Boolean}
70 | */
71 |
72 | function hasOwn(self, key) {
73 | return Object.hasOwn(self, key);
74 | }
75 |
--------------------------------------------------------------------------------
/modules/formidable-mini/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "formidable-mini",
3 | "version": "0.1.0",
4 | "description": "Your favorite `multipart/form-data` module now simpler, smaller, faster, and more spec & web-compliant",
5 | "main": "src/index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "type": "module",
10 | "keywords": [],
11 | "author": "",
12 | "license": "MPL-2.0",
13 | "dependencies": {
14 | "cuid": "^2.1.8",
15 | "fetch-blob": "^3.1.5",
16 | "filenamify": "^5.1.1",
17 | "formdata-polyfill": "^4.0.10"
18 | },
19 | "devDependencies": {
20 | "busboy": "^1.6.0",
21 | "formidable": "v2",
22 | "multiparty": "^4.2.3"
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/modules/formidable-mini/src/index.js:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MPL-2.0
2 |
3 | import { FormidableFile } from './FormidableFile.js';
4 | import { multipart } from './multipart.js';
5 |
6 | export * from 'fetch-blob';
7 |
8 | export class Formidable {
9 | constructor(options = {}) {
10 | this.options = { hooks: {}, ...options };
11 | }
12 |
13 | async formData(req, options = {}) {
14 | this.options = { ...this.options, ...options };
15 |
16 | const { parser, toFormData } = await multipart(req, this.options);
17 |
18 | Formidable.mockParser(parser, this.options.hooks);
19 |
20 | return toFormData({ request: req, parser });
21 | }
22 |
23 | static mockParser(parser = {}, hooks = {}) {
24 | const hooksList = Object.keys(parser)
25 | .filter((x) => x.startsWith('on'))
26 | .concat('onEnd');
27 |
28 | const hooksMap = { ...hooks };
29 |
30 | for (const hookName of hooksList) {
31 | const hookFn = parser[hookName];
32 |
33 | // eslint-disable-next-line no-param-reassign
34 | parser[hookName] = (...args) => {
35 | // eslint-disable-next-line no-unused-expressions
36 | hooksMap[hookName] && hooksMap[hookName](...args);
37 | hookFn(...args);
38 | };
39 | }
40 | }
41 |
42 | async parse(req, options = {}) {
43 | this.options = { ...this.options, ...options };
44 |
45 | const result = { files: new Set(), fields: new Set() };
46 | const formData = await this.formData(req, this.options);
47 |
48 | for (const [name, value] of formData.entries()) {
49 | const isFile = value instanceof FormidableFile;
50 |
51 | if (isFile) {
52 | result.files.add(value);
53 | } else {
54 | result.fields.add({ name, value });
55 | }
56 | }
57 |
58 | return result;
59 | }
60 | }
61 |
62 | export default function formidable(options) {
63 | return new Formidable(options);
64 | }
65 |
66 | export { formidable };
67 | export { Blob } from 'fetch-blob';
68 | export { FormData, multipart, MultipartParser } from './multipart.js';
69 | export { File, FormidableFile } from './FormidableFile.js';
70 |
--------------------------------------------------------------------------------
/modules/gitcommit/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "gitcommit",
3 | "version": "1.0.14",
4 | "licenseStart": 2020,
5 | "license": "MPL-2.0",
6 | "description": "WIP: Lightweight and joyful `git commit` replacement. Conventional Commits compliant.",
7 | "author": "Charlike Mike Reagent ",
8 | "homepage": "https://github.com/tunnckoCore/opensource/tree/master/modules/gitcommit",
9 | "funding": [
10 | "https://ko-fi.com/tunnckoCore/commissions",
11 | "https://github.com/sponsors/tunnckoCore"
12 | ],
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/tunnckoCore/opensource.git",
16 | "directory": "modules/gitcommit"
17 | },
18 | "type": "module",
19 | "main": "src/index.js",
20 | "files": [
21 | "src"
22 | ],
23 | "engines": {
24 | "node": ">=16 <17 || >=18 <19 || >=20"
25 | },
26 | "publishConfig": {
27 | "access": "public",
28 | "registry": "https://registry.npmjs.org",
29 | "tag": "latest"
30 | },
31 | "scripts": {},
32 | "dependencies": {
33 | "execa": "^3.0.0",
34 | "prompts": "^2.0.0",
35 | "yaro": "*"
36 | },
37 | "jest": {
38 | "coverageThreshold": {
39 | "src/**/*.js": {
40 | "statements": 100,
41 | "branches": 100,
42 | "functions": 100,
43 | "lines": 100
44 | }
45 | }
46 | },
47 | "keywords": [
48 | "tunnckocorehq",
49 | "tunnckocore-oss",
50 | "hela",
51 | "development",
52 | "developer-experience",
53 | "dx",
54 | "monorepos",
55 | "tooling",
56 | "software development",
57 | "jest",
58 | "jest system",
59 | "build system",
60 | "monorepo tools",
61 | "multirepo",
62 | "jest build",
63 | "management"
64 | ],
65 | "contributors": [
66 | "Charlike Mike Reagent "
67 | ]
68 | }
69 |
--------------------------------------------------------------------------------
/modules/gitcommit/src/index.js:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MPL-2.0
2 |
3 | export default function gitcommit() {
4 | return 123;
5 | }
6 |
--------------------------------------------------------------------------------
/modules/gitcommit/test/index.js:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MPL-2.0
2 |
3 | import assert from 'node:assert/strict';
4 | import test from 'asia';
5 | import mod from '../src/index.js';
6 |
7 | test('todo tests for gitcommit package', async () => {
8 | assert.equal(typeof mod, 'function');
9 | });
10 |
--------------------------------------------------------------------------------
/modules/ip-filter/.verb.md:
--------------------------------------------------------------------------------
1 | ## API
2 |
3 |
4 |
5 | {%= include(process.cwd() + "/docs/src/index.md") %}
6 |
7 |
8 |
--------------------------------------------------------------------------------
/modules/ip-filter/docs/src/index.md:
--------------------------------------------------------------------------------
1 | _Generated using [jest-runner-docs](https://ghub.now.sh/jest-runner-docs)._
2 |
3 | ### [ipFilter](./src/index.js#L44)
4 |
5 | Filter `ip` against glob `patterns`, using [micromatch][] under the hood, so
6 | `options` are passed to it.
7 |
8 |
9 |
10 | #### Signature
11 |
12 | ```ts
13 | function(ip, patterns, options)
14 | ```
15 |
16 |
17 |
18 | #### Params
19 |
20 | - `ip` **{string}** - Accepts only valid IPs by default
21 | - `patterns` **{string|array}** - Basically everything that [micromatch][]'s
22 | second argument can accept.
23 | - `options` **{object}** - Pass `strict: false` if want to validate non-ip
24 | values, options are also passed to [micromatch][].
25 | - `returns` **{string}** - a `string` or `null` If not match returns `null`,
26 | otherwise the passed `ip` as string.
27 |
28 |
29 |
30 | #### Examples
31 |
32 | ```js
33 | const ipFilter = require('ip-filter');
34 |
35 | console.log(ipFilter('123.77.34.89', '123.??.34.8*')); // => '123.77.34.89'
36 | console.log(ipFilter('123.222.34.88', '123.??.34.8*')); // => null
37 | console.log(ipFilter('123.222.33.1', ['123.*.34.*', '*.222.33.*'])); // => '123.222.33.1'
38 |
39 | // should notice the difference
40 | console.log(ipFilter('123.222.34.88', ['123.*.34.*', '!123.222.**']));
41 | // => null
42 | console.log(ipFilter('123.222.34.88', ['123.*.34.*', '!123.222.*']));
43 | // => '123.222.34.88'
44 | ```
45 |
46 |
47 |
48 | #### Examples
49 |
50 | ```js
51 | const ipFilter = require('ip-filter');
52 | //
53 | // NON-STRICT mode
54 | //
55 |
56 | const res = ipFilter('x-koaip', ['*-koaip', '!foo-koa*'], { strict: false });
57 | console.log(res); // => 'x-koaip'
58 |
59 | const res = ipFilter('x-koa.foo', ['*-koa.*', '!foo-koa.*'], { strict: false });
60 | console.log(res); // => 'x-koa.foo'
61 | ```
62 |
--------------------------------------------------------------------------------
/modules/kind-error/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "kind-error",
3 | "version": "0.1.0",
4 | "description": "foo bar",
5 | "author": "Charlike Mike Reagent ",
6 | "funding": [
7 | "https://ko-fi.com/tunnckoCore/commissions",
8 | "https://github.com/sponsors/tunnckoCore"
9 | ],
10 | "repository": {
11 | "type": "git",
12 | "url": "https://github.com/tunnckoCore/opensource.git",
13 | "directory": "packages/kind-error"
14 | },
15 | "type": "module",
16 | "main": "index.js",
17 | "engines": {
18 | "node": ">=16 <17 || >=18 <19 || >=20"
19 | },
20 | "publishConfig": {
21 | "access": "public",
22 | "tag": "latest"
23 | },
24 | "dependencies": {},
25 | "contributors": [
26 | "Charlike Mike Reagent "
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/modules/to-file-path/.verb.md:
--------------------------------------------------------------------------------
1 | ## API
2 |
3 |
4 |
5 | {%= include(process.cwd() + "/docs/src/index.md") %}
6 |
7 |
8 |
--------------------------------------------------------------------------------
/modules/to-file-path/docs/src/index.md:
--------------------------------------------------------------------------------
1 | _Generated using [jest-runner-docs](https://ghub.now.sh/jest-runner-docs)._
2 |
3 | ### [toFilePath](./src/index.js#L23)
4 |
5 | Create filepath from different type of arguments.
6 |
7 |
8 |
9 | #### Signature
10 |
11 | ```ts
12 | function(args)
13 | ```
14 |
15 |
16 |
17 | #### Params
18 |
19 | - `...args` **{string|array|Arguments|number|boolean}** - Pass any type and any
20 | number of arguments.
21 | - `returns` **{string}** - always slash separated filepath
22 |
23 |
24 |
25 | #### Examples
26 |
27 | ```js
28 | const toFilePath = require('to-file-path');
29 |
30 | console.log(toFilePath('foo.bar.baz')); // => 'foo/bar/baz'
31 | console.log(toFilePath('foo.bar', 'qux.baz', 'xxx')); // => 'foo/bar/qux/baz/xxx'
32 | console.log(toFilePath('foo', 'qux', 'baz')); // => 'foo/qux/baz'
33 | console.log(toFilePath([1, 2, 3], 'foo', 4, 'bar')); // => '1/2/3/foo/4/bar'
34 | console.log(toFilePath(null, true)); // => 'null/true'
35 | console.log(toFilePath(1, 2, 3)); // => '1/2/3'
36 | ```
37 |
--------------------------------------------------------------------------------
/modules/to-file-path/src/index.js:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MPL-2.0
2 |
3 | import arrMap from 'arr-map';
4 | import isArguments from 'is-arguments';
5 |
6 | /**
7 | * Create filepath from different type of arguments.
8 | *
9 | * @example
10 | * import toFilePath from 'to-file-path';
11 | *
12 | * console.log(toFilePath('foo.bar.baz')); // => 'foo/bar/baz'
13 | * console.log(toFilePath('foo.bar', 'qux.baz', 'xxx')); // => 'foo/bar/qux/baz/xxx'
14 | * console.log(toFilePath('foo', 'qux', 'baz')); // => 'foo/qux/baz'
15 | * console.log(toFilePath([1, 2, 3], 'foo', 4, 'bar')); // => '1/2/3/foo/4/bar'
16 | * console.log(toFilePath(null, true)); // => 'null/true'
17 | * console.log(toFilePath(1, 2, 3)); // => '1/2/3'
18 | *
19 | * @param {string|array|Arguments|number|boolean} `...args` Pass any type and any number of arguments.
20 | * @return {string} always slash separated filepath
21 | * @api public
22 | */
23 | export default function toFilePath(args) {
24 | if (arguments.length > 1) {
25 | // eslint-disable-next-line prefer-rest-params
26 | return toFilePath(arguments);
27 | }
28 |
29 | if (Array.isArray(args) || isArguments(args)) {
30 | return arrMap(args, (val) => toFilePath(val)).join('/');
31 | }
32 |
33 | if (typeof args === 'string') {
34 | return args.split('.').join('/');
35 | }
36 |
37 | let val = args;
38 | if (typeof args === 'object') {
39 | val = JSON.stringify(args);
40 | }
41 |
42 | return toFilePath(String(val));
43 | }
44 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "monorepo",
4 | "workspaces": [
5 | "@tunnckocore/*",
6 | "@hela/*",
7 | "modules/*",
8 | "xaxa/*",
9 | "yaro/*",
10 | "asia/*"
11 | ],
12 | "type": "module",
13 | "scripts": {
14 | "cleanup": "node scripts/clean-node-modules.js && rm -f package-lock.json yarn.lcok",
15 | "cli": "npx @hela/cli@latest",
16 | "filter": "yarn cli filter",
17 | "filter:asia": "yarn filter '*asia*'",
18 | "filter:hela": "yarn filter '*hela*'",
19 | "filter:xaxa": "yarn filter '*xaxa*'",
20 | "filter:yaro": "yarn filter '*yaro*'",
21 | "fmt": "prettier '**/*.{js,json}' --write",
22 | "fresh": "yarn cleanup && npm install --force && yarn cli init",
23 | "lint": "xaxa --log",
24 | "new": "node scripts/create-package.js",
25 | "pub:asia": "yarn cli publish $(yarn cli filter '*asia*') --verbose",
26 | "pub:hela": "yarn cli publish $(yarn cli filter '*hela*') --verbose",
27 | "pub:xaxa": "yarn cli publish $(yarn cli filter '*xaxa*') --verbose",
28 | "pub:yaro": "yarn cli publish $(yarn cli filter '*yaro*') --verbose",
29 | "test": "asia"
30 | },
31 | "dependencies": {
32 | "c8": "^7.11.3",
33 | "eslint": "^8.18.0",
34 | "eslint-formatter-codeframe": "^7.32.1",
35 | "expect": "^28.1.1",
36 | "fast-glob": "^3.2.11",
37 | "minargs": "*",
38 | "minimist": "*",
39 | "mri": "*",
40 | "nopt": "*",
41 | "prettier": "^2.7.1",
42 | "yargs-parser": "*"
43 | },
44 | "hela": "@hela/preset-tunnckocore",
45 | "contributors": [
46 | "Charlike Mike Reagent (https://tunnckocore.com)"
47 | ],
48 | "prettier": "@tunnckocore/prettier-config",
49 | "eslintConfig": {
50 | "extends": [
51 | "xaxa"
52 | ],
53 | "rules": {
54 | "max-statements": "off"
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/scripts/clean-node-modules.js:
--------------------------------------------------------------------------------
1 | // import Tinypool from 'tinypool';
2 |
3 | // const pool = new Tinypool({
4 | // filename: new URL(`./worker.js`, import.meta.url).href,
5 | // minThreads: 4,
6 | // maxThreads: 8,
7 | // });
8 |
9 | // await parallel(affected, ({ value: fp }) => {
10 | // const url = new URL(`./${fp}`, import.meta.url);
11 |
12 | // return pool
13 | // .run({ min: 400, max: 4000, filepath: url.pathname })
14 | // .then((x) => console.log(url.pathname, 'done', x));
15 | // });
16 |
17 | // console.log(new URL(`./packages/asia-core`, import.meta.url));
18 |
19 | import path from 'node:path';
20 | import fs from 'node:fs/promises';
21 | import fastGlob from 'fast-glob';
22 |
23 | const stream = fastGlob.stream(['**/node_modules/**'], {
24 | onlyDirectories: true,
25 | });
26 |
27 | for await (const entry of stream) {
28 | await fs.rm(path.resolve(entry), { recursive: true, force: true });
29 | // .editorconfig
30 | // services/index.js
31 | }
32 |
--------------------------------------------------------------------------------
/xaxa/README.md:
--------------------------------------------------------------------------------
1 | # xaxa
2 |
3 | Zero-config linting, Instant Fast. Powered by few amazing unicorns, AirBnB &
4 | Prettier.
5 |
6 | ```
7 | xaxa --help
8 | ```
9 |
10 | package.json
11 |
12 | ```json
13 | {
14 | "scripts": {
15 | "lint": "xaxa"
16 | }
17 | }
18 | ```
19 |
--------------------------------------------------------------------------------
/xaxa/eslint-config-xaxa/README.md:
--------------------------------------------------------------------------------
1 | # eslint-config-xaxa
2 |
3 | Zero-config linting, Instant Fast. Powered by few amazing unicorns, AirBnB &
4 | Prettier.
5 |
6 | ```
7 | yarn add -D eslint-config-xaxa
8 | ```
9 |
10 | eslint config
11 |
12 | ```json
13 | {
14 | "eslintConfig": {
15 | "extends": ["xaxa"]
16 | }
17 | }
18 | ```
19 |
--------------------------------------------------------------------------------
/xaxa/eslint-config-xaxa/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "eslint-config-xaxa",
3 | "version": "4.1.0",
4 | "licenseStart": 2018,
5 | "license": "Apache-2.0",
6 | "description": "Zero-config linting, powered by few amazing unicorns, AirBnB & Prettier.",
7 | "author": "Charlike Mike Reagent ",
8 | "homepage": "https://github.com/tunnckoCore/opensource/tree/master/xaxa/eslint-config-xaxa",
9 | "funding": [
10 | "https://ko-fi.com/tunnckoCore/commissions",
11 | "https://github.com/sponsors/tunnckoCore"
12 | ],
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/tunnckoCore/opensource.git",
16 | "directory": "xaxa/eslint-config-xaxa"
17 | },
18 | "type": "commonjs",
19 | "main": "src/index.js",
20 | "files": [
21 | "src"
22 | ],
23 | "engines": {
24 | "node": ">=16 <17 || >=18 <19 || >=20"
25 | },
26 | "publishConfig": {
27 | "access": "public",
28 | "registry": "https://registry.npmjs.org",
29 | "tag": "latest"
30 | },
31 | "scripts": {},
32 | "dependencies": {
33 | "@tunnckocore/prettier-config": "*",
34 | "eslint-config-airbnb-base": "^15.0.0",
35 | "eslint-config-prettier": "^8.5.0",
36 | "eslint-import-resolver-alias": "^1.1.2",
37 | "eslint-plugin-import": "^2.26.0",
38 | "eslint-plugin-no-use-extend-native": "^0.5.0",
39 | "eslint-plugin-node": "^11.1.0",
40 | "eslint-plugin-prettier": "^4.1.0",
41 | "eslint-plugin-promise": "^6.0.0",
42 | "eslint-plugin-unicorn": "^42.0.0"
43 | },
44 | "keywords": [
45 | "eslint",
46 | "es6",
47 | "esmodules",
48 | "es module",
49 | "linting",
50 | "lint parallel",
51 | "parallel",
52 | "fast",
53 | "format",
54 | "prettier",
55 | "eslint-prettier",
56 | "prettier-eslint",
57 | "airbnb",
58 | "codestyle",
59 | "styleguide",
60 | "modern javascript",
61 | "javascript",
62 | "promises",
63 | "typescript",
64 | "unicorn"
65 | ],
66 | "contributors": [
67 | "Charlike Mike Reagent "
68 | ]
69 | }
70 |
--------------------------------------------------------------------------------
/xaxa/eslint-config-xaxa/src/index.js:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: Apache-2.0
2 |
3 | /* eslint-disable unicorn/prefer-module */
4 |
5 | const { getESLintConfig } = require('./main.js');
6 |
7 | module.exports = getESLintConfig();
8 |
--------------------------------------------------------------------------------
/xaxa/xaxa/README.md:
--------------------------------------------------------------------------------
1 | # xaxa
2 |
3 | Zero-config linting, Instant Fast. Powered by few amazing unicorns, AirBnB &
4 | Prettier.
5 |
6 | ```
7 | xaxa --help
8 | ```
9 |
10 | package.json
11 |
12 | ```json
13 | {
14 | "scripts": {
15 | "lint": "xaxa"
16 | }
17 | }
18 | ```
19 |
--------------------------------------------------------------------------------
/xaxa/xaxa/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "xaxa",
3 | "version": "4.1.0",
4 | "licenseStart": 2018,
5 | "license": "Apache-2.0",
6 | "description": "Zero-config linting, powered by few amazing unicorns, AirBnB & Prettier.",
7 | "author": "Charlike Mike Reagent ",
8 | "homepage": "https://github.com/tunnckoCore/opensource/tree/master/xaxa",
9 | "funding": [
10 | "https://ko-fi.com/tunnckoCore/commissions",
11 | "https://github.com/sponsors/tunnckoCore"
12 | ],
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/tunnckoCore/opensource.git",
16 | "directory": "xaxa/xaxa"
17 | },
18 | "type": "module",
19 | "main": "src/index.js",
20 | "files": [
21 | "src"
22 | ],
23 | "bin": "src/bin.js",
24 | "engines": {
25 | "node": ">=16 <17 || >=18 <19 || >=20"
26 | },
27 | "publishConfig": {
28 | "access": "public",
29 | "registry": "https://registry.npmjs.org",
30 | "tag": "latest"
31 | },
32 | "scripts": {},
33 | "dependencies": {
34 | "eslint": "^8.18.0",
35 | "eslint-config-xaxa": "*",
36 | "glob-cache": "^1.0.5",
37 | "yaro": "*"
38 | },
39 | "keywords": [
40 | "xaxa",
41 | "eslint",
42 | "es6",
43 | "esmodules",
44 | "es module",
45 | "linting",
46 | "lint parallel",
47 | "parallel",
48 | "fast",
49 | "format",
50 | "prettier",
51 | "eslint-prettier",
52 | "prettier-eslint",
53 | "airbnb",
54 | "codestyle",
55 | "styleguide",
56 | "modern javascript",
57 | "javascript",
58 | "promises",
59 | "typescript",
60 | "unicorn"
61 | ],
62 | "contributors": [
63 | "Charlike Mike Reagent "
64 | ]
65 | }
66 |
--------------------------------------------------------------------------------
/xaxa/xaxa/src/bin.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | // SPDX-License-Identifier: Apache-2.0
4 |
5 | import process from 'node:process';
6 | import path from 'node:path';
7 | import { fileURLToPath } from 'node:url';
8 | import { createCli, command, isRequired } from 'yaro';
9 | import { readJSON, lint } from './index.js';
10 |
11 | const pkgRoot = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
12 | const pkg = readJSON(path.join(pkgRoot, 'package.json'));
13 | const cwd = process.cwd();
14 |
15 | const xaxa = command(
16 | '[...files]',
17 | 'Lint and format files with ESLint --fix and Prettier.',
18 | )
19 | .option('--cwd', 'Working directory, defaults to `process.cwd()`.', cwd)
20 | .option('--log', 'Log per changed file', false)
21 | .option('-f, --force', 'Force lint, cleaning the cache.', false)
22 | .option('-c, --config', 'Path to config file.', {
23 | default: 'xaxa.config.js',
24 | required: isRequired,
25 | })
26 | .option('--workspace-file', 'File path to write workspaces metadata.', {
27 | default: 'hela-workspace.json',
28 | required: isRequired,
29 | // type: 'string',
30 | // normalize: true,
31 | })
32 | .option('--verbose', 'Print more verbose output.', false)
33 | .action(async (options, files) => {
34 | await lint(files, options);
35 | });
36 |
37 | await createCli({
38 | commands: { xaxa },
39 | version: pkg.version,
40 | name: pkg.name,
41 | });
42 |
--------------------------------------------------------------------------------