Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PNPM workspaces #663

Merged
merged 71 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
b144b97
remove baseUrl/typeRoots
sandersn Mar 28, 2023
689ccfc
WIP dtslint checks
sandersn Mar 30, 2023
85f0532
check version in package.json
sandersn Mar 31, 2023
2dbbcee
update to ts@next to match DT
sandersn Mar 31, 2023
683cbf2
Switch from no-outside-dependencies to import/no-extraneous-dependencies
sandersn Mar 31, 2023
2a62b4b
Fix used-files calculation and improve error output
sandersn Mar 31, 2023
9ffae5f
allow all @types deps
sandersn Mar 31, 2023
55bde30
Mostly done switching to package.json dep/devDeps
sandersn Apr 3, 2023
b19ebf4
Restore code for finding global values in source
sandersn Apr 3, 2023
3b866d1
definitions-parser tests pass
sandersn Apr 3, 2023
c30e50a
*now* definitions-parser tests all pass
sandersn Apr 3, 2023
ffc9fc4
Make generate-packages tests pass
sandersn Apr 3, 2023
da605a2
npm i -> pnpm i (compiles but hasn't run yet)
sandersn Apr 10, 2023
3d5cd40
Delete installDependencies entirely
sandersn Apr 10, 2023
a336a4e
Remove pathMapping check in definition-parser
sandersn Apr 10, 2023
ecac2cc
slice multiple prefixes from resolved filenames
sandersn Apr 10, 2023
39d5fe7
add debug entrypoint for dtslint-runner
sandersn Apr 13, 2023
72c0633
Switch from index.d.ts header to package.json
sandersn Apr 14, 2023
2c80d98
Require either contributor url XOR githubUsername
sandersn Apr 17, 2023
05fcf43
Switch to reporting errors at end, not throwing one at a time
sandersn Apr 17, 2023
dfa99bd
1. Remove npm consistency checks in dtslint-runner. They are unused.
sandersn Apr 17, 2023
7bca052
Switch to more semver
sandersn Apr 19, 2023
1749d27
Package publication works now.
sandersn May 12, 2023
fbbc16d
Merge branch 'master' into pnpm-workspaces
andrewbranch Sep 27, 2023
1747765
Fix merge conflict mistakes
andrewbranch Sep 27, 2023
c0890ef
Merge branch 'master' into pnpm-workspaces
sandersn Oct 2, 2023
0e51163
Test fixes
sandersn Oct 2, 2023
069c892
1. Add two new external dependencies
sandersn Oct 2, 2023
957cb23
dprint
sandersn Oct 2, 2023
8a19bd0
fix lint
sandersn Oct 2, 2023
3626e27
Fix version of packages after parsing
sandersn Oct 2, 2023
b302acc
Minor fixes
sandersn Oct 3, 2023
246e90d
Merge branch 'master' into pnpm-workspaces
andrewbranch Oct 3, 2023
ce65d47
Merge branch 'master' into pnpm-workspaces
andrewbranch Oct 3, 2023
a93d80e
realpath when enumerating files
andrewbranch Oct 3, 2023
f0903be
Rename name-related fields (#752)
andrewbranch Oct 5, 2023
7cf05ac
Include nonNpm in published package.json
andrewbranch Oct 5, 2023
8a2d200
Pnpm workspaces: fix dtslint-runner incremental (#753)
sandersn Oct 9, 2023
669100b
getAffectedPackages:array of errors, don't throw
sandersn Oct 9, 2023
6c3f181
fix lint
sandersn Oct 9, 2023
1c95ea2
Cleanup and TODOs
sandersn Oct 10, 2023
fc9aa97
Move more things to header-parser
sandersn Oct 10, 2023
a80c7dd
Parse with semver
sandersn Oct 10, 2023
ea10c0d
require devDeps to have self-ref w/workspace:.
sandersn Oct 10, 2023
67ad027
Move semver deps
sandersn Oct 10, 2023
f22f195
Forbid references to old /v* packages
sandersn Oct 10, 2023
249031c
make definitions-parser error handling more like header-parser
sandersn Oct 10, 2023
cef6149
new validation for tsconfig "paths"
sandersn Oct 10, 2023
d5f2a9d
format files
sandersn Oct 10, 2023
cda4775
Remove lint + a couple of TODOs
sandersn Oct 11, 2023
e5a2fb2
lint rule to forbid old header
sandersn Oct 11, 2023
a99ce6c
new lint: forbid devDep imports in .d.ts
sandersn Oct 11, 2023
7d58195
Allow self-reference in no-import-of-dev-dependencies
sandersn Oct 12, 2023
53402d2
forbid pinning on-DT @types/ packages
sandersn Oct 12, 2023
2b3ad3b
update READMEs
sandersn Oct 13, 2023
12b8ddc
make dtslint example files more generic
sandersn Oct 13, 2023
beb0355
Edits from self-review of PR
sandersn Oct 16, 2023
9266a75
npmNaming: report all errors always
sandersn Oct 16, 2023
1095384
dtslint-runner --clone SHA runs pnpm install once again
sandersn Oct 16, 2023
4aba26b
fix direction of clone check
sandersn Oct 16, 2023
102c3f3
Remove globals, make praser not crash on empty directories, remove de…
andrewbranch Oct 16, 2023
945114b
Remove obsolete test
andrewbranch Oct 16, 2023
b3509c5
Finish removing globals stuff
andrewbranch Oct 16, 2023
86a0736
Package.json: change properties and patch version
sandersn Oct 16, 2023
577b7da
address PR comments
sandersn Oct 16, 2023
2bfab35
Update dts-critic message to reference package.json instead of header…
andrewbranch Oct 17, 2023
2904537
dts-critic correctly passes typesVersions to header-parser
sandersn Oct 17, 2023
f1c69db
allow 0.0 versions to mismatch npm again
sandersn Oct 17, 2023
b4e40d1
get-affected-packages: check for dependents by package name
sandersn Oct 17, 2023
1e7bb28
dtslint-runner: Simplify getAffectedPackagesFromDiff
sandersn Oct 17, 2023
4a24663
Add changeset for shipping
sandersn Oct 17, 2023
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
47 changes: 42 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,48 @@
"version": "0.2.0",
"configurations": [
{
"type": "pwa-chrome",
"name": "dtslint-runner local all",
"program": "${workspaceFolder}/packages/dtslint-runner/dist/index.js",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
"skipFiles": [
"<node_internals>/**"
],
"args": [
"--path", "../DefinitelyTyped", "--selection", "all", "--localTypeScriptPath", "../../ts/built/local",
],

"type": "node"
},
{
"name": "jest",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"args": [ "definitions-parser"],
"type": "node"
},
{
"name": "dts-critic test",
"program": "${workspaceFolder}/packages/dts-critic/dist/index.js",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"args": [ "--dts", "packages/dts-critic/testsource/tslib/index.d.ts", ],
"type": "node"
},
{
"name": "dtslint aframe",
"program": "${workspaceFolder}/packages/dtslint/dist/index.js",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"args": [ "../DefinitelyTyped/types/aframe", ],

"type": "node"
},
]
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
"@typescript-eslint/eslint-plugin": "^5.55.0",
"@typescript-eslint/parser": "^5.55.0",
"eslint": "^7.31.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsdoc": "^30.7.8",
"jest": "^29.5.0",
"lerna": "^4.0.0",
"prettier": "^2.6.2",
"ts-jest": "^29.0.5",
"tslint": "^6.1.2",
"tslint-microsoft-contrib": "^6.2.0",
"typescript": "^5.0.2"
"typescript": "next"
}
}
18 changes: 4 additions & 14 deletions packages/definitions-parser/src/get-affected-packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import {
PackageBase,
getMangledNameForScopedPackage,
formatDependencyVersion,
removeTypesScope,
} from "./packages";
import { tryParsePackageVersion } from './lib/definition-parser';

export interface Affected {
readonly changedPackages: readonly TypingsData[];
Expand All @@ -25,11 +27,6 @@ export function getAffectedPackages(allPackages: AllPackages, changedPackageIds:
return { changedPackages: changed, dependentPackages: sortPackages(dependent), allPackages };
}

/** Every package name in the original list, plus their dependencies (incl. dependencies' dependencies). */
export function allDependencies(allPackages: AllPackages, packages: Iterable<TypingsData>): TypingsData[] {
return sortPackages(transitiveClosure(packages, (pkg) => allPackages.allDependencyTypings(pkg)));
}

/** Collect all packages that depend on changed packages, and all that depend on those, etc. */
function collectDependers(
changedPackages: PackageId[],
Expand Down Expand Up @@ -87,15 +84,8 @@ function getReverseDependencies(
}
}
for (const typing of allPackages.allTypings()) {
for (const [name, version] of Object.entries(typing.dependencies)) {
const dependencies = map.get(packageIdToKey(allPackages.tryResolve({ name, version })));
if (dependencies) {
dependencies[1].add(typing.id);
}
}
for (const dependencyName of typing.testDependencies) {
const version = typing.pathMappings[dependencyName] || "*";
const dependencies = map.get(packageIdToKey(allPackages.tryResolve({ name: dependencyName, version })));
for (const [ name, version ] of typing.allPackageJsonDependencies()) {
const dependencies = map.get(packageIdToKey(allPackages.tryResolve({ name: removeTypesScope(name), version: tryParsePackageVersion(version) })));
if (dependencies) {
dependencies[1].add(typing.id);
}
Expand Down
3 changes: 1 addition & 2 deletions packages/definitions-parser/src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,12 @@ export async function getAffectedPackagesFromDiff(

const affected =
selection === "all"
? { changedPackages: allPackages.allTypings(), dependentPackages: [], allPackages }
? { changedPackages: allPackages.allTypings(), dependentPackages: [] }
: selection === "affected"
? getAffectedPackages(allPackages, gitChanges(diffs))
: {
changedPackages: allPackages.allTypings().filter((t) => selection.test(t.name)),
dependentPackages: [],
allPackages,
};

console.log(
Expand Down
Loading