Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ dist/
# IDE
.vscode/*
!.vscode/extensions.json
!.vscode/settings.json
.idea
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore artifacts:
dist
Comment thread
chenjiahan marked this conversation as resolved.
pnpm-lock.yaml
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["rstack.rslint", "esbenp.prettier-vscode"]
}
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"search.useIgnoreFiles": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,20 +142,20 @@ Transform the final string after all replacements.

Toggle individual features (all enabled by default):

| Feature | Default | Description |
|---|---|---|
| `replaceWorkspace` | `true` | `/foo/packages/core/src` → `<WORKSPACE>/src` |
| `replaceRoot` | `true` | `/foo/node_modules/.pnpm` → `<ROOT>/node_modules/.pnpm` |
| `replaceWorkspaceWithFileProtocol` | `true` | `file:///foo/packages/core/src` → `<WORKSPACE>/src` |
| `replaceRootWithFileProtocol` | `true` | `file:///foo/node_modules/.pnpm` → `<ROOT>/node_modules/.pnpm` |
| `replacePnpmInner` | `true` | Collapse pnpm's long `.pnpm/...` and global virtual store `pnpm/store/.../links/...` paths to `<PNPM_INNER>` |
| `replaceTmpDir` | `true` | `os.tmpdir()` paths → `<TEMP>` |
| `replaceHomeDir` | `true` | `os.homedir()` paths → `<HOME>` |
| `transformWin32Path` | `true` | Convert `D:\\foo\\bar` to `/d/foo/bar` |
| `transformCLR` | `true` | Normalize ANSI color escape codes |
| `escapeDoubleQuotes` | `true` | Escape `"` to `\"` |
| `escapeEOL` | `true` | Normalize `\r\n` to `\n` |
| `addDoubleQuotes` | `true` | Wrap output in double quotes |
| Feature | Default | Description |
| ---------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------ |
| `replaceWorkspace` | `true` | `/foo/packages/core/src` → `<WORKSPACE>/src` |
| `replaceRoot` | `true` | `/foo/node_modules/.pnpm` → `<ROOT>/node_modules/.pnpm` |
| `replaceWorkspaceWithFileProtocol` | `true` | `file:///foo/packages/core/src` → `<WORKSPACE>/src` |
| `replaceRootWithFileProtocol` | `true` | `file:///foo/node_modules/.pnpm` → `<ROOT>/node_modules/.pnpm` |
| `replacePnpmInner` | `true` | Collapse pnpm's long `.pnpm/...` and global virtual store `pnpm/store/.../links/...` paths to `<PNPM_INNER>` |
| `replaceTmpDir` | `true` | `os.tmpdir()` paths → `<TEMP>` |
| `replaceHomeDir` | `true` | `os.homedir()` paths → `<HOME>` |
| `transformWin32Path` | `true` | Convert `D:\\foo\\bar` to `/d/foo/bar` |
| `transformCLR` | `true` | Normalize ANSI color escape codes |
| `escapeDoubleQuotes` | `true` | Escape `"` to `\"` |
| `escapeEOL` | `true` | Normalize `\r\n` to `\n` |
| `addDoubleQuotes` | `true` | Wrap output in double quotes |

More details can be found in [./src/types.ts](https://github.com/rspack-contrib/path-serializer/blob/main/src/types.ts).

Expand Down
29 changes: 0 additions & 29 deletions biome.json

This file was deleted.

31 changes: 19 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
"version": "0.6.0",
"type": "module",
"description": "path-serializer",
"keywords": ["snapshot", "rstest", "vitest", "jest", "ci", "test"],
"keywords": [
"snapshot",
"rstest",
"vitest",
"jest",
"ci",
"test"
],
"repository": {
"type": "git",
"url": "git+https://github.com/rstackjs/path-serializer.git"
Expand All @@ -21,33 +28,38 @@
"main": "./dist/cjs/index.cjs",
"module": "./dist/esm/index.js",
"types": "./dist/esm/index.d.ts",
"files": ["dist", "README.md", "LICENSE"],
"files": [
"dist",
"README.md",
"LICENSE"
],
"scripts": {
"build": "rslib build",
"dev": "rslib build --watch",
"lint": "biome check --write",
"prepare": "pnpm run build && simple-git-hooks",
"lint": "rslint && prettier -c .",
"lint:write": "rslint --fix && prettier -w .",
"prepare": "simple-git-hooks && pnpm run build",
"test:watch": "rstest --watch",
"test": "rstest",
"prepublish": "pnpm run build",
"bump": "npx bumpp"
},
"simple-git-hooks": {
"pre-commit": "npx nano-staged"
"pre-commit": "pnpm run lint:write"
Comment thread
chenjiahan marked this conversation as resolved.
},
Comment thread
chenjiahan marked this conversation as resolved.
"devDependencies": {
"rsbuild-plugin-publint": "^0.3.4",
"@biomejs/biome": "^1.9.4",
"@microsoft/api-extractor": "^7.48.0",
"@rslib/core": "0.18.6",
"@rslint/core": "^0.5.0",
"@rstest/adapter-rslib": "0.2.1",
"@rstest/core": "0.9.2",
"@types/lodash-es": "^4.17.12",
"@types/node": "^22.10.1",
"execa": "9.5.1",
"fs-extra": "11.2.0",
"lodash-es": "^4.17.21",
"nano-staged": "^0.8.0",
"prettier": "^3.8.3",
"semver": "7.6.3",
"simple-git-hooks": "^2.11.1",
"slash": "5.1.0",
Expand All @@ -58,10 +70,5 @@
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"nano-staged": {
"*.{js,jsx,ts,tsx,mjs,cjs,json}": [
"biome check --write --no-errors-on-unmatched"
]
}
}
Loading
Loading