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

[v4.x] remove manual types #4803

Merged
merged 2 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 0 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,30 +95,5 @@ jobs:
env:
# https://docs.cypress.io/guides/references/advanced-installation#Skipping-installation
CYPRESS_INSTALL_BINARY: 0
# Need to do a bunch of work to generate the locale typings 🙃
- name: Prepare type declarations
run: |
corepack yarn run build:lib
corepack yarn run build:companion
corepack yarn run build:locale-pack
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build:locale-pack is called anywhere anymore, should we remove it @Murderlon?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is that possible? We still need to build the locale 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for building TS files. It's actually used by build:js, so my previous comment was wrong

- name: Run type tests
run: corepack yarn run test:type
- name: Drop manual tyoes
# For backward compatiblity reasons, Uppy plugins ship a manual crafted d.ts file.
# We don't want to remove that file to not break users.
# However, we want to validate the types based on the types inferred from source.
run: |
node --input-type=module <<'EOF'
import { existsSync } from 'node:fs';
import { opendir, readFile, writeFile } from 'node:fs/promises';
for await (const dirent of await opendir('./packages/@uppy')) {
if (existsSync(`./packages/@uppy/${dirent.name}/tsconfig.build.json`)) {
const pjsonPath = `./packages/@uppy/${dirent.name}/package.json`
const pjson = JSON.parse(await readFile(pjsonPath));
delete pjson.types
await writeFile(pjsonPath, JSON.stringify(pjson))
}
}
EOF
- name: Attempt building TS packages
run: corepack yarn run build:ts
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
"stylelint-config-standard": "^34.0.0",
"stylelint-config-standard-scss": "^10.0.0",
"tar": "^6.1.0",
"tsd": "^0.28.0",
"typescript": "~5.1",
"vitest": "^0.34.5",
"vue-template-compiler": "workspace:*"
Expand Down Expand Up @@ -153,7 +152,6 @@
"test:locale-packs": "yarn locale-packs:unused && yarn locale-packs:warnings",
"test:locale-packs:unused": "yarn workspace @uppy-dev/locale-pack test unused",
"test:locale-packs:warnings": "yarn workspace @uppy-dev/locale-pack test warnings",
"test:type": "yarn workspaces foreach -piv --include '@uppy/*' --exclude '@uppy/{angular,react-native,locales,companion,provider-views,robodog,svelte}' exec tsd",
"test:unit": "yarn run build:lib && yarn test:watch",
"test:watch": "vitest --environment jsdom --dir packages/@uppy",
"test": "npm-run-all lint test:locale-packs:unused test:unit test:type test:companion",
Expand Down
1 change: 0 additions & 1 deletion packages/@uppy/audio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"license": "MIT",
"main": "lib/index.js",
"style": "dist/style.min.css",
"types": "types/index.d.ts",
"keywords": [
"file uploader",
"uppy",
Expand Down
12 changes: 0 additions & 12 deletions packages/@uppy/audio/types/index.d.ts

This file was deleted.

10 changes: 0 additions & 10 deletions packages/@uppy/audio/types/index.test-d.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/@uppy/aws-s3-multipart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"license": "MIT",
"main": "lib/index.js",
"type": "module",
"types": "types/index.d.ts",
"keywords": [
"file uploader",
"aws s3",
Expand Down
7 changes: 0 additions & 7 deletions packages/@uppy/aws-s3-multipart/types/chunk.d.ts

This file was deleted.

178 changes: 0 additions & 178 deletions packages/@uppy/aws-s3-multipart/types/index.d.ts

This file was deleted.

58 changes: 0 additions & 58 deletions packages/@uppy/aws-s3-multipart/types/index.test-d.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/@uppy/aws-s3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"license": "MIT",
"main": "lib/index.js",
"type": "module",
"types": "types/index.d.ts",
"keywords": [
"file uploader",
"aws s3",
Expand Down
39 changes: 0 additions & 39 deletions packages/@uppy/aws-s3/types/index.d.ts

This file was deleted.