-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
feat(ci): continuous releases for main and PRs with pkg.pr.new #10369
Conversation
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site configuration. |
⚡️ Lighthouse report for the deploy preview of this PR
|
@Josh-Cena it's me that asked @Aslemammad for his help on setting this up 😄 |
commit: create-docusaurus
@docusaurus/core
@docusaurus/cssnano-preset
@docusaurus/logger
@docusaurus/mdx-loader
@docusaurus/module-type-aliases
@docusaurus/plugin-client-redirects
@docusaurus/plugin-content-blog
@docusaurus/plugin-content-docs
@docusaurus/plugin-content-pages
@docusaurus/plugin-debug
@docusaurus/plugin-google-analytics
@docusaurus/plugin-google-gtag
@docusaurus/plugin-google-tag-manager
@docusaurus/plugin-ideal-image
@docusaurus/plugin-pwa
@docusaurus/plugin-sitemap
@docusaurus/plugin-vercel-analytics
@docusaurus/preset-classic
@docusaurus/remark-plugin-npm2yarn
@docusaurus/theme-classic
@docusaurus/theme-common
@docusaurus/theme-live-codeblock
@docusaurus/theme-mermaid
@docusaurus/theme-search-algolia
@docusaurus/theme-translations
@docusaurus/tsconfig
@docusaurus/types
@docusaurus/utils
@docusaurus/utils-common
@docusaurus/utils-validation
@docusaurus/eslint-plugin
@docusaurus/lqip-loader
stylelint-copyright
Open in Stackblitz • docusaurus • docusaurus-classic-typescript |
Ah I see. I didn't see any motivation or context in this PR. |
Sorry for the confusion, Thank you so much y'all for the opportunity. |
@Aslemammad how can I test this? For example, how can I open the template of this PR in StackBlitz? Note our examples are not necessarily using the latest version of Docusaurus, and we update them manually (or not) after a Docusaurus publish. They do not necessarily reflect the PR's current changes in practice. To be sure that it works as expected, could you please do a little change to What should rather get published is the result of this command:
|
That's for sure, I'll sort it out for you! |
I just did a slight change in create-docusaurus to log something. Once approved, I guess we can see the reflected change by running the binary. |
@Aslemammad I don't think it's going to work that way What we want in the end is to get our 2 init templates able to run on StackBlitz using the PR code (by the way, is there a way to make this github comment less verbose? it's not super useful to show 20+ lines on how to add every single monorepo package) But:
I'm not sure how this work, but what I'd try is something like this instead: steps:
# ... previous steps
- name: Build packages
run: yarn build:packages
- name: Init template project
run: |
yarn create-docusaurus fresh-examples/docusaurus-classic classic
yarn create-docusaurus fresh-examples/docusaurus-classic-typescript classic --typescript
- name: Release
run: npx pkg-pr-new publish './packages/*' --template './fresh-examples/*' --compact What we want is that the code of the PR that modifies the init template logic (nodejs init code) or init site content (default config file, mdx files, React files, CSS...) have an impact of the StackBlitz template being proposed to try in the current PR. To do so, you have to publish templates that your CI workflow initializes one step before. |
By the way, even with the current code (stale templates), the StackBlitz template using the new dependencies don't work due to a I think I clicked on something by mistake locally, and it also opened this file showing something that looks like a S3 or Cloudflare error: https://dizwbyrun-y1dl.w-credentialless-staticblitz.com/blitz.41692973.js:40:195142 This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>33G2G06KT4P1VT66</RequestId>
<HostId>Moly+n22hzCHulGU5lLfcjHpWq8J3FYMnvWe1NkXUy+jkfz1U14PL3pCz+TZ2DAS0RNDwknXtD4w9vbfESETsQ==</HostId>
</Error> Using Note there are image-related warnings, they come from using this lib: https://github.com/image-size/image-size (apparently it's supposed to be related to Yarn though, related comment: yarnpkg/berry#3889 (comment))
Otherwise, it works fine: the PR new features can be tried on the StackBlitz playground (minus modifications made to |
Ok, sorry for the confusion, I'll try again and keep you updated! |
.github/workflows/cr.yml
Outdated
|
||
- name: Fresh templates | ||
run: | | ||
yarn create-docusaurus fresh-examples/docusaurus-classic classic --javascript -p npm -s |
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.
We do not need installs, since templates would just be uploaded!
I also use npm here so we avoid that error, at least until I fix the issue with yarn in pkg.pr.new!
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.
Hmmm, wondering if generating a package-lock.json wouldn't be useful?
It looks like a tradeoff: resolve package versions ahead of time in CI vs letting the stackblitz user handle it. Maybe the DX will be better/faster for the end user if versions are already pre-resolved?
.github/workflows/cr.yml
Outdated
yarn create-docusaurus fresh-examples/docusaurus-classic-typescript classic --typescript -p npm -s | ||
|
||
- name: Release | ||
run: npx pkg-pr-new publish './packages/*' --template './fresh-examples/*' --compact --comment=off |
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.
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.
Thanks
I think the comment is helpful for discovery, but it has to be more concise to be effective and only post the 2 template links. Until you have a better comment, it's preferable to hide it.
I made some changes, but I'm confused a bit on the templates, don't create-docusaurus bring the examples from git? So even if I change the classic example (as I did now) and do fresh-examples, create-docusaurus won't reflect the changes since things come from git (unless this is merged). |
.github/workflows/cr.yml
Outdated
|
||
- name: Fresh templates | ||
run: | | ||
yarn create-docusaurus fresh-examples/docusaurus-classic classic --javascript -p npm -s |
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.
Hmmm, wondering if generating a package-lock.json wouldn't be useful?
It looks like a tradeoff: resolve package versions ahead of time in CI vs letting the stackblitz user handle it. Maybe the DX will be better/faster for the end user if versions are already pre-resolved?
.github/workflows/cr.yml
Outdated
yarn create-docusaurus fresh-examples/docusaurus-classic-typescript classic --typescript -p npm -s | ||
|
||
- name: Release | ||
run: npx pkg-pr-new publish './packages/*' --template './fresh-examples/*' --compact --comment=off |
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.
Thanks
I think the comment is helpful for discovery, but it has to be more concise to be effective and only post the 2 template links. Until you have a better comment, it's preferable to hide it.
No the templates do not come from Git, they come from npm and are packaged inside The Most of the init template content is here: https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared |
Pre-flight checklist
Motivation
Test Plan
Test links
Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/
Related issues/PRs