Skip to content

Commit

Permalink
chore(formatting): Format readme files (redwoodjs#11248)
Browse files Browse the repository at this point in the history
As title. No significant content changes as far as I have seen from
looking through the changes, only the formatting of the documents
themselves.

I know some people don't like to format markdown documents because of
how the tables end up looking but I would rather enforce the
consistency.
  • Loading branch information
Josh-Walker-GM authored Aug 14, 2024
1 parent c21c707 commit ac2dfe9
Show file tree
Hide file tree
Showing 71 changed files with 872 additions and 572 deletions.
9 changes: 7 additions & 2 deletions .vscode/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
## VS Code Settings

This directory includes global workspace settings for local development of the RedwoodJS Framework.

See:

- [VS Code Doc: User and Workspace Settings](https://code.visualstudio.com/docs/getstarted/settings)
- [What is a VS Code Workspace?](https://stackoverflow.com/questions/44629890/what-is-a-workspace-in-visual-studio-code)

### Overriding Global Settings

It is possible to create your own "local" settings, overriding the global, via a `.code-workspace` file. See:

- [Workspace Settings](https://code.visualstudio.com/docs/editor/multi-root-workspaces#_settings)
- [Local settings overrides](https://github.com/microsoft/vscode/issues/37519)

> `*.code-workspace` files are included in `.gitignore`
For example, if you want a bright pink status background (and who doesn't?), create this file in the root of your project `mySettings.code-workspace`:

```
// mySettings.code-workspace
Expand All @@ -22,6 +27,6 @@ For example, if you want a bright pink status background (and who doesn't?), cre
```

> **WARNING:** If you create a custom file that is ignored by git, then _anytime_ you run `git clean -fxd` the file will be permanently deleted.
>
> **WARNING:** If you create a custom file that is ignored by git, then _anytime_ you run `git clean -fxd` the file will be permanently deleted.
>
> You can avoid this by using the option `-e`, e.g. `git clean -fxd -e mySettings.code-workspace`.
43 changes: 27 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Love Redwood and want to get involved? You're in the right place!
> 3. 🪜 [Step-by-step Walkthrough](https://redwoodjs.com/docs/contributing-walkthrough) (including Video Recording)
> 4. 📈 [Current Project Boards](https://github.com/orgs/redwoodjs/projects)
> 5. 🤔 What should I work on?
> - ["Help Wanted" v1 Triage Board](https://redwoodjs.com/good-first-issue)
> - [Discovery Process and Open Issues](https://redwoodjs.com/docs/contributing#what-should-i-work-on)
> - ["Help Wanted" v1 Triage Board](https://redwoodjs.com/good-first-issue)
> - [Discovery Process and Open Issues](https://redwoodjs.com/docs/contributing#what-should-i-work-on)
_Before interacting with the Redwood community, please read and understand our [Code of Conduct](https://github.com/redwoodjs/redwood/blob/main/CODE_OF_CONDUCT.md)._

Expand Down Expand Up @@ -90,17 +90,18 @@ But how do you actually test your changes in the Redwood Framework in your Redwo

> Besides `<project directory>`, `build:test-project` takes a few other options as well:
>
> | Arguments & Options | Description |
> |-----------------------|---------------------------------------------------------------------------------------|
> | `<project directory>` | Directory to build test project [default: "./blog-test-project"] |
> | `--javascript` | Generate a JavaScript project [default: false] |
> | `--link` | Copy Framework dependencies and packages into Test-project [default: false] |
> | `--verbose` | Verbose output [default: false] |
> | `--clean` | Delete existing directory and recreate Test-project [default: false] |
> | `--canary` | Upgrade project to latest canary version; NOT compatible with --link [default: true] |
> | `--help ` | Show help |
> | Arguments & Options | Description |
> | --------------------- | ------------------------------------------------------------------------------------ |
> | `<project directory>` | Directory to build test project [default: "./blog-test-project"] |
> | `--javascript` | Generate a JavaScript project [default: false] |
> | `--link` | Copy Framework dependencies and packages into Test-project [default: false] |
> | `--verbose` | Verbose output [default: false] |
> | `--clean` | Delete existing directory and recreate Test-project [default: false] |
> | `--canary` | Upgrade project to latest canary version; NOT compatible with --link [default: true] |
> | `--help ` | Show help |
>
> **Example:**
>
> ```terminal
> cd redwood/
> yarn run build:test-project ~/my-repos/redwood-project --javascript --link
Expand Down Expand Up @@ -172,6 +173,7 @@ yarn dev <cli command> --cwd <project directory>
`yarn dev` runs the CLI and `--cwd` makes the command run in your Redwood Project. If you make a change to the code, remember to rebuild the packages!

> Tips:
>
> - You can use `yarn build:watch` to automatically build the framework whilst you're making changes.
> - `--cwd` is optional, it will reference the `__fixtures__/example-todo-main` project in the framework.
Expand Down Expand Up @@ -238,6 +240,7 @@ Most of the time your contribution to Redwood won't involve adding any new depen

**`yarn add --interactive`**
Reuse the specified package from other workspaces in the project. Example:

```
yarn workspace create-redwood-app add -i rimraf
```
Expand All @@ -255,22 +258,27 @@ redwood/packages/codemods$ yarn add yargs

**`yarn workspaces foreach ...`**
This is a command from the workspaces plugin. Runs the command across all workspaces. Example:

```
yarn workspaces foreach -i -v some-package
```

-v: outputs the package name the command is currently running against

### Added to CI: dedupe and constraints

**`yarn dedupe --check`**

> Duplicates are defined as descriptors with overlapping ranges being resolved and
locked to different locators. They are a natural consequence of Yarn's
deterministic installs, but they can sometimes pile up and unnecessarily
increase the size of your project.
> locked to different locators. They are a natural consequence of Yarn's
> deterministic installs, but they can sometimes pile up and unnecessarily
> increase the size of your project.
> This command dedupes dependencies in the current project using different
strategies (only one is implemented at the moment).
> strategies (only one is implemented at the moment).
**`yarn constraints`**
See new file `constraints.pro` for repo config

- [Yarn Constraints](https://yarnpkg.com/features/constraints)
- Reference from Babel project: https://github.com/babel/babel/blob/main/constraints.pro

Expand All @@ -282,13 +290,15 @@ For example, yarn `v3` isn't installed globally, but on a per-project basis.
Here's a quick overview of some of the new yarn-related files in this repo:

| File | Description |
|:-----------------|:---------------------------------------------------------------------|
| :--------------- | :------------------------------------------------------------------- |
| `.yarnrc.yml` | Yarn's configuration file |
| `.yarn/plugins` | Where installed [plugins](https://yarnpkg.com/features/plugins) live |
| `.yarn/releases` | The `yarn v3` binaries themselves |

#### Advanced Cases

If needed, there's more information in [this PR #3154 comment](https://github.com/redwoodjs/redwood/pull/3154#issue-957115489) about special cases:

- "Binary hoisting" is no longer allowed
- Specifying Yarn v1 binary (when necessary)
- `yarn dlx`
Expand All @@ -315,6 +325,7 @@ Once you make your changes in your fork, include the link to your repo in your i
## Canary publishing

Every time a commit is added to the `main` branch, a `canary` release is automatically published to npm. The most recent `canary` packages can be used in Redwood Project via the following command:

```
yarn rw upgrade --tag canary
```
Expand Down
5 changes: 5 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
# Contributors Welcome!

## All Redwood Contributors 🎉

Redwood has a vibrant community we want to highlight as much as possible.

To view the current list of amazing contributors across Redwood projects, see the [Contributors section of README.md](https://github.com/redwoodjs/redwood/blob/main/README.md#contributors).

### Want to become a Contributor?

First, read the [Contributing Doc](https://redwoodjs.com/docs/contributing). And then let us know how we can help you get started by reaching out via the [Forums](https://community.redwoodjs.com) or [Discord chat](https://discord.gg/redwoodjs).

## Managing Redwood All-Contributors

Redwood projects (mostly) follow the [all-contributions](https://allcontributors.org/) specification using the `all-contributors` CLI tool. This allows us to:

- track the [Framework](https://github.com/redwoodjs/redwood), [create-redwood-app](https://github.com/redwoodjs/create-redwood-app), and [Redwoodjs.com](https://github.com/redwoodjs/redwoodjs.com) project contributors
- display the aggregated list of contributors

Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,11 @@ for my nascent web app framework. Namely:
And there you have it.

## Contributors
*A gigantic "Thank YOU!" to everyone below who has contributed to one or more Redwood projects: [Framework](https://github.com/redwoodjs/redwood), [Website](https://github.com/redwoodjs/sprout), [Docs](https://github.com/redwoodjs/redwood/tree/main/docs), and [Create-Redwood Template](https://github.com/redwoodjs/redwood/tree/main/packages/create-redwood-app/template). 🚀*

_A gigantic "Thank YOU!" to everyone below who has contributed to one or more Redwood projects: [Framework](https://github.com/redwoodjs/redwood), [Website](https://github.com/redwoodjs/sprout), [Docs](https://github.com/redwoodjs/redwood/tree/main/docs), and [Create-Redwood Template](https://github.com/redwoodjs/redwood/tree/main/packages/create-redwood-app/template). 🚀_

### Core Team: Leadership

<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
Expand Down Expand Up @@ -866,4 +868,4 @@ And there you have it.

<!-- ALL-CONTRIBUTORS-LIST:END -->

Redwood projects *(mostly)* follow the [all-contributions](https://allcontributors.org/) specification. Contributions of any kind are welcome.
Redwood projects _(mostly)_ follow the [all-contributions](https://allcontributors.org/) specification. Contributions of any kind are welcome.
3 changes: 3 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Security Policy

The Redwood repo is scanned frequently for code and dependency vulnerabilities. Notifications are received by the Redwood Core Team members, who assess risk, prioritize, and determine a remediation plan. Typically this process involves a package update or patch release and is resolved within 24 hours of notification.

## Supported Versions
Expand All @@ -12,12 +13,14 @@ The Redwood repo is scanned frequently for code and dependency vulnerabilities.
If you discover a potential security issue, do let us know as soon as possible. We'll work toward a resolution as quickly as possible, so please provide us with a reasonable amount of time before disclosure to the public or a third-party.

There are two ways to contact us:

1. Email [[email protected]](mailto:[email protected]), or
2. Use GitHub's private [Vulnerability Reporting feature](https://github.com/redwoodjs/redwood/security/advisories) (to learn how this works, [click here](https://docs.github.com/en/code-security/security-advisories/repository-security-advisories/configuring-private-vulnerability-reporting-for-a-repository))

Thank you for helping improve Redwood security!

## Security is Everyone's Responsibility

We take security seriously. Which is why we offer a friendly reminder that "Redwood Framework Security" **!=** "Security of Applications built with Redwood"

It's our responsibility (Core Team members) to implement security best practices and make the framework as secure as possible. We will do as much as we can; however, we can only do so much. Ultimately, security rests in the hands of the application developers who use Redwood. If you haven't already, we recommend starting the security process for your application with [GitHub's Security Tools and Best Practices](https://docs.github.com/en/github/managing-security-vulnerabilities/managing-security-vulnerabilities-in-your-project).
26 changes: 13 additions & 13 deletions __fixtures__/test-project/.redwood/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ You don't need to commit any other contents of this directory to your version co

### Files

| Name | Description |
| :---------------- | :------- |
| commandCache.json | This file contains mappings to assist the Redwood CLI in efficiently executing commands. |
| schema.graphql | This is the GraphQL schema which has been automatically generated from your Redwood project. |
| Name | Description |
| :---------------- | :----------------------------------------------------------------------------------------------------------------- |
| commandCache.json | This file contains mappings to assist the Redwood CLI in efficiently executing commands. |
| schema.graphql | This is the GraphQL schema which has been automatically generated from your Redwood project. |
| telemetry.txt | Contains a unique ID used for telemetry. This value is rotated every 24 hours to protect your project's anonymity. |
| test.db | The sqlite database used when running tests. |
| test.db | The sqlite database used when running tests. |

### Directories

| Name | Description |
| :---------- | :------- |
| locks | Stores temporary files that Redwood uses to keep track of the execution of async/background tasks between processes. |
| logs | Stores log files for background tasks such as update checking. |
| prebuild | Stores transpiled JavaScript that is generated as part of Redwood's build process. |
| Name | Description |
| :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------- |
| locks | Stores temporary files that Redwood uses to keep track of the execution of async/background tasks between processes. |
| logs | Stores log files for background tasks such as update checking. |
| prebuild | Stores transpiled JavaScript that is generated as part of Redwood's build process. |
| telemetry | Stores the recent telemetry that the Redwood CLI has generated. You may inspect these files to see everything Redwood is anonymously collecting. |
| types | Stores the results of type generation. |
| updateCheck | Stores a file which contains the results of checking for Redwood updates. |
| studio | Used to store data for `rw studio` |
| types | Stores the results of type generation. |
| updateCheck | Stores a file which contains the results of checking for Redwood updates. |
| studio | Used to store data for `rw studio` |

We try to keep this README up to date but you may, from time to time, find other files or directories in this `.redwood` directory that have not yet been documented here. This is likely nothing to worry about but feel free to let us know and we'll update this list.

Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/test-project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ It'd be hard to scale from side project to startup without a few tests. Redwood
yarn rw test
```

To make the integration even more seamless, Redwood augments Jest with database [scenarios](https://redwoodjs.com/docs/testing#scenarios) and [GraphQL mocking](https://redwoodjs.com/docs/testing#mocking-graphql-calls).
To make the integration even more seamless, Redwood augments Jest with database [scenarios](https://redwoodjs.com/docs/testing#scenarios) and [GraphQL mocking](https://redwoodjs.com/docs/testing#mocking-graphql-calls).

## Ship it

Expand Down
12 changes: 10 additions & 2 deletions __fixtures__/test-project/web/public/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
# Static Assets

Use this folder to add static files directly to your app. All included files and folders will be copied directly into the `/dist` folder (created when Vite builds for production). They will also be available during development when you run `yarn rw dev`.
>Note: files will *not* hot reload while the development server is running. You'll need to manually stop/start to access file changes.

> Note: files will _not_ hot reload while the development server is running. You'll need to manually stop/start to access file changes.
### Example Use

A file like `favicon.png` will be copied to `/dist/favicon.png`. A folder containing a file such as `static-files/my-logo.jpg` will be copied to `/dist/static-files/my-logo.jpg`. These can be referenced in your code directly without any special handling, e.g.

```
<link rel="icon" type="image/png" href="/favicon.png" />
```

and

```
<img src="/static-files/my-logo.jpg"> alt="Logo" />
```


## Best Practices

Because assets in this folder are bypassing the javascript module system, **this folder should be used sparingly** for assets such as favicons, robots.txt, manifests, libraries incompatible with Vite, etc.

In general, it's best to import files directly into a template, page, or component. This allows Vite to include that file in the bundle when small enough, or to copy it over to the `dist` folder with a hash.

### Example Asset Import with Vite

Instead of handling our logo image as a static file per the example above, we can do the following:

```
import React from "react"
import logo from "./my-logo.jpg"
Expand Down
Loading

0 comments on commit ac2dfe9

Please sign in to comment.