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

DT monorepo conversion TODOs #751

Open
59 of 86 tasks
jakebailey opened this issue Oct 3, 2023 · 0 comments
Open
59 of 86 tasks

DT monorepo conversion TODOs #751

jakebailey opened this issue Oct 3, 2023 · 0 comments

Comments

@jakebailey
Copy link
Member

jakebailey commented Oct 3, 2023

This issue holds ongoing TODOs for the DT monorepo conversion, currently happening at https://github.com/jakebailey/DefinitelyTyped/tree/pnpm-workspaces-working.

TODO

Release day TODO

Later TODO

sandersn added a commit that referenced this issue Oct 10, 2023
1. Check pnpm overrides
2. Remove done TODOs, or long-term ones that are now recorded in #751
3. Clean up some unused code.
4. Rename some properties to be shorter.
sandersn added a commit that referenced this issue Oct 17, 2023
* remove baseUrl/typeRoots

linting starts and then fails because tests can't resolve their types
packages

* WIP dtslint checks

I'm at the point of checking `version` and I think I need to copy code
from definition-parser maybe. Visions of semver parsing...

* check version in package.json

* update to ts@next to match DT

* Switch from no-outside-dependencies to import/no-extraneous-dependencies

It's already written!

Also make deepEqual traverse ojbects as well as arrays.

* Fix used-files calculation and improve error output

Show all unused files at once, not just the first unused one.

* allow all @types deps

* Mostly done switching to package.json dep/devDeps

Deletes a whole bunch of stuff and simplifies or reworks others.

I noticed that we still want to walk the file looking for globals SO I
have to put back in huge chunks of code I took out. Creating a commit so
I can diff on github.

* Restore code for finding global values in source

Everything builds now!

* definitions-parser tests pass

* *now* definitions-parser tests all pass

* Make generate-packages tests pass

* npm i -> pnpm i (compiles but hasn't run yet)

* Delete installDependencies entirely

It's only one line of code now

* Remove pathMapping check in definition-parser

Also all (?) the infrastructure needed to support it.

* slice multiple prefixes from resolved filenames

self-references sometimes result in doubled
'node_modules/@types/self-package-name' prefixes.

* add debug entrypoint for dtslint-runner

* Switch from index.d.ts header to package.json

Lots of code churn and probable bugs, but no real functionality change
right now. In the future this makes it much easier to mimic real ES
module layouts.

* Require either contributor url XOR githubUsername

Plus update typescript again to match DT

* Switch to reporting errors at end, not throwing one at a time

* 1. Remove npm consistency checks in dtslint-runner. They are unused.
2. Simplify and reduce JSON parsing in dtslint-runner. Pass around
AllPackages object instead of writing it to disk and reading it over and
over.
3. Sort AllPackages object before returning it in addition to before
writing it to disk.

* Switch to more semver

Still not 100% semver, but the common paths now use it.

* Package publication works now.

Only a few fixes needed this time!

* Fix merge conflict mistakes

* Test fixes

Still a couple of failures, but:

1. Fix bad merge in typescript-versions. (Re-update tests for 5.3)
2. Update patch version .0 -> .99999 everywhere.
3. In definitions-parser, stop formatting versions manually and use the
utility function. Which is correct, unlike the several different
mistakes I made elsewhere when formatting them.

* 1. Add two new external dependencies
2. Allow two more keys in package.json -- these are not yet checked!
3. Fix npm-naming test in dtslint -- another .0 -> .99999
4. Uncomment a throw that I had turned in a console.log for debugging.
This makes a test pass but might break actual runs; I haven't checked
yet.

* dprint

* fix lint

* Fix version of packages after parsing

Should be N.M.99999 not N.M.0
Probably.

* Minor fixes

1. allow 'path' in tsconfig, not in package.json
2. In dts-critic, throw when header-parser finds errors instead of
squelching.

* realpath when enumerating files

* Rename name-related fields (#752)

* Rename name-related fields

* Update related tests

* Type check all tests on pnpm build

* Fix remaining tests

* Fix typo

Co-authored-by: Jake Bailey <[email protected]>

* Delete unused function

* Don’t use pkg.desc for output directory

* My most common precedence mistake

* Fix contributor printing in README

---------

Co-authored-by: Jake Bailey <[email protected]>

* Include nonNpm in published package.json

* Pnpm workspaces: fix dtslint-runner incremental (#753)

* WIP: fix dtslint-runner incremental

Switch to `pnpm ls` to detect dependencies, not our own code

* Everything working

Lots of cleanup left though

* add another note

* Address PR comments:

1. change jakebailey/pnpm-workspaces-working back to master and make
settings constants for both.
2. Use semver.satisfies for finding packages that depend on deleted
packages.

* getAffectedPackages:array of errors, don't throw

Enables reporting multiple errors in one run.

* fix lint

* Cleanup and TODOs

1. Check pnpm overrides
2. Remove done TODOs, or long-term ones that are now recorded in #751
3. Clean up some unused code.
4. Rename some properties to be shorter.

* Move more things to header-parser

1. checkPackageJson*
2. getLicenseFromPackageJson

* Parse with semver

Instead of initially parsing ourselves and then parsing LATER with
semver.

* require devDeps to have self-ref w/workspace:.

* Move semver deps

From dtslint-runner and utils to header-parser

* Forbid references to old /v* packages

* make definitions-parser error handling more like header-parser

* new validation for tsconfig "paths"

* format files

* Remove lint + a couple of TODOs

* lint rule to forbid old header

* new lint: forbid devDep imports in .d.ts

* Allow self-reference in no-import-of-dev-dependencies

Also improve `pnpm install --filter` instructions in dtslint.

* forbid pinning on-DT @types/ packages

* update READMEs

* make dtslint example files more generic

* Edits from self-review of PR

* npmNaming: report all errors always

* dtslint-runner --clone SHA runs pnpm install once again

* fix direction of clone check

* Remove globals, make praser not crash on empty directories, remove dead code

* Remove obsolete test

* Finish removing globals stuff

* Package.json: change properties and patch version

1. Patch version is now .9999 not .99999
2. contributors -> owners
3. typeScriptVersion -> minimumTypeScriptVersion

Note that the publisher should still produce a package.json with
a contributor property.

* address PR comments

* Update dts-critic message to reference package.json instead of header comment

* dts-critic correctly passes typesVersions to header-parser

To correctly allow/disallow types/typesVersion in tsconfig

* allow 0.0 versions to mismatch npm again

* get-affected-packages: check for dependents by package name

* dtslint-runner: Simplify getAffectedPackagesFromDiff

It has a bunch of dead code!

* Add changeset for shipping

---------

Co-authored-by: Andrew Branch <[email protected]>
Co-authored-by: Andrew Branch <[email protected]>
Co-authored-by: Jake Bailey <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant