# Clone the repository
$ git clone git@github.com:umijs/tnf.git
$ cd tnf
# Install dependencies
$ pnpm install
# Install Playwright browsers
$ pnpm playwright install chromium
It'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:e2e
When 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 it
Based 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 release
Release create-tnf package:
$ pnpm release:create-tnf
We 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
fs
andpath
modules. - Do use
pathe
instead ofpath
module 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`