-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
misc: ignore some files during npm publish #6092
Changes from 11 commits
24f1207
565fceb
b8d0bf4
4ff7dda
0417800
021a7ae
8b604d9
64c0129
e53c681
51b6f5a
0285bed
c39d463
d7a5733
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
__tests__ | ||
|
||
# Files in the templates need to stay | ||
/tsconfig* | ||
/src |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__tests__ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
src/** | ||
!src/mdx-loader.d.ts |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
src |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
src/** | ||
!src/plugin-content-redirects.d.ts | ||
!src/types.ts | ||
!src/theme/** |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
src/** | ||
!src/plugin-content-blog.d.ts | ||
!src/types.ts | ||
!src/blogFrontMatter.ts | ||
!src/theme/** |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
src/** | ||
!src/plugin-content-docs.d.ts | ||
!src/types.ts | ||
!src/sidebars/types.ts | ||
!src/theme/** |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
src/** | ||
!src/plugin-content-pages.d.ts | ||
!src/types.ts | ||
!src/theme/** |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
src/** | ||
!src/plugin-debug.d.ts | ||
!src/theme/** |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
src/** | ||
!src/plugin-google-analytics.d.ts | ||
!src/theme/** |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
src/** | ||
!src/plugin-google-gtag.d.ts | ||
!src/theme/** |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
src/** | ||
!src/plugin-ideal-image.d.ts | ||
!src/theme/** |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
src/** | ||
!src/plugin-pwa.d.ts | ||
!src/theme/** |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
src/** | ||
!src/plugin-sitemap.d.ts | ||
!src/theme/** |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
|
||
import fs from 'fs-extra'; | ||
import path from 'path'; | ||
import {PluginOptions} from './types'; | ||
import type {Options} from '@docusaurus/plugin-sitemap'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not the same type on purpose 🤪 (also a good reason why one PR = one change is a good idea)
Users should use Internally, we should use I know that the naming convention is not very explicit, not sure how to find better names.
Does it make sense? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The changes I already made have taken that into account. These options are never normalized and are fully partial throughout. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I see Still it might be useful to keep a convention of having 2 distinct types in each plugin so that they all look the same, even if the 2 types are the same in this case. If one day we refactor and add some option with a default value to this plugin, we'll have to revert this change, while we could just update the normalized type otherwise. Type aliases are also useful to convey meaning There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well—that means the types we had previously were problematic 🙈 If you look at the deleted types file, the values are still optional. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh yes that might totally be the case 😄 PluginOptions should have non-optional types |
||
import createSitemap from './createSitemap'; | ||
import { | ||
LoadContext, | ||
|
@@ -20,7 +20,7 @@ import {PluginOptionSchema} from './pluginOptionSchema'; | |
|
||
export default function pluginSitemap( | ||
_context: LoadContext, | ||
options: PluginOptions, | ||
options: Options, | ||
): Plugin<void> { | ||
return { | ||
name: 'docusaurus-plugin-sitemap', | ||
|
@@ -47,7 +47,7 @@ export default function pluginSitemap( | |
export function validateOptions({ | ||
validate, | ||
options, | ||
}: OptionValidationContext<PluginOptions>): ValidationResult<PluginOptions> { | ||
}: OptionValidationContext<Options>): ValidationResult<Options> { | ||
const validatedOptions = validate(PluginOptionSchema, options); | ||
return validatedOptions; | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
src/** | ||
!src/preset-classic.d.ts | ||
!src/theme/** |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
src |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
src/** | ||
!src/theme-classic.d.ts | ||
!src/theme/** | ||
|
||
lib/theme | ||
lib-next/** | ||
!lib-next/theme/** | ||
|
||
babel.config.js |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
src |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
src/** | ||
!src/theme/** |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
src/** | ||
!src/theme-search-algolia.d.ts | ||
!src/theme/** |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
src | ||
update* |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
src |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
src |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
src |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
src | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
# production | ||
/build | ||
|
||
# generated files | ||
.docusaurus | ||
.cache-loader | ||
src |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
copyUntypedFiles.js | ||
.tsbuildinfo | ||
tsconfig* | ||
__tests__ | ||
|
||
src |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one of the cases we should protect ourselves against
Just adding a little import can break a release for TS users, and we wouldn't notice before publish that this happened.
Is there a way that we can protect ourselves from this kind of issue before publishing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, next step would be to refactor this and get rid of any
import('foo.ts')
in.d.ts
files and reverse that to importing from declaration files. But since we agreed that src should be published this is not much a problem