Skip to content

Commit

Permalink
Merge branch 'main' into pr/3515
Browse files Browse the repository at this point in the history
  • Loading branch information
thedavidprice committed Dec 2, 2021
2 parents d8d132d + 4567f76 commit 28ab311
Show file tree
Hide file tree
Showing 208 changed files with 12,485 additions and 4,838 deletions.
18 changes: 18 additions & 0 deletions .eslintrc.js
@@ -1,7 +1,24 @@
const path = require('path')

const findUp = require('findup-sync')

// Framework Babel config is monorepo root ./babel.config.js
// `yarn lint` runs for each workspace, which needs findup for path to root
const findBabelConfig = (cwd = process.cwd()) => {
const configPath = findUp('babel.config.js', { cwd })
if (!configPath) {
throw new Error(`Eslint-parser could not find a "babel.config.js" file`)
}
return configPath
}

module.exports = {
extends: path.join(__dirname, 'packages/eslint-config/shared.js'),
parserOptions: {
babelOptions: {
configFile: findBabelConfig(),
},
},
ignorePatterns: [
'dist',
'fixtures',
Expand Down Expand Up @@ -117,6 +134,7 @@ module.exports = {
'packages/testing/src/**',
'packages/testing/config/**',
'packages/eslint-config/*.js',
'packages/record/src/**',
],
env: {
es6: true,
Expand Down
9 changes: 0 additions & 9 deletions .github/dependabot.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/renovate.json
@@ -0,0 +1,32 @@
{
"extends": [
"config:base"
],
"ignoreDeps": [
"boxen",
"configstore",
"decamelize",
"execa",
"humanize-string",
"latest-version",
"ora",
"tempy",
"terminal-link",
"@types/node-fetch"
],
"lockFileMaintenance": {
"enabled": true
},
"packageRules": [
{
"matchUpdateTypes": [
"minor",
"patch"
],
"automerge": true
}
],
"reviewers": [
"@jtoar"
]
}
19 changes: 18 additions & 1 deletion README.md
Expand Up @@ -59,7 +59,7 @@ use:
## Features

- Opinionated defaults for formatting, file organization, Webpack, Babel, and more
- Simple but powerful routing (all routes defined in one file) with dynamic (typed) parameters, constraints, and named route functions (to generate correct URLs)
- Simple but powerful routing (all routes defined in one file) with dynamic (typed) parameters, custom types, and named route functions (to generate correct URLs)
- Automatic page-based code-splitting
- Boilerplate-less GraphQL API construction
- Cells: a declarative way to fetch data from the backend API
Expand Down Expand Up @@ -584,6 +584,23 @@ And there you have it.
<td align="center"><a href="https://github.com/7shantanu7"><img src="https://avatars.githubusercontent.com/u/51382138?v=4" width="100px;" alt=""/><br /><sub><b>Shantanu Zadbuke</b></sub></a></td>
<td align="center"><a href="https://github.com/DukeManh"><img src="https://avatars.githubusercontent.com/u/51073515?v=4" width="100px;" alt=""/><br /><sub><b>Duke Manh</b></sub></a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/memarino92"><img src="https://avatars.githubusercontent.com/u/62777339?v=4" width="100px;" alt=""/><br /><sub><b>Michael Marino</b></sub></a></td>
<td align="center"><a href="https://github.com/kibertoad"><img src="https://avatars.githubusercontent.com/u/1847934?v=4" width="100px;" alt=""/><br /><sub><b>Igor Savin</b></sub></a></td>
<td align="center"><a href="https://jacobarriola.com/"><img src="https://avatars.githubusercontent.com/u/1371573?v=4" width="100px;" alt=""/><br /><sub><b>Jacob Arriola</b></sub></a></td>
<td align="center"><a href="https://github.com/microsoft/Secure-Supply-Chain/"><img src="https://avatars.githubusercontent.com/u/90813519?v=4" width="100px;" alt=""/><br /><sub><b>Jingying Gu</b></sub></a></td>
<td align="center"><a href="https://kolberger.eu/"><img src="https://avatars.githubusercontent.com/u/16899513?v=4" width="100px;" alt=""/><br /><sub><b>Tim Kolberger</b></sub></a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/nzdjb"><img src="https://avatars.githubusercontent.com/u/825061?v=4" width="100px;" alt=""/><br /><sub><b>nzdjb</b></sub></a></td>
<td align="center"><a href="https://github.com/vivshaw"><img src="https://avatars.githubusercontent.com/u/23173985?v=4" width="100px;" alt=""/><br /><sub><b>Hannah Vivian Shaw</b></sub></a></td>
<td align="center"><a href="https://github.com/usman-coe"><img src="https://avatars.githubusercontent.com/u/2543952?v=4" width="100px;" alt=""/><br /><sub><b>usman kareemee</b></sub></a></td>
<td align="center"><a href="https://github.com/watway"><img src="https://avatars.githubusercontent.com/u/2321110?v=4" width="100px;" alt=""/><br /><sub><b>watway</b></sub></a></td>
<td align="center"><a href="https://github.com/edapm"><img src="https://avatars.githubusercontent.com/u/67737851?v=4" width="100px;" alt=""/><br /><sub><b>Edward Mason</b></sub></a></td>
</tr>
<tr>
<td align="center"><a href="https://tryhackme.com/p/zast99"><img src="https://avatars.githubusercontent.com/u/29718978?v=4" width="100px;" alt=""/><br /><sub><b>Mateo Carriquí</b></sub></a></td>
</tr>
</table>

<!-- markdownlint-restore -->
Expand Down
19 changes: 19 additions & 0 deletions __fixtures__/example-todo-main/api/src/lib/transform.js
@@ -0,0 +1,19 @@
var sym = Symbol()

var promise = Promise.resolve()

var check = arr.includes('yeah!')

console.log(arr[Symbol.iterator]())

Promise.allSettled()

console.log([].includes('bazinga'))

Promise.any()


Object.hasOwn({ x: 2 }, "x")

var arr = [1, 2, 3];
arr.at(0) === 1
17 changes: 16 additions & 1 deletion __fixtures__/example-todo-main/babel.config.js
@@ -1,3 +1,18 @@
// This is added as a test for prebuild;
// check: packages/internal/**/build_api.test.ts
module.exports = {
presets: ['@redwoodjs/core/config/babel-preset'],
plugins: [
[
'babel-plugin-auto-import',
{
declarations: [
{
// import kitty from 'kitty-purr'
default: 'kitty',
path: 'kitty-purr',
},
],
},
],
]
}
1 change: 0 additions & 1 deletion __fixtures__/example-todo-main/web/.babelrc.js

This file was deleted.

@@ -1,3 +1,3 @@
export const standard = {
todosCount: 42,
export const standard = () => {
return { todosCount: 42 }
}
@@ -0,0 +1,11 @@
export const QUERY = gql`
query NumTodosCell_GetCount {
todosCount
}
`

export const Loading = () => <div>Loading...</div>

export const Success = ({ todosCount }) => {
return <>{todosCount}</>
}
@@ -0,0 +1,7 @@
export function standard() {
return {
todosCount: 42,
}
}
export const justAnotherExport = 'bazinga'
export const please = () => 'leave_me_alone'
24 changes: 12 additions & 12 deletions babel.config.js
Expand Up @@ -55,6 +55,18 @@ module.exports = {
['@babel/plugin-proposal-class-properties', { loose: true }],
['@babel/plugin-proposal-private-methods', { loose: true }],
['@babel/plugin-proposal-private-property-in-object', { loose: true }],
[
'@babel/plugin-transform-runtime',
{
// https://babeljs.io/docs/en/babel-plugin-transform-runtime/#core-js-aliasing
// Setting the version here also requires `@babel/runtime-corejs3`
corejs: { version: 3, proposals: true },
// https://babeljs.io/docs/en/babel-plugin-transform-runtime/#version
// Transform-runtime assumes that @babel/runtime@7.0.0 is installed.
// Specifying the version can result in a smaller bundle size.
version: packageJSON.devDependencies['@babel/runtime-corejs3'],
},
],
],
overrides: [
// ** WEB PACKAGES **
Expand Down Expand Up @@ -93,18 +105,6 @@ module.exports = {
],
},
],
[
'@babel/plugin-transform-runtime',
{
// https://babeljs.io/docs/en/babel-plugin-transform-runtime/#core-js-aliasing
// Setting the version here also requires `@babel/runtime-corejs3`
corejs: { version: 3, proposals: true },
// https://babeljs.io/docs/en/babel-plugin-transform-runtime/#version
// Transform-runtime assumes that @babel/runtime@7.0.0 is installed.
// Specifying the version can result in a smaller bundle size.
version: packageJSON.devDependencies['@babel/runtime-corejs3'],
},
],
// normally provided through preset-env detecting TARGET_BROWSER
// but webpack 4 has an issue with this
// see https://github.com/PaulLeCam/react-leaflet/issues/883
Expand Down
12 changes: 6 additions & 6 deletions package.json
Expand Up @@ -7,21 +7,21 @@
"packages/*"
],
"devDependencies": {
"@babel/cli": "7.15.7",
"@babel/node": "7.15.8",
"eslint": "7.32.0",
"@babel/cli": "7.16.0",
"@babel/node": "7.16.0",
"eslint": "8.2.0",
"jest": "27.3.1",
"npm-packlist": "3.0.0",
"rimraf": "3.0.2",
"typescript": "4.4.4",
"typescript": "4.5.2",
"typescript-transform-paths": "3.3.1"
},
"resolutions": {
"@types/react": "17.0.31",
"@types/react": "17.0.35",
"prop-types": "15.7.2",
"react-dom": "17.0.2",
"react": "17.0.2",
"typescript": "4.4.4",
"typescript": "4.5.2",
"vscode-languageserver-protocol": "3.15.3",
"vscode-languageserver-types": "3.16.0",
"vscode-languageserver": "6.1.1",
Expand Down
16 changes: 8 additions & 8 deletions packages/api-server/package.json
@@ -1,7 +1,7 @@
{
"name": "@redwoodjs/api-server",
"description": "Redwood's HTTP server for Serverless Functions",
"version": "0.38.1",
"version": "0.39.2",
"bin": {
"rw-api-server": "./dist/index.js",
"rw-api-server-watch": "./dist/watch.js"
Expand All @@ -12,12 +12,12 @@
"main": "dist/cliHandlers",
"license": "MIT",
"dependencies": {
"@babel/plugin-transform-runtime": "7.15.8",
"@babel/plugin-transform-runtime": "7.16.4",
"ansi-colors": "4.1.1",
"chokidar": "3.5.2",
"fastify": "3.23.0",
"fastify": "3.24.1",
"fastify-http-proxy": "6.2.1",
"fastify-raw-body": "3.1.0",
"fastify-raw-body": "3.2.0",
"fastify-static": "4.5.0",
"fastify-url-data": "3.0.3",
"lodash.escape": "4.0.1",
Expand All @@ -30,13 +30,13 @@
"directory": "packages/api-server"
},
"devDependencies": {
"@babel/cli": "7.15.7",
"@types/aws-lambda": "8.10.84",
"@babel/cli": "7.16.0",
"@types/aws-lambda": "8.10.85",
"@types/lodash.escape": "4.0.6",
"@types/qs": "6.9.7",
"aws-lambda": "1.0.6",
"aws-lambda": "1.0.7",
"jest": "27.3.1",
"typescript": "4.4.4"
"typescript": "4.5.2"
},
"scripts": {
"build": "yarn build:js",
Expand Down
27 changes: 11 additions & 16 deletions packages/api/package.json
@@ -1,6 +1,6 @@
{
"name": "@redwoodjs/api",
"version": "0.38.1",
"version": "0.39.2",
"files": [
"dist",
"logger",
Expand All @@ -10,15 +10,15 @@
"types": "./dist/index.d.ts",
"license": "MIT",
"dependencies": {
"@prisma/client": "3.3.0",
"core-js": "3.18.3",
"@babel/runtime-corejs3": "7.16.3",
"@prisma/client": "3.5.0",
"crypto-js": "4.1.1",
"jsonwebtoken": "8.5.1",
"jwks-rsa": "2.0.5",
"md5": "2.3.0",
"pascalcase": "1.0.0",
"pino": "7.0.3",
"pino-pretty": "7.1.0",
"pino": "7.3.0",
"pino-pretty": "7.2.0",
"uuid": "8.3.2"
},
"repository": {
Expand All @@ -27,20 +27,15 @@
"directory": "packages/api"
},
"devDependencies": {
"@babel/cli": "7.15.7",
"@redwoodjs/auth": "0.38.1",
"@babel/cli": "7.16.0",
"@redwoodjs/auth": "0.39.2",
"@types/crypto-js": "4.0.2",
"@types/jsonwebtoken": "8.5.5",
"@types/jsonwebtoken": "8.5.6",
"@types/md5": "2.3.1",
"aws-lambda": "1.0.6",
"aws-lambda": "1.0.7",
"jest": "27.3.1",
"split2": "4.0.0",
"typescript": "4.4.4"
},
"jest": {
"testPathIgnorePatterns": [
"/dist/"
]
"split2": "4.1.0",
"typescript": "4.5.2"
},
"scripts": {
"build": "yarn build:js && yarn build:types",
Expand Down
4 changes: 2 additions & 2 deletions packages/api/src/validations/__tests__/validations.test.js
Expand Up @@ -269,7 +269,7 @@ describe('validate length', () => {
try {
validate('a', 'username', { length: { min: 2 } })
} catch (e) {
expect(e.message).toEqual('username must have more than 2 characters')
expect(e.message).toEqual('username must have at least 2 characters')
}

// custom error
Expand Down Expand Up @@ -297,7 +297,7 @@ describe('validate length', () => {
try {
validate('jeff', 'Username', { length: { max: 2 } })
} catch (e) {
expect(e.message).toEqual('Username must have less than 2 characters')
expect(e.message).toEqual('Username must have no more than 2 characters')
}

// custom error
Expand Down
4 changes: 2 additions & 2 deletions packages/api/src/validations/errors.ts
Expand Up @@ -83,7 +83,7 @@ export class InclusionValidationError extends ServiceValidationError {
export class MinLengthValidationError extends ServiceValidationError {
constructor(
name: string,
message = '${name} must have more than ${min} characters',
message = '${name} must have at least ${min} characters',
substitutions: { min?: number } = {}
) {
super(message, Object.assign(substitutions, { name }))
Expand All @@ -94,7 +94,7 @@ export class MinLengthValidationError extends ServiceValidationError {
export class MaxLengthValidationError extends ServiceValidationError {
constructor(
name: string,
message = '${name} must have less than ${max} characters',
message = '${name} must have no more than ${max} characters',
substitutions: { max?: number } = {}
) {
super(message, Object.assign(substitutions, { name }))
Expand Down

0 comments on commit 28ab311

Please sign in to comment.