-
Notifications
You must be signed in to change notification settings - Fork 220
Mark removed types as deprecated #138
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
Open
jablko
wants to merge
5
commits into
microsoft:main
Choose a base branch
from
jablko:patch-24
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f383b8c
Add dry runs to CI
jablko 293e2f4
Mark removed types as deprecated
jablko ba69027
Apply suggestions from code review
jablko 7b22394
Don't deprecate @types/web, etc.
jablko dc9524e
Port from libnpmsearch -> all-the-package-names
jablko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Mark removed types as deprecated | ||
#description: Loop over npm @types packages and mark as deprecated any that no longer exist in the DT repo. | ||
on: | ||
schedule: | ||
# https://crontab.guru/#0_0_*_*_0 | ||
- cron: 0 0 * * 0 | ||
workflow_call: | ||
inputs: | ||
dry-run: | ||
type: boolean | ||
workflow_dispatch: | ||
inputs: | ||
dry-run: | ||
type: boolean | ||
jobs: | ||
deprecate: | ||
if: github.event_name != 'schedule' || github.repository == 'microsoft/DefinitelyTyped-tools' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
cache: yarn | ||
- run: yarn install --frozen-lockfile | ||
- run: yarn build | ||
- name: Parse declarations | ||
run: yarn workspace @definitelytyped/publisher parse | ||
- name: Mark removed types as deprecated${{ (inputs || github.event.inputs).dry-run && ' dry run' || '' }} | ||
run: node --require source-map-support/register packages/deprecate/${{ (inputs || github.event.inputs).dry-run && ' --dry-run' || '' }} | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
NPM_TOKEN: ${{ secrets.NPM_RETAG_TOKEN }} | ||
- if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ github.job }} | ||
path: packages/definitions-parser/data/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Publish packages | ||
#description: Find changed @types packages in the DT repo and publish them to npm. | ||
on: | ||
workflow_call: | ||
inputs: | ||
dry-run: | ||
type: boolean | ||
workflow_dispatch: | ||
inputs: | ||
dry-run: | ||
type: boolean | ||
jobs: | ||
publish-packages: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
cache: yarn | ||
- run: yarn install --frozen-lockfile | ||
- run: yarn build | ||
- name: Parse declarations | ||
run: yarn workspace @definitelytyped/publisher parse | ||
- uses: actions/cache@v3 | ||
with: | ||
path: packages/utils/cache/ | ||
key: cache-${{ github.run_id }} | ||
restore-keys: cache- | ||
- name: Calculate versions | ||
run: yarn workspace @definitelytyped/publisher calculate-versions | ||
- name: Generate packages | ||
run: yarn workspace @definitelytyped/publisher generate | ||
- name: Publish packages${{ (inputs || github.event.inputs).dry-run && ' dry run' || '' }} | ||
run: yarn workspace @definitelytyped/publisher publish-packages${{ (inputs || github.event.inputs).dry-run && ' --dry' || '' }} | ||
env: | ||
GH_API_TOKEN: ${{ github.token }} | ||
NPM_TOKEN: ${{ secrets.NPM_RETAG_TOKEN }} | ||
- if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ github.job }} | ||
path: packages/definitions-parser/data/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Update npm tags | ||
#description: Refresh tags on all DT-published packages in the @types scope. | ||
on: | ||
schedule: | ||
# https://crontab.guru/#0_0_*_*_0 | ||
- cron: 0 0 * * 0 | ||
workflow_call: | ||
inputs: | ||
dry-run: | ||
type: boolean | ||
workflow_dispatch: | ||
inputs: | ||
dry-run: | ||
type: boolean | ||
jobs: | ||
retag: | ||
if: github.event_name != 'schedule' || github.repository == 'microsoft/DefinitelyTyped-tools' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
cache: yarn | ||
- run: yarn install --frozen-lockfile | ||
- run: yarn build | ||
- uses: actions/cache@v3 | ||
with: | ||
path: packages/utils/cache/ | ||
key: cache-${{ github.run_id }} | ||
restore-keys: cache- | ||
- name: Update npm tags${{ (inputs || github.event.inputs).dry-run && ' dry run' || '' }} | ||
run: yarn retag${{ (inputs || github.event.inputs).dry-run && ' --dry' || '' }} | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_RETAG_TOKEN }} | ||
- if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ github.job }} | ||
path: packages/definitions-parser/data/ |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# deprecate | ||
|
||
[](https://github.com/microsoft/DefinitelyTyped-tools/actions/workflows/deprecate.yml) | ||
|
||
Loop over npm @types packages and mark as deprecated any that no longer exist in the DT repo. | ||
|
||
## Use | ||
|
||
```sh | ||
yarn workspace @definitelytyped/publisher parse | ||
node packages/deprecate/ | ||
``` | ||
|
||
1. [Parse declarations](../publisher/README.md#parse-the-definitions). | ||
2. Run this package's script. | ||
|
||
### Options | ||
|
||
<dl><dt> | ||
|
||
`--dry-run` | ||
|
||
</dt><dd> | ||
|
||
Don't actually mark anything as deprecated, just show what would be done. | ||
|
||
</dd></dl> | ||
|
||
### Environment variables | ||
|
||
<dl><dt> | ||
|
||
`GITHUB_TOKEN` | ||
|
||
</dt><dd> | ||
|
||
Required. | ||
Used to talk to [GitHub's GraphQL API](https://docs.github.com/en/graphql/guides/forming-calls-with-graphql#authenticating-with-graphql), to find the commit/PR that removed the types. | ||
That data is public and a GitHub Actions [automatic token](https://docs.github.com/en/actions/security-guides/automatic-token-authentication) is sufficient. | ||
|
||
</dd><dt> | ||
|
||
[`NPM_TOKEN`](https://docs.npmjs.com/about-access-tokens) | ||
|
||
</dt><dd> | ||
|
||
Not required for a dry run. | ||
Only used to actually mark @types packages as deprecated. | ||
|
||
</dd></dl> | ||
|
||
## Logs | ||
|
||
GitHub Actions runs this package's script weekly. | ||
You can [examine the logs](https://github.com/microsoft/DefinitelyTyped-tools/actions/workflows/deprecate.yml). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "@definitelytyped/deprecate", | ||
"version": "1.0.0", | ||
"description": "Loop over npm @types packages and mark as deprecated any that no longer exist in the DT repo.", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"build": "tsc --build" | ||
}, | ||
"dependencies": { | ||
"@definitelytyped/definitions-parser": "^0.0.121", | ||
"@definitelytyped/utils": "^0.0.121", | ||
"@octokit/graphql": "^4.8.0", | ||
"all-the-package-names": "^2.0.176", | ||
"pacote": "^13.6.1", | ||
"typescript-dom-lib-generator": "https://github.com/microsoft/TypeScript-DOM-lib-generator.git", | ||
"yargs": "^17.5.1" | ||
}, | ||
"devDependencies": { | ||
"@types/all-the-package-names": "^1.3744.0", | ||
"@types/pacote": "^11.1.5", | ||
"@types/yargs": "^17.0.10" | ||
}, | ||
"private": true, | ||
"type": "module" | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.