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

[fix] copy essentials files from root on packaging #1747

Merged
merged 11 commits into from
Jul 9, 2021
Merged

[fix] copy essentials files from root on packaging #1747

merged 11 commits into from
Jul 9, 2021

Conversation

ignatiusmb
Copy link
Member

Alternative PR, only to #1735 point number one. This will copy all (and only) files in the root folder to package directory output, rather than having an explicit whitelist of files to copy like README.md, LICENSE, and so on.

This should also cover copying the .npmignore so it should be the same and predictable for authors to blacklist files there. To keep it consistent with the ecosystem, files key is added to the package.json output as well for those who prefer to whitelist instead.

Fixes #1734

@changeset-bot
Copy link

changeset-bot bot commented Jun 23, 2021

🦋 Changeset detected

Latest commit: 0cfaf18

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ignatiusmb ignatiusmb changed the title copy all root files on svelte-kit package copy essentials files from root on packaging Jun 24, 2021
@ignatiusmb
Copy link
Member Author

On second thought, I think it's better to include just the "essentials" from the root folder to the final package output. One could argue that authors could just place these files in src/lib directly, but it would be weird — let's say someone's looking at the source code to read about the CHANGELOG which is usually placed at the root, but now needs to go to src/lib first to do so — using symlinks could be an option, but it's unconventional, to say the least.

Now, what counts as "essentials" could be subjective to each authors accordingly. In the meantime, I've added what npm counts as their "essentials" in which these files would always be included, regardless of the files or ignore values. I've also placed them in a separate file for easier editing in the future. Another option is to provide a key in the config file, this could be done later on, not sure where to put it but perhaps something around

  • kit.package.files.essentials
  • kit.package.files.root
  • kit.package.essentials
  • kit.package.root

@benmccann benmccann changed the title copy essentials files from root on packaging [fix] copy essentials files from root on packaging Jul 3, 2021
Copy link
Member

@benmccann benmccann left a comment

Choose a reason for hiding this comment

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

this seems better than what we currently have though I agree that there might be additional files that the author could want to include. another thought - I wonder if we could get those from the package.json files field

@benmccann benmccann merged commit af1aa54 into sveltejs:master Jul 9, 2021
@ignatiusmb ignatiusmb deleted the i1734/alternative-preservation branch July 9, 2021 23:21
sidharthv96 added a commit to sidharthv96/kit that referenced this pull request Jul 11, 2021
* 'master' of github.com:sidharthv96/kit: (1114 commits)
  Version Packages (next) (sveltejs#1858)
  Bump vite-plugin-svelte to 1.0.0-next.12 (sveltejs#1869)
  [fix] preserve user defined config and files on `svelte-kit package` (sveltejs#1735)
  [fix] handle undefined body on endpoint output (sveltejs#1808)
  [fix] copy essentials files from root on packaging (sveltejs#1747)
  [docs] sort config alphabetically (sveltejs#1867)
  add config.kit.package.emitTypes option (sveltejs#1852)
  [fix] add $lib alias to js/tsconfig (sveltejs#1860)
  Pass along custom properties added to Error (sveltejs#1821)
  Version Packages (next) (sveltejs#1840)
  Improve grammar in packages FAQ
  Docs for writing an adapter (sveltejs#1846)
  Additional documentation around pnpx changeset usage
  [feat] expose Vite.js `mode` from `$app/env` (sveltejs#1789)
  Service worker files exclusion support (sveltejs#1645)
  chore: Enable `vite.server.fs.strict` internally by default (sveltejs#1842)
  Test with the latest version of Svelte (sveltejs#1848)
  [docs] don't need to run pnpm install twice
  Improve HN example docs
  [fix] correct `ReadOnlyFormData` generator implementation (sveltejs#1837)
  ...
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

Successfully merging this pull request may close these issues.

svelte-kit package retain original casing in file names
3 participants