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

Setup docs app #44

Merged
merged 7 commits into from
Feb 20, 2023
Merged

Setup docs app #44

merged 7 commits into from
Feb 20, 2023

Conversation

simonihmig
Copy link
Contributor

This is only the boilerplate of the docs app, copied from ember-toucan-core, and enabling CI/CD. Writing the actual documentation will follow in separate PR(s).

@changeset-bot
Copy link

changeset-bot bot commented Feb 13, 2023

⚠️ No Changeset found

Latest commit: c324e7a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@simonihmig simonihmig force-pushed the docs-setup branch 2 times, most recently from 56b0ba6 to f935bdd Compare February 13, 2023 17:08
@simonihmig simonihmig marked this pull request as draft February 13, 2023 17:08
@simonihmig
Copy link
Contributor Author

@NullVoxPopuli this message seems to suggest we need to create a new project for this? Do you have the permissions, I don't have any cloudflare access on behalf of CS, right?

@NullVoxPopuli
Copy link
Contributor

@NullVoxPopuli this message seems to suggest we need to create a new project for this?

I just made it 🎉

I don't have any cloudflare access on behalf of CS, right?

Right, we can get you added if you want (UX has its own cloudflare account). But for this kind of setup you also would need to be a GitHub org admin. :(

@github-actions
Copy link
Contributor

github-actions bot commented Feb 14, 2023

Preview URLs

Env: preview
Docs: https://6286b89f.ember-headless-form.pages.dev

persist-credentials: false
- uses: ./.github/actions/pnpm
- run: pnpm build
# - uses: ./.github/actions/download-built-package
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be removed since we have the build run above+below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The other jobs also still have this. We should clean up all of this of course, when we have the final solution, which I hope #52 will bring!

persist-credentials: false
- uses: ./.github/actions/pnpm
- run: pnpm build
# - uses: ./.github/actions/download-built-package
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question here as above

## Preview URLs
Env: ${{ needs.PublishDocstoCloudflarePages.outputs.env }}
Docs: ${{ needs.PublishDocstoCloudflarePages.outputs.url }}
# # api docs: ${{ needs.PublishDocstoCloudflarePages.outputs.url }}/api/modules.html
Copy link
Contributor

Choose a reason for hiding this comment

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

I should maybe do this as well in toucan-core, as we don't have api docs yet!

</div>
</template>;

export default FeatureCard;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can/should move these over to oss-docs eventually? (Not part of this PR, obvs, low priority!)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I think this was even mentioned somewhere, in a comment or so. Just vaguely remember...

docs-app/app/index.html Outdated Show resolved Hide resolved
docs-app/ember-cli-build.js Outdated Show resolved Hide resolved
"highlight.js": "^11.6.0",
"highlightjs-glimmer": "^1.4.1",
"tracked-built-ins": "^3.1.0"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need the dependenciesMeta here as well? E.g.,:

"dependenciesMeta": {
    "ember-headless-form": {
      "injected": true
    }
  }

(https://github.com/CrowdStrike/ember-toucan-core/blob/main/docs-app/package.json#L134)

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like it was working without it based on what I read from a previous PR (let me dig it up)...but then how come we need it in other packages?? (don't feel the need to answer this if it's going to take a lot of investigation btw, just curious)

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It wasn't needed as I wasn't really using the addon in the docs app yet. But yes, your are right, we should do that here also - and I just did that, to prevent any more foot guns due to this unfortunate issue.

// Additional setup for unit tests can be done here.
}

export { setupApplicationTest, setupRenderingTest, setupTest };
Copy link
Contributor

Choose a reason for hiding this comment

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

Totally non-blocking quesiton: We have all of the same in toucan-core under docs-app/tests, but I'm curious if it makes sense for our docs-apps to even have the tests/ directory? We normally use the test-app for testing, so just curious on thoughts around this.

Copy link
Contributor

Choose a reason for hiding this comment

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

over time docs may have demos complex enough where you want them tested

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, that makes sense 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, and I would also like to add even just a very simple smoke test for the docs app, mainly checking that the build does not blow up, and at least something is rendered. This has proven to be useful in other projects like ember-bootstrap, to make sure that e.g. automated renovate updates don't accidentally the docs app!

'use strict';

module.exports = {
plugins: ['prettier-plugin-ember-template-tag'],
Copy link
Contributor

Choose a reason for hiding this comment

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

!! Should we be using this in our other packages? Does it format everything in between <template> tags (is this what it does?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have this already in the test-app for example. It makes prettier even understand the existence of <template>, otherwise it wouldn't be able to parse the file (as it's not valid JS/TS). And yes, it does also format everything inside of the template!


## Running / Development

- `ember serve`
Copy link
Contributor

Choose a reason for hiding this comment

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

Question...are we really running ember serve or is it pnpm start? Or should updating this README be in a followup?

Copy link
Contributor

Choose a reason for hiding this comment

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

they are equiv 🎉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was copy-paste, and yes, currently there is no difference. However, should we start to add turbo also to scripts in the workspace, including start, then it would start to matter!

simonihmig and others added 2 commits February 17, 2023 10:08
Co-authored-by: Tony Ward <8069555+ynotdraw@users.noreply.github.com>
@simonihmig simonihmig force-pushed the docs-setup branch 2 times, most recently from 7c1bb48 to 03b88ac Compare February 17, 2023 10:18
@simonihmig
Copy link
Contributor Author

@NullVoxPopuli I took the freedom to refactor the docs CD workflow a bit, in this commit. Previously we had a separate PostPreviewURLascommenttoPR job, which seemed too much to me tbh. It did a pnpm i and pnpm build, which seems unnecessary for the sticky-pull-request-comment action. And if you remove those, what is left then is a single step that takes 1s, which IMO doesn't justify a separate job. So I merged the two together.

Btw, that sticky-pull-request-comment action wouldn't really be needed, if coudflare would merge and release this bugfix, as the cloudflare action will create a deployment Github event that makes GH render it as a deployment in its native UI (which due to the bug doesn't work correctly for PRs rn). We could still leave the automated comment in here if we think that's useful though.

@simonihmig simonihmig merged commit ebdd267 into main Feb 20, 2023
@simonihmig simonihmig deleted the docs-setup branch February 20, 2023 09:17
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.

None yet

4 participants