Skip to content

Commit

Permalink
Merge branch 'main' into renovate/webpack-5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jtoar authored May 15, 2022
2 parents baee952 + 9452d98 commit 1345eff
Show file tree
Hide file tree
Showing 482 changed files with 154,193 additions and 3,322 deletions.
785 changes: 0 additions & 785 deletions .yarn/releases/yarn-3.2.0.cjs

This file was deleted.

786 changes: 786 additions & 0 deletions .yarn/releases/yarn-3.2.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ plugins:

preferInteractive: true

yarnPath: .yarn/releases/yarn-3.2.0.cjs
yarnPath: .yarn/releases/yarn-3.2.1.cjs
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,17 @@ And there you have it.
<td align="center"><a href="https://github.com/zzyyxxww"><img src="https://avatars.githubusercontent.com/u/4072352?v=4" width="100px;" alt=""/><br /><sub><b>hello there</b></sub></a></td>
<td align="center"><a href="https://github.com/llmaboi"><img src="https://avatars.githubusercontent.com/u/34942041?v=4" width="100px;" alt=""/><br /><sub><b>llmaboi</b></sub></a></td>
</tr>
<tr>
<td align="center"><a href="http://www.finesoft.net/"><img src="https://avatars.githubusercontent.com/u/3767680?v=4" width="100px;" alt=""/><br /><sub><b>Changsoon Bok</b></sub></a></td>
<td align="center"><a href="https://github.com/merceyz"><img src="https://avatars.githubusercontent.com/u/3842800?v=4" width="100px;" alt=""/><br /><sub><b>Kristoffer K.</b></sub></a></td>
<td align="center"><a href="http://www.creativesoapbox.com/"><img src="https://avatars.githubusercontent.com/u/940266?v=4" width="100px;" alt=""/><br /><sub><b>Justin Kuntz</b></sub></a></td>
<td align="center"><a href="https://github.com/paineleffler"><img src="https://avatars.githubusercontent.com/u/9116535?v=4" width="100px;" alt=""/><br /><sub><b>Paine Leffler</b></sub></a></td>
<td align="center"><a href="https://github.com/pvenable"><img src="https://avatars.githubusercontent.com/u/590685?v=4" width="100px;" alt=""/><br /><sub><b>Paul Venable</b></sub></a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/PeterChen1997/MyBlog/issues"><img src="https://avatars.githubusercontent.com/u/21072589?v=4" width="100px;" alt=""/><br /><sub><b>Peter Chen</b></sub></a></td>
<td align="center"><a href="https://github.com/YannBirba"><img src="https://avatars.githubusercontent.com/u/66469030?v=4" width="100px;" alt=""/><br /><sub><b>Yann</b></sub></a></td>
</tr>
</table>

<!-- markdownlint-restore -->
Expand Down
785 changes: 0 additions & 785 deletions __fixtures__/test-project/.yarn/releases/yarn-3.2.0.cjs

This file was deleted.

786 changes: 786 additions & 0 deletions __fixtures__/test-project/.yarn/releases/yarn-3.2.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion __fixtures__/test-project/.yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ nmMode: hardlinks-local

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.2.0.cjs
yarnPath: .yarn/releases/yarn-3.2.1.cjs
4 changes: 2 additions & 2 deletions __fixtures__/test-project/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"@redwoodjs/api": "1.3.2",
"@redwoodjs/graphql-server": "1.3.2"
"@redwoodjs/api": "1.4.0",
"@redwoodjs/graphql-server": "1.4.0"
}
}
7 changes: 5 additions & 2 deletions __fixtures__/test-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
]
},
"devDependencies": {
"@redwoodjs/core": "1.3.2",
"@redwoodjs/core": "1.4.0",
"autoprefixer": "^10.4.4",
"postcss": "^8.4.12",
"postcss-loader": "^6.2.1",
Expand All @@ -28,5 +28,8 @@
"scripts": {
"postinstall": ""
},
"packageManager": "[email protected]"
"packageManager": "[email protected]",
"resolutions": {
"glob": "7.2.0"
}
}
8 changes: 4 additions & 4 deletions __fixtures__/test-project/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
]
},
"dependencies": {
"@redwoodjs/auth": "1.3.2",
"@redwoodjs/forms": "1.3.2",
"@redwoodjs/router": "1.3.2",
"@redwoodjs/web": "1.3.2",
"@redwoodjs/auth": "1.4.0",
"@redwoodjs/forms": "1.4.0",
"@redwoodjs/router": "1.4.0",
"@redwoodjs/web": "1.4.0",
"prop-types": "15.8.1",
"react": "17.0.2",
"react-dom": "17.0.2"
Expand Down
23 changes: 23 additions & 0 deletions docs/docs/cli-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,29 @@ yarn redwood build [side..]

The `..` operator indicates that the argument accepts an array of values. See [Variadic Positional Arguments](https://github.com/yargs/yargs/blob/master/docs/advanced.md#variadic-positional-arguments).

## create redwood-app

Create a Redwood project using the yarn create command:

```
yarn create redwood-app <project directory> [option]
```

| Arguments & Options | Description |
| :--------------------- | :---------------------------------------------------------------------------------------------------------------------- |
| `project directory` | Specify the project directory [Required] |
| `--yarn-install` | Enables the yarn install step and version-requirement checks. You can pass `--no-yarn-install` to disable this behavior |
| `--typescript`, `--ts` | Generate a TypeScript project. JavaScript by default |
| `--overwrite` | Create the project even if the specified project directory isn't empty |
| `--no-telemetry` | Disable sending telemetry events for this create command and all Redwood CLI commands: https://telemetry.redwoodjs.com |
| `--yarn1` | Use yarn 1 instead of yarn 3 |

If you run into trouble during the yarn install step, which may happen if you're developing on an external drive and in other miscellaneous scenarios, try the `--yarn1` flag:

```
yarn create redwood-app my-redwood-project --yarn1
```

## build

Build for production.
Expand Down
47 changes: 5 additions & 42 deletions docs/docs/tutorial/chapter3/forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,9 @@ And notice that if you fill in something in a field that's marked as an error, t

### Validating Input Format

We should make sure the email field actually contains an email:
We should make sure the email field actually contains an email, by providing a `pattern`.
This is definitely not the end-all-be-all for email address validation, but for now let us pretend it's bulletproof.
Let's also change the message on the email validation to be a little more friendly:

<Tabs groupId="js-ts">
<TabItem value="js" label="JavaScript">
Expand All @@ -1249,6 +1251,7 @@ We should make sure the email field actually contains an email:
// highlight-start
pattern: {
value: /^[^@]+@[^.]+\..+$/,
message: 'Please enter a valid email address',
},
// highlight-end
}}
Expand All @@ -1267,49 +1270,9 @@ We should make sure the email field actually contains an email:
// highlight-start
pattern: {
value: /^[^@]+@[^.]+\..+$/,
},
// highlight-end
}}
errorClassName="error"
/>
```

</TabItem>
</Tabs>

That is definitely not the end-all-be-all for email address validation, but pretend it's bulletproof. Let's also change the message on the email validation to be a little more friendly:

<Tabs groupId="js-ts">
<TabItem value="js" label="JavaScript">

```jsx title="web/src/pages/ContactPage/ContactPage.js"
<TextField
name="email"
validation={{
required: true,
pattern: {
value: /^[^@]+@[^.]+\..+$/,
// highlight-next-line
message: 'Please enter a valid email address',
},
}}
errorClassName="error"
/>
```

</TabItem>
<TabItem value="ts" label="TypeScript">

```tsx title="web/src/pages/ContactPage/ContactPage.tsx"
<TextField
name="email"
validation={{
required: true,
pattern: {
value: /^[^@]+@[^.]+\..+$/,
// highlight-next-line
message: 'Please enter a valid email address',
},
// highlight-end
}}
errorClassName="error"
/>
Expand Down
11 changes: 11 additions & 0 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ const config = {
target: '_self',
},
items: [
{
type: 'docsVersionDropdown',
position: 'left',
},
{
href: 'https://github.com/redwoodjs/redwood',
position: 'right',
Expand Down Expand Up @@ -112,6 +116,13 @@ const config = {
// ? — blob? tree?
editUrl: 'https://github.com/redwoodjs/redwood/blob/main/docs', // base path for repo edit pages
remarkPlugins: [autoImportTabs, fileExtSwitcher],
versions: {
current: {
label: 'Canary',
path: 'canary',
banner: 'unreleased',
},
},
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
Expand Down
74 changes: 42 additions & 32 deletions docs/ignore_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,51 @@ const { execSync } = require('child_process')
console.log('------------------------')
console.log("Running 'docs/ignore_build.js'")

const remoteExists = execSync('git remote -v').toString().includes('origin')

if (remoteExists) {
console.log('Remote exists')
} else {
console.log('Adding remote')
execSync('git remote add origin https://github.com/redwoodjs/redwood.git')
}

console.log('Fetching main')
execSync('git fetch origin main')

console.log('Diffing changed files against main (name only)')
const changedFiles = execSync('git diff origin/main --name-only')
.toString()
.trim()
.split('\n')
.filter(Boolean)
console.log({
changedFiles,
branch: process.env.BRANCH,
})

const shouldBuild = changedFiles.some((changedFile) =>
changedFile.startsWith('docs')
)
console.log({
shouldBuild,
})

// We've done all the logic based on whether we should build the site,
// but since this is an ignore script, we have to flip the logic here.
if (shouldBuild) {
console.log(`PR '${process.env.HEAD}' has doc changes. Proceeding`)
if (process.env.BRANCH === 'main') {
console.log(`Branch is main. Proceeding`)
process.exitCode = 1
console.log('------------------------')
} else {
console.log(`PR '${process.env.HEAD}' doesn't have doc changes. Ignoring`)
const remoteExists = execSync('git remote -v').toString().includes('origin')

if (remoteExists) {
console.log('Remote exists')
} else {
console.log('Adding remote')
execSync('git remote add origin https://github.com/redwoodjs/redwood.git')
}

console.log('Fetching main')
execSync('git fetch origin main')

console.log('Diffing changed files against main (name only)')
const changedFiles = execSync('git diff origin/main --name-only')
.toString()
.trim()
.split('\n')
.filter(Boolean)
console.log({
changedFiles,
})

const shouldBuild = changedFiles.some((changedFile) =>
changedFile.startsWith('docs')
)
console.log({
shouldBuild,
})

// We've done all the logic based on whether we should build the site,
// but since this is an ignore script, we have to flip the logic here.
if (shouldBuild) {
console.log(`PR '${process.env.HEAD}' has doc changes. Proceeding`)
process.exitCode = 1
} else {
console.log(`PR '${process.env.HEAD}' doesn't have doc changes. Ignoring`)
}
console.log('------------------------')
}
console.log('------------------------')
Loading

0 comments on commit 1345eff

Please sign in to comment.