Commit Graph

54 Commits

Author SHA1 Message Date
Zoltan Kochan
540986f326 refactor: rename peersSuffix to peerDepGraphHash (#9656) 2025-06-17 02:27:58 +02:00
btea
adb236f1a1 refactor: improve regexp (#9203) 2025-03-02 13:17:09 +01:00
Hiroshi Ogawa
d55b2595dd fix(dependency-path)!: escape # character in directory name (#8557) 2024-09-23 03:21:04 +02:00
Zoltan Kochan
dcd2917ec7 feat!: use sha256 for hashing long paths inside node_modules/.pnpm 2024-09-15 18:51:51 +02:00
Zoltan Kochan
47341e5004 fix: make the peers suffix shorter (#8177)
ref #7079
2024-06-07 23:37:07 +02:00
Zoltan Kochan
c649954e41 refactor: create a separate type for DepPath (#8094) 2024-05-20 16:11:46 +02:00
Zoltan Kochan
45f4262f03 refactor: create a separate type for NodeId (#8092) 2024-05-17 11:23:52 +02:00
Zoltan Kochan
9719a42d0e feat: configurable max length of directories inside node_modules/.pnpm (#7994)
close #7355
2024-04-28 11:07:29 +02:00
Khải
a5b0780eb8 refactor: return type for dependency-path (#7867)
I want to improve type checker performance as recommended by
https://github.com/microsoft/TypeScript/wiki/Performance#using-type-annotations

In order to prevent merge conflict, I will do it one module at a time
2024-04-08 18:07:45 +02:00
Zoltan Kochan
21878e7ae4 feat(lockfile)!: change the keys format (#7752) 2024-03-17 23:01:39 +01:00
Zoltan Kochan
53594a3787 feat!: package ID should be an exact version spec (#7748) 2024-03-10 14:46:25 +01:00
Zoltan Kochan
46d38a8744 fix: parsing dependency path 2024-02-09 02:27:34 +01:00
Zoltan Kochan
862c707610 fix: converting dep path to file name (#7632)
close #7631
2024-02-09 01:51:29 +01:00
Zoltan Kochan
98a126699c fix: resolve peer of peer from the deps of direct dependent package (#7606)
close #7444

Peer dependencies of peer dependencies are now resolved correctly. When peer dependencies have peer dependencies of their own, the peer dependencies are grouped with their own peer dependencies before being linked to their dependents.

For instance, if `card` has `react` in peer dependencies and `react` has `typescript` in its peer dependencies, then the same version of `react` may be linked from different places if there are multiple versions of `typescript`. For instance:

```
project1/package.json
{
  "dependencies": {
    "card": "1.0.0",
    "react": "16.8.0",
    "typescript": "7.0.0"
  }
}
project2/package.json
{
  "dependencies": {
    "card": "1.0.0",
    "react": "16.8.0",
    "typescript": "8.0.0"
  }
}
node_modules
  .pnpm
    card@1.0.0(react@16.8.0(typescript@7.0.0))
      node_modules
        card
        react --> ../../react@16.8.0(typescript@7.0.0)/node_modules/react
    react@16.8.0(typescript@7.0.0)
      node_modules
        react
        typescript --> ../../typescript@7.0.0/node_modules/typescript
    typescript@7.0.0
      node_modules
        typescript
    card@1.0.0(react@16.8.0(typescript@8.0.0))
      node_modules
        card
        react --> ../../react@16.8.0(typescript@8.0.0)/node_modules/react
    react@16.8.0(typescript@8.0.0)
      node_modules
        react
        typescript --> ../../typescript@8.0.0/node_modules/typescript
    typescript@8.0.0
      node_modules
        typescript
```

In the above example, both projects have `card` in dependencies but the projects use different versions of `typescript`. Hence, even though the same version of `card` is used, `card` in `project1` will reference `react` from a directory where it is placed with `typescript@7.0.0` (because it resolves `typescript` from the dependencies of `project1`), while `card` in `project2` will reference `react` with `typescript@8.0.0`.
2024-02-09 00:50:08 +01:00
Zoltan Kochan
89b396b4c6 refactor!: createPeersFolderSuffix renamed to createPeersDirSuffix 2024-02-08 00:52:21 +01:00
Zoltan Kochan
cdd83654dd feat!: don't include registry URL in package ID (#7476) 2024-01-08 11:57:44 +01:00
Zoltan Kochan
d381a6001c feat!: use dependency path format from lockfile v6 (#7470)
Drop lockfile v5 support.
2024-01-08 11:57:44 +01:00
LaicZhang
41b5eb7a5b perf: replace startsWith with === (#7138) 2023-09-27 16:32:05 +03:00
Brandon Cheng
e9aa6f682a chore(deps): update TypeScript 5.1.6 -> 5.2.2 (#7016)
* test: use sha512 integrity in fixtures to fix ci break

* test: update snapshots for sha512 fixture change

* chore(deps): remove unneeded peer dependency exception

The `peerDependencyRules.allowedVersions` exception on
`@typescript-eslint/eslint-plugin` no longer seems to be necessary.
Removing it does not introduce any new peer dependency errors on
`pnpm install`.

I suspect this was needed for the
`eslint-config-standard-with-typescript` dependency in the past, but a
@typescript-eslint/eslint-plugin upgrade made it no longer necessary.

* chore(deps): update @typescript-eslint dependencies 5.62.0 -> 6.5.0

@typescript-eslint 6.5.0 is the first version to introduce support for
TypeScript 5.2.

https://github.com/typescript-eslint/typescript-eslint/releases/tag/v6.5.0

```
=============

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <5.2.0

YOUR TYPESCRIPT VERSION: 5.2.2

Please only submit bug reports when using the officially supported version.
```

* chore(deps): update eslint-config-standard-with-typescript 37.0.0 -> 39.0.0

Version 38.0.0 is the first version to support @typescript-eslint v6.
https://github.com/standard/eslint-config-standard-with-typescript/releases/tag/v38.0.0

Otherwise the following error appears.

```
> eslint "src/**/*.ts" "test/**/*.ts" "--fix"

Oops! Something went wrong! :(

ESLint: 8.47.0

Error: ../../.eslintrc.json » @pnpm/eslint-config » eslint-config-standard-with-typescript:
        Configuration for rule "@typescript-eslint/restrict-plus-operands" is invalid:
        Value {"checkCompoundAssignments":true} should NOT have additional properties.

    at ConfigValidator.validateRuleOptions (/Users/gluxon/Developer/pnpm/node_modules/.pnpm/@eslint+eslintrc@2.1.2/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2039:23)
    at /Users/gluxon/Developer/pnpm/node_modules/.pnpm/@eslint+eslintrc@2.1.2/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2094:18
```

* chore: remove unnecessary disables for restrict-template-expressions

The `@typescript-eslint/restrict-template-expressions` rule relaxed
what types are allowed in template expressions.

c13ce0b4f7 (diff-b852e1e199d2976eee1183fc84ac12a5d42fc61f0ae4b1c290dd54d621546db0)

Many of these disables were for interpolated values that had an `any`
type.

* chore: remove unnecessary disables for restrict-plus-operands

The original error was:

```
Invalid operand for a '+' operation. Operands must each be a number or string. Got `any`. eslint@typescript-eslint/restrict-plus-operands
```

It look like the newer version now allows `any`.

* style: fix errors of prefer-optional-chain and prefer-nullish-coalescing

The `@typescript-eslint/prefer-optional-chain` and
`@typescript-eslint/prefer-nullish-coalescing` rules got a bit
smarter. This commit applies autofixes. I believe the changes should be
equivalent to what existed before.

Example of the new `@typescript-eslint/prefer-optional-chain` lints.

```
pnpm/pkg-manifest/exportable-manifest/src/index.ts
  71:10  error  Prefer using an optional chain expression instead, as it's more concise and easier to read  @typescript-eslint/prefer-optional-chain
  87:10  error  Prefer using an optional chain expression instead, as it's more concise and easier to read  @typescript-eslint/prefer-optional-chain
```

Example of the new `@typescript-eslint/prefer-nullish-coalescing` lints.

```
pnpm/fs/find-packages/src/index.ts
  32:38  error  Prefer using nullish coalescing operator (`??`) instead of a ternary expression, as it is simpler to read  @typescript-eslint/prefer-nullish-coalescing
```

* chore(deps): update TypeScript 5.1.6 -> 5.2.2

* chore(deps): update @yarnpkg/core->@types/lodash override to 4.14.197

This fixes a compilation error that appears on TypeScript 5.2.2. This
error was fixed in a later version of `@types/lodash`.

https://github.com/DefinitelyTyped/DefinitelyTyped/pull/66123

```
../node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/index.d.ts:45:15 - error TS2428: All declarations of 'WeakMap' must have identical type parameters.

45     interface WeakMap<K extends object, V> { }
                 ~~~~~~~

Found 4 errors.
```
2023-08-31 16:27:01 +03:00
Zoltan Kochan
94f94eed63 fix: installing local dep from directory that starts with @ (#6350)
close #6332
2023-04-04 02:36:30 +03:00
Zoltan Kochan
0e26acb0fb refactor: dependency-path 2023-03-24 15:25:53 +02:00
Zoltan Kochan
ee61ca4cb7 style: update eslint (#6236) 2023-03-18 14:57:29 +02:00
Zoltan Kochan
ca8f51e60b feat: change the way directory names are shortened inside .pnpm 2023-02-10 16:30:00 +02:00
Zoltan Kochan
47e45d717d feat!: breaking config changes in v8 (#6035)
* auto-install-peers=true
* save-workspace-protocol=rolling
* publishConfig.linkDirectory true by default
* resolve-peers-from-workspace-root is true by default
* set dedupeDirectDeps to true by default in @pnpm/core.
2023-02-05 11:43:22 +02:00
Zoltan Kochan
9247f6781b fix: issues with storybook and the new lockfile format (#5998)
close #5976
2023-01-30 17:28:20 +02:00
Zoltan Kochan
0f6e95872a fix: lockfile v6 should not be corrupted on repeat install (#5905)
* fix: lockfile v6 should not be corrupted on repeat install

* fix: don't add empty specifiers to lockfile v6

* fix: lockfile v6 should be saved to node_modules/.pnpm/lock.yaml

* fix: frozen lockfile with lockfile v6
2023-01-10 11:41:17 +02:00
Zoltan Kochan
3ebce5db7a feat!: lockfile format v6 (#5810) 2023-01-09 14:37:05 +02:00
Zoltan Kochan
e379ec8a77 refactor: use more utils from ramda (#5656) 2022-11-19 04:29:21 +02:00
Zoltan Kochan
86bd1b171e fix(deps): update 2022-10-04 15:03:31 +03:00
Zoltan Kochan
fc581d371d fix: don't fail when the patched pkg appears multiple times (#4945)
Don't fail when the patched package appears multiple times in the dependency graph

close #4938
2022-06-28 02:23:48 +03:00
Zoltan Kochan
c635f9fc1a feat(patch): update patched dependencies on install (#4905) 2022-06-22 14:18:25 +03:00
Zoltan Kochan
725636a907 fix: create @pnpm/crypto.base32-hash 2022-06-18 22:58:16 +03:00
Zoltan Kochan
c576955506 fix: sanitize dir names in the store (#4726)
close #4716
2022-05-13 13:28:22 +03:00
Zoltan Kochan
0a70aedb1c feat: use a shorter hash for dep path (#4552) 2022-04-13 12:05:07 +03:00
CommanderRoot
bc35dff9a9 chore: replace deprecated String.prototype.substr() (#4479)
Co-authored-by: Zoltan Kochan <z@kochan.io>
2022-03-25 23:04:20 +02:00
Zoltan Kochan
faf830b8f6 feat: improve dep path of local deps 2022-03-19 20:39:10 +02:00
Zoltan Kochan
6c418943c3 fix: don't break the lockfile if it has peer deps with underscores (#3546)
close #3542
2021-06-20 02:40:33 +03:00
Zoltan Kochan
20e2f235da fix: installing two packages with same name in different case (#3417) 2021-05-03 23:30:36 +03:00
Zoltan Kochan
9ceab68f06 fix: use + instead of # in package paths inside node_modules/.pnpm (#3314) 2021-04-07 01:07:13 +03:00
Zoltan Kochan
e4efddbd22 fix: don't use colon in path to dependency 2021-02-20 02:06:55 +02:00
Zoltan Kochan
d6d091f249 style: use es2015 imports (#3143) 2021-02-15 05:06:10 +02:00
Zoltan Kochan
f2bb5cbeba feat: reduce directory nesting in virtual store directory (#3117)
ref #3115
2021-02-04 02:18:09 +02:00
Zoltan Kochan
e27dcf0dcc refactor(dependency-path): add depPathToFilename() 2020-12-30 12:12:08 +02:00
Zoltan Kochan
acc1782c6f style: restrict template expressions 2020-08-27 00:57:58 +03:00
Zoltan Kochan
1c8a02e996 style: use eslint instead of tslint
PR #2796
close #2300
2020-08-24 02:01:25 +03:00
Zoltan Kochan
41d92948b1 fix: installing tarballs from registry origin via non-standard URLs
close #2549
PR #2620
2020-06-09 10:55:02 +03:00
Zoltan Kochan
c75a921e36 style: no trailing commas in functions 2020-05-12 19:00:16 +03:00
Zoltan Kochan
bb5d41f337 style: add missing trailing commas and fix the linting rule 2020-01-01 19:18:25 +02:00
ExE Boss
4b56b860bc feat(dependency‑path): Expose peersSuffix
PR #2032

Co-Authored-By: Zoltan Kochan <zoltan.kochan@gmail.com>
2019-09-24 22:59:11 +03:00
Zoltan Kochan
c8d98856fa refactor: use includes() instead of indexOf() when possible 2019-04-07 13:08:26 +03:00