This PR updates the toolkit testing to:
* Determine whether to lint as a module or source file based on the
presence of any `export ` line in the file.
* Run `nu-check` on files before linting with `use <file>` or `source
<file>`
* Updates the environment variable to `TEST_METHOD` with options for
`ide-check` or `import-or-source`.
* Updates the default to `import-or-source` (was `ide-check`) to match
CI
* Removes environment variable from CI since this test method is now the
default.
With this in place we should have far fewer (false positive) failing CI
runs.
Adds `path replace-extension` as requested in https://github.com/nushell/nushell/issues/14144
Also sets up testing for candidates. In order to do this, I made
some changes:
1. ported `nu-std/testing.nu` under `stdlib-candidate` folder, and
making some changes.
2. run candidate tests in `toolkit check pr` command, to make sure the
test is run in CI.
3. including `stdlib-candidate` to `NU_LIB_DIRS` when running lint, so
the tests can pass linter.
Changes in stdlib-candidate/testing.nu:
1. remove `std/log` usage
2. including `stdlib-candidate` path in `run-test` command
i get the following LSP error in my editor, because it's true `main`
does not return a `string` 🤔

in this PR, i propose to truely return `nothing` from this _main_
command by `print`ing the help page.
### alternative
we could also change the signature to `nothing -> string`
Closes#789🍻
- Runs without first generating a script
- Returns error (file) count
- Requires `--and-exit` to exit with error code
- Enables alternative report with env `STUB_IDE_CHECK=true`
- Expands documentation
- All subcommands share same file querying
- Prepares for nupm test integration
I made a `toolkit.nu` with a very bare bones struct, this is called via
[`setup-nu`](https://github.com/hustcer/setup-nu) action, and generates
the `check-files.nu` file. After that, another nu instance run that
script to check files one by one. The folder `before_v0.60/` is
excluded.