Skip to content

docs: Example projects - #70

Merged
JoseLion merged 13 commits into
stackbuilders:mainfrom
neolight1010:docs/example-projects
Sep 19, 2022
Merged

JoseLion merged 13 commits into
stackbuilders:mainfrom
neolight1010:docs/example-projects

Conversation

@neolight1010

Copy link
Copy Markdown
Contributor

This PR adds minimal example projects for Jest and Mocha, solving issue #63 .

Some details:

  • The examples resolve the assertive-ts depdendency by using Yarn workspaces. I based this on how examples are set up in Jest's source code. This required adding a workspaces field to the top level package.json file. Please tell me if I should use another approach.
  • I followed the instructions from the documentation as they are. That's why there are two tsconfig.json files with a lot of commented-out fields (generated by npx tsc -init).

@JoseLion

Copy link
Copy Markdown
Contributor

@neolight1010, thanks a lot for your contribution. We recently changed the CI configuration to allow the build workflow to trigger on forked PRs too. Can you please update your branch with the latest changes from main? Thanks 🙂

@neolight1010

Copy link
Copy Markdown
Contributor Author

Thank you! I updated my branch, but it seems the workflow still needs approval to be run

@neolight1010

Copy link
Copy Markdown
Contributor Author

The workflow is failing because yarn install would modify the lockfile, due to the dependencies of the example projects. To solve the issue, I can commit the modified lockfile or I can stop using Yarn workspaces altogether. Please tell me your opinion so I can solve the issue @JoseLion 😄

@JoseLion

Copy link
Copy Markdown
Contributor

@neolight1010 yes, I think using Yarn workspaces is a good approach for this. You can commit the modified lock file to solve the workflow issue. A couple of extra things:

  • Can you please change the workspace code to use 2-space indentation to keep consistency with the project?
  • We'll also need to exclude the workspace node_modules from the linter execution or we'll get a lot of lint errors on CI. You can do this by adding a pattern to the linterOptions.exclude property on the tslint.json file. Maybe something like the following:
"linterOptions": {
  "exclude": [
    "node_modules/**/*",
    "examples/*/node_modules/**/*"
  ]
}

And thanks again for your contribution! 🙂 🎉

@neolight1010

Copy link
Copy Markdown
Contributor Author

Sorry, I didn't notice the linting rules of the project. I added the exception to the linter's rules, formatted the examples' code and fixed the linter's warnings. I also added a peer dependency missing in the Mocha example that was causing a warning when running yarn install.

@JoseLion JoseLion left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great! I think this is perfect for getting started with the examples. Thanks again for your contribution! 🚀 🎉

@JoseLion
JoseLion merged commit 8d858b9 into stackbuilders:main Sep 19, 2022
@JoseLion JoseLion linked an issue Sep 19, 2022 that may be closed by this pull request
@neolight1010
neolight1010 deleted the docs/example-projects branch September 19, 2022 17:13
@neolight1010

Copy link
Copy Markdown
Contributor Author

You're welcome! And thank you for this amazing library! 🎉

@JoseLion

Copy link
Copy Markdown
Contributor

@all-contributors please add @neolight1010 for doc

@allcontributors

Copy link
Copy Markdown
Contributor

@JoseLion

I've put up a pull request to add @neolight1010! 🎉

@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suggestion: Add examples directory with dummy projects

2 participants