Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support for config files (json and jsonc) #557

Merged
merged 21 commits into from
Jul 20, 2024
Merged

Conversation

wellwelwel
Copy link
Owner

@wellwelwel wellwelwel commented Jul 19, 2024

By default, Poku comes with the most common usage pre-set, but you can configure it as you want.

JSON and JSONC

Create a poku.json (or poku.jsonc) in your project's root directory, for example:

{
  "$schema": "https://poku.io/schemas/configs.json",
  "include": ["."],
  "parallel": false,
  "debug": false,
  "filter": ".test.|.spec.", // regex as string
  "exclude": "", // regex as string
  "failFast": false,
  "concurrency": 0, // No limit
  "quiet": false,
  "platform": "node", // "node", "bun" and "deno"
  "deno": {
    "allow": ["run", "env", "read", "hrtime", "net"],
    "deny": [], // Same as allow
    "cjs": [".js", ".cjs"], // specific extensions
    // "cjs": true // all extensions
    // "cjs": false // no polyfill
  }
}
  • The $schema property allows an JSON intelisense to assist you customize Poku.
  • All options are optional.

Default Configuration Files

In priority order.

  • poku.json
  • poku.jsonc
  • .pokurc.json
  • .pokurc.jsonc
  • .pokurc
  • Using a duplicate configuration via CLI will overwrite the option in the configuration file.
  • If there are multiple configuration files in the same directory, Poku will search for — and use — only one.

Custom File

npx poku --config='my-file.json'
npx poku --config='my-file.jsonc'
npx poku --config='my-file'

Note

CLI usage only.

Copy link

codecov bot commented Jul 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (71df0ac) to head (f83cf94).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #557   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           25        26    +1     
  Lines         2279      2306   +27     
  Branches       439       414   -25     
=========================================
+ Hits          2279      2306   +27     
Flag Coverage Δ
linux 99.26% <100.00%> (+<0.01%) ⬆️
osx 100.00% <100.00%> (ø)
windows ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wellwelwel wellwelwel marked this pull request as ready for review July 19, 2024 23:38
@wellwelwel wellwelwel merged commit e954336 into main Jul 20, 2024
28 checks passed
@wellwelwel wellwelwel deleted the config-file branch July 20, 2024 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant