# Clone the repository
$ git clone git@github.com:umijs/tnf.git
$ cd tnf
# Install dependencies
$ pnpm install
# Install Playwright browsers
$ pnpm playwright install chromiumIt's recommended to use Volta to manage the node and pnpm version. And you need to set the VOLTA_FEATURE_PNPM environment variable to enable pnpm support.
export VOLTA_FEATURE_PNPM=1# Start the development server
$ pnpm dev# Build the project
$ pnpm build# Preview the product after building the project
$ pnpm preview# Run all tests in watch mode
$ pnpm test
# Run all tests
$ pnpm test --run
# Run e2e tests
$ pnpm test:e2eWhen you need to submit code, please synchronize the submission of the modification log.
$ pnpm changeset
π¦ What kind of change is this for @umijs/tnf? (current version is 0.0.0-alpha.5) β¦
β― patch
minor
major
π¦ Please enter a summary for this change (this will be in the changelogs).
π¦ (submit empty line to open external editor)
π¦ Summary βΊ docs: changelog
π¦ === Summary of changesets ===
π¦ patch: @umijs/tnf
π¦
π¦ Is this your desired changeset? (Y/n) Β· true
π¦ Changeset added! - you can now commit itBased on the modified package name, select the type to be published, usually choosing patch.Then enter changelog.
After the code is merged into the main branch, it will be sent to GitHub CI to automatically change the version number of the corresponding package.
Release tnf package:
$ pnpm releaseRelease create-tnf package:
$ pnpm release:create-tnfWe use Prettier to format the code, please run pnpm format to format the code. And we also have some other rules:
- Do not use specifiers for
fsandpathmodules. - Do use
patheinstead ofpathmodule for windows compatibility.
// bad
import { writeFile } from 'fs';
import { join } from 'path';
// good
import fs from 'fs';
import path from 'pathe';- Do use
test()instead ofdescribe+it()for test cases.
// bad
describe('test', () => {
it('test', () => {});
});
// good
test('test', () => {});- Api, commands and config in README.md should be ordered alphabetically.
// bad
- `tnf foo`
- `tnf bar`
// good
- `tnf bar`
- `tnf foo`