profile
viewpoint
Justin Reidy jmreidy Razor Sharp Design PDX rzrsharp.net

jmreidy/grunt-browserify 574

Grunt task for node-browserify

jmreidy/fluxy 236

An implementation of Facebook's Flux architecture

jmreidy/grunt-mocha-webdriver 36

Grunt task to run Mocha tests against a WebDriver source - either PhantomJS or Sauce Labs

jmreidy/sauce-tunnel 27

A Node.js wrapper around the Saucelabs tunnel jar

jmreidy/react-foundation 7

Zurb Foundation as React components

jmreidy/react-combobox 4

A fork of react-autocomplete that has become its own thing.

jmreidy/heroku-buildpack-nodejs-grunt 2

A slightly modified version of Heroku's official Node.js buildpack with added grunt support.

jmreidy/starter 2

An opinionated React / Redux Project Starter.

jmreidy/chef-nvm 1

Chef cookbook for installing and running NVM

jmreidy/clj-orchestrate 1

An idiomatic Clojure wrapper of the Orchestrate.io Java client

MemberEvent

pull request commentredwoodjs/redwood

enable typescript services and sdl

This should be good to go but will need someone to take it over the finish line - I just had a baby!

jmreidy

comment created time in a month

Pull request review commentredwoodjs/redwood

Convert component generator to TS

 export const prettierOptions = () => {   } } +// TODO: Move this into `generateTemplate` when all templates have TS support+/*+ * Convert a generated TS template file into JS.+ */+export const transformTSToJS = (filename, content) => {+  const result = babel.transform(content, {+    filename,+    configFile: false,+    plugins: [+      [+        '@babel/plugin-transform-typescript',+        {+          isTSX: true,+          allExtensions: true,+        },+      ],+    ],+    retainLines: true,+  }).code++  return prettify(filename.replace(/\.ts$/, '.js'), result)

Now that we have .tsx, does all the extension magic still work?

kimadeline

comment created time in a month

Pull request review commentredwoodjs/redwood

Convert component generator to TS

 export const prettierOptions = () => {   } } +// TODO: Move this into `generateTemplate` when all templates have TS support+/*+ * Convert a generated TS template file into JS.+ */+export const transformTSToJS = (filename, content) => {+  const result = babel.transform(content, {+    filename,+    configFile: false,+    plugins: [+      [+        '@babel/plugin-transform-typescript',+        {+          isTSX: true,+          allExtensions: true,+        },+      ],+    ],+    retainLines: true,

oh I didn't know about this option... I think it'd make for prettier (no pun intended) output, I'll add this to the service and sdl generation (although I'm not touching that PR until it lands at this point)

kimadeline

comment created time in a month

Pull request review commentredwoodjs/redwood

Convert component generator to TS

 export const pathName = (path, name) => { export const createYargsForComponentGeneration = ({   componentName,   filesFn,+  builder = {+    force: { type: 'boolean', default: false },+    typescript: {+      type: 'boolean',+      default: false,+      describe: 'Generate TypeScript files',+      alias: 'ts',

👍 alias!

kimadeline

comment created time in a month

Pull request review commentredwoodjs/redwood

enable typescript services and sdl

 export const generateTemplate = (templateFilename, { name, root, ...rest }) => {  export const readFile = (target) => fs.readFileSync(target) -export const deleteFile = (target) => fs.unlinkSync(target)+export const deleteFile = (file) => {+  const extension = path.extname(file)+  if (['.js', '.ts'].includes(extension)) {+    const baseFile = getBaseFile(file)+    const files = [baseFile + '.js', baseFile + '.ts']+    files.forEach((f) => {+      if (fs.existsSync(f)) {+        fs.unlinkSync(f)+      }+    })+  } else {+    fs.unlinkSync(file)+  }+}++const getBaseFile = (file) => file.replace(/\.\w*$/, '')+

Instead of adding typescript as a flag to destroy, it felt more ergonomic to me for it to just destroy whatever js/ts variation is found.

jmreidy

comment created time in a month

Pull request review commentredwoodjs/redwood

enable typescript services and sdl

 global.__dirname = __dirname+ import { loadGeneratorFixture } from 'src/lib/test'+import { getDefaultArgs } from 'src/lib'  import * as service from '../service' -test('returns exactly 2 files', async () => {-  const files = await service.files({-    name: 'User',-    crud: false,-    relations: [],-  })+const extensionForBaseArgs = (baseArgs) =>+  baseArgs && baseArgs.typescript ? 'ts' : 'js' -  expect(Object.keys(files).length).toEqual(2)-})+const itReturnsExactly2Files = (baseArgs) => {

noted in a comment elsewhere - extracted tests into named function to reduce duplication across TS and JS versions

jmreidy

comment created time in a month

Pull request review commentredwoodjs/redwood

enable typescript services and sdl

+import gql from 'graphql-tag'

Sounds good, we can strip these when the ambients are added.

jmreidy

comment created time in a month

Pull request review commentredwoodjs/redwood

enable typescript services and sdl

 global.__dirname = __dirname++import fs from 'fs'++import 'src/lib/test'+import { getPaths, getDefaultArgs } from 'src/lib'++import { defaults, files } from '../../../generate/scaffold/scaffold'+import { tasks } from '../scaffold'+ jest.mock('fs')+jest.mock('@babel/core', () => {

babel is unhappy when you mock fs

jmreidy

comment created time in a month

push eventjmreidy/redwood

Justin Reidy

commit sha ab53b6b669a86eaf74babc9cd7da639ccd635a55

more merge fixes

view details

push time in a month

push eventjmreidy/redwood

Justin Reidy

commit sha 95aac039ca47bd5370e8dec55289b464bef3d782

more merge fixes

view details

push time in a month

push eventjmreidy/redwood

Justin Reidy

commit sha 6faae33dc26604a121bd1f014f73d0f322acd9ca

more merge fixes

view details

push time in a month

push eventjmreidy/redwood

Justin Reidy

commit sha 12b457a3268f030d2f6c1990e0ec221d060dd467

fixing bad rebase

view details

push time in a month

push eventjmreidy/redwood

Justin Reidy

commit sha dbb04434b2f105e9f416174cec2f6eddf1b9d732

fix regressions from template changes

view details

push time in a month

pull request commentredwoodjs/redwood

enable typescript services and sdl

Good news! I got it working! https://www.loom.com/share/9f3542034b3a44cfb974361835c69d46

Bad news - rebasing is a massive pain. Especially after https://github.com/redwoodjs/redwood/pull/611/files, which rewrote all the scaffold templates.

I'll need to keep working through conflicts, if we can hold on making changes to templates in the meantime, I'd appreciate it...

jmreidy

comment created time in a month

push eventjmreidy/redwood

Justin Reidy

commit sha cf7aede0c72bbab8b2b119d4c1d3af1f46f25e48

fixing merge issues

view details

push time in a month

push eventjmreidy/redwood

Kevin Young

commit sha 8d5b51c6e5569fa4ae57f75bba85539e53cf4321

fixes possible null error in truncate

view details

David S Price

commit sha dfc834a74b960a94f8dd2cc52c8541c7687298ad

add ErrorOverlayPlugin

view details

Anirudh Nimmagadda

commit sha 963b5cd01a21757e51f971eba0e812ec0ce4f6a3

'yarn rw dev' now only starts the API and DB servers when the api folder is present

view details

Anirudh Nimmagadda

commit sha 64826b2a345e98cf66dad5dcdfcc17c9c7f60217

Bugfix: reintroduced ability to start only the web or api side

view details

David Price

commit sha 7be1543c8ca5104158111a1a2e3b1cc5b1c55df3

Merge pull request #485 from kwyoung11/fix/null-value fixes possible null error in truncate (fixes #484)

view details

Lachlan Campbell

commit sha afa80d7db2ea6c0f2b34ad178f683f11696effe8

Fix typo on CheckBox docs (#492)

view details

Peter Pistorius

commit sha d26cc45a12cd9874cbab7ccb4c47e6f9260cd48e

Make RedwoodProvider auth aware.

view details

Peter Pistorius

commit sha e4494d59ad8cec3caa8e30874ccecdbe30909552

Improve comments.

view details

Peter Pistorius

commit sha 64baaedc3208e3b97f80ec0f495339d1181354c0

Add a way to extract the user from the headers.

view details

Peter Pistorius

commit sha 7306cf97a42de16b21772035459be66e5db68a4d

Fix types.

view details

Peter Pistorius

commit sha 110a68cae5e63ab4a7e6d75119c013cc209ccf0e

Formatting.

view details

Lachlan Campbell

commit sha c7bc9f46cf8a3ee8f306c6bd8f32400f97261a47

Humanize labels on scaffold forms (#493) * Humanize labels on scaffold forms * Update snapshot

view details

Dominic

commit sha 31a69761a0c52a8ad99d55f9af61e999bb5dabf5

Add README stubs to packages lacking one The stub comprises the following table of contents: * Purpose * Package lead * Roadmap * Overview * Contributing * FAQ Not all of the sections have to be a section, but all of them should be addressed. The structure is general and will probably change considerably.

view details

Lachlan Campbell

commit sha 684b4b58bc31aa5a5aee23d8b1c037b75b33dd21

Fix typo in internal README

view details

Peter Pistorius

commit sha 625fe16bbd5cf6c496cccd1a56bf6f2f440d28ad

Add option to compile jsx.

view details

Peter Pistorius

commit sha 3a9fcb4bc87322d49b49b5dfb002ed33a1107c5b

Add auth package stub.

view details

Peter Pistorius

commit sha 3bb7049e74ccf7cf06af4562123ce14b1193ee04

Use same react types version.

view details

Peter Pistorius

commit sha 9163720cc777b055d8ca330240d774657c1b5dd8

Add auth package.

view details

Peter Pistorius

commit sha 6f1342f97df62e6af2f6cfedca5b54865a2a73b8

Merge pull request #499 from lachlanjc/patch-1 Fix typo in internal README

view details

eurobob

commit sha 5efa7b3606ce610703832dfea77746a438954fda

Enable cell to take functions for a query In order to be able to write dynamic queries in a cell, we need to be able to optionally pass the component props

view details

push time in a month

push eventjmreidy/redwood

Kevin Young

commit sha 1f9d84f25f2f0ab50909dd421e55963dcf5e8a58

fixes possible null error in truncate

view details

Lachlan Campbell

commit sha 3144feea26daa7eb94f9f97a7fd066ec3e430ee3

Fix typo on CheckBox docs (#492)

view details

Lachlan Campbell

commit sha 80768b75750ecc53b0d962b0147045c42c85c350

Humanize labels on scaffold forms (#493) * Humanize labels on scaffold forms * Update snapshot

view details

Lachlan Campbell

commit sha 4e4703a1587fafd0e1b0622d5cc344c39b397442

Fix typo in internal README

view details

Lachlan Campbell

commit sha b00d7df4507f3e95eb5e5e213802655b5b14fa8f

Switch out "Hammer" data source (#506)

view details

Anirudh Nimmagadda

commit sha 7bf5f2b2474c8c51562d48b4bc907fb7219ca736

'yarn rw dev' now only starts the API and DB servers when the api folder is present

view details

Anirudh Nimmagadda

commit sha 87fb5d51d6f30de8c0606b0eefae5b62ec11647d

Bugfix: reintroduced ability to start only the web or api side

view details

vikash-eatgeek

commit sha edc2fbf0cde42009e98d7e9afd15b81ca8c04774

Add console log on rebuild complete

view details

Rob Cameron

commit sha 4919c790c8c91ed697cf94d5b46f9568c223ff14

Adds function generator (#517) * Adds function generator Closes #516 * Remove comment, old code * Adds test for updated templateForComponentFile * Update test path * Try another path Co-authored-by: Rob Cameron <rob.cameron@fastmail.com>

view details

Rob Cameron

commit sha 21da0a0bb1a0fd61b05e52ef05e4bf95046f25d2

Fix handler export in generated function

view details

David S Price

commit sha 61fcfb266325f10b3c367b17cff8990c17021196

add ErrorOverlayPlugin

view details

David S Price

commit sha 1bf3b4505539ec7ebb62a379cf9602bee56da559

move settings to webpack dev config

view details

David Price

commit sha 24d8e05ee8988ca6fa5e4b4c65eb03b47aa0d383

add Yargs links to CLI README

view details

Anthony Powell

commit sha 08d366614462ec1c2f14c8e243d38de1758480b3

Fix NamesCell reload after deleting item (#519) Use pluralCamelName in place of hardcoded string when performing refetchQuery in delete handler

view details

Dominic

commit sha 988b01de02bcb33b0b3a6e3fcfb6120dea4ee683

Add README stubs to packages lacking one The stub comprises the following table of contents: * Purpose * Package lead * Roadmap * Overview * Contributing * FAQ Not all of the sections have to be a section, but all of them should be addressed. The structure is general and will probably change considerably.

view details

Dominic

commit sha f31ed52393308dcbe2a13a31ccdd91ddbd08946d

Rename section titles and add instructional content

view details

Robert Broersm

commit sha 47a91e6723477e3031e75a9eff9e2f040eb74f4a

Convert custom webpack cell-loader into Babel Plugin

view details

Robert

commit sha 85615628e81fee8b97d9674d1f72bff2a11b08f8

Apply suggestions from code review Added some documentation and improved readability Co-authored-by: Peter Pistorius <peter.pistorius@gmail.com>

view details

Robert

commit sha c519fa47a13a4df7bd062a234dca2b176e100670

Code readability tweaks

view details

Robert

commit sha 962b7cce1414792073c7ceb3df2a3e5e1ba4a1a3

Remove empty comment line

view details

push time in a month

push eventjmreidy/redwood

Justin Reidy

commit sha 1252802b830b70fe4e7bddb8071132c989fb8e3c

destruction enabled!

view details

push time in a month

push eventjmreidy/redwood

Justin Reidy

commit sha 6609266262c99a0668d93a89524308e0aecd53d6

tests to green

view details

push time in a month

push eventjmreidy/redwood

Justin Reidy

commit sha 12342e845f5b1b15aef479b23fef3a2c7d33770a

real world testing updates

view details

push time in a month

pull request commentredwoodjs/redwood

enable typescript services and sdl

@peterp Just a heads up that I'm working through testing all combinations of actually running yargs commands locally, and will update this PR when I've confirmed all the smoke tests are working.

jmreidy

comment created time in a month

pull request commentredwoodjs/redwood

enable typescript services and sdl

I wasn't destructuring the args correctly, that's fixed now.

Longer term, I wonder if we mock yargs to have true end-to-end tests. I'm a little worried about skipping the yargs interface entirely to go straight to the underlying files calls.

On Wed, May 27, 2020 at 4:00 PM Peter Pistorius notifications@github.com wrote:

I think there may be a problem with the conversion of default to builder, I get the following when trying to run the script:

yarn rw g scaffold --help Generate Pages, SDL, and Services files based on a given DB schema Model. Also accepts <path/model>.

Positionals: model Model to scaffold. You can also use <path/model> to nest files by type at the given path directory (or directories). For example, 'rw g scaffold admin/post'. [required]

Options: --0 -1 Generate JavaScript files [boolean] [default: true] --help Show help [boolean] --version Show version number [boolean]

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/redwoodjs/redwood/pull/515#issuecomment-634908746, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAIY3I2IP7XQOZ3LJPNDYLRTVWPFANCNFSM4MZZJ6RQ .

jmreidy

comment created time in a month

push eventjmreidy/redwood

Justin Reidy

commit sha da43d737888ee77e4c0c5856aba24da001f7719c

fix scaffold optional args

view details

push time in a month

Pull request review commentredwoodjs/redwood

enable typescript services and sdl

 describe('in javascript (defualt) mode', () => {    // SDL -  test('creates an sdl', () => {+  test.only('creates an sdl', () => {

whoops, fixed!

jmreidy

comment created time in a month

push eventjmreidy/redwood

Justin Reidy

commit sha 8e6d142086c2bee356aecdf3bdfc96f8e2a35c5e

remove accidentl `only` in test

view details

push time in a month

PR opened redwoodjs/awesome-redwood

Add Linaria to How-Tos
+1 -0

0 comment

1 changed file

pr created time in a month

push eventjmreidy/awesome-redwood

Justin Reidy

commit sha 9116931d8636c61e6886d9467ac7273190bdc8d1

Add Linaria to How-Tos

view details

push time in a month

fork jmreidy/awesome-redwood

A community-driven collection of Redwood related plugins, config, themes, build scripts, tutorials, podcasts, and more.

https://redwoodjs.com

fork in a month

pull request commentredwoodjs/redwood

enable typescript services and sdl

@peterp I rebased off master and pushed up. The issue was that the scaffold tests expected an object from builder instead of the functional pattern. I refactored a touch to extract the default options in scaffold and use those in test (instead of directly using the builder).

Let me know what else I can add!

Also @cannikin @thedavidprice wanted to give you a chance to review. Thanks all!

jmreidy

comment created time in a month

push eventjmreidy/redwood

eurobob

commit sha 5efa7b3606ce610703832dfea77746a438954fda

Enable cell to take functions for a query In order to be able to write dynamic queries in a cell, we need to be able to optionally pass the component props

view details

eurobob

commit sha 0205553caf31dba57a747fde7b87c4f4b85ee7af

Prettier formatting (Almost got away with editing in the github browser 😛)

view details

Peter Pistorius

commit sha 44a2997ab8ad43b84c82c29b28496b7d488b98a8

Update packages/web/src/graphql/withCell.js

view details

Peter Pistorius

commit sha f8c94626010754ac19a4cd106e43dbdaccbfbb8e

Update packages/web/src/graphql/withCell.js

view details

Anton Moiseev

commit sha f9ce1184fb4121dbe7b6c1642031aa4d1821182d

WIP: add destroy for components (#80)

view details

Anton Moiseev

commit sha f25c9a2757ce58faa3509eae0846dd60373f1136

WIP: fix import path

view details

Anton Moiseev

commit sha 43d66ccbd4aa8f0756d6911adc72520e1caf4284

WIP: move destroy component command's file into subfolder.

view details

Anton Moiseev

commit sha 79a93b5811249f0925718af7f9c4e9d07af5f82e

WIP: add `destroy service` command

view details

Anton Moiseev

commit sha 385ffe31eb728ee705f69439338b68410f963c71

WIP: add destroy for cell and layout components

view details

Anton Moiseev

commit sha b1956c2619100b1217605916f81434ddf9bdab4a

WIP: improve desc for generate and destroy tasks

view details

Anton Moiseev

commit sha b0a2f7b44172ad9187cd46692265a625e507099a

WIP: add destroy for page components

view details

Anton Moiseev

commit sha f5a13161134b35219bfea4b2963dc137afc159e9

WIP: add destroy for sdl components

view details

Anton Moiseev

commit sha e8a426e0d320add10b968dd37e0248c35892ba55

WIP: add destroy for scaffold components

view details

Anton Moiseev

commit sha bd9b5b6faa1a660bf01878e8b8c5a6b4343ff480

WIP: clean up empty dirs after destroy

view details

Anton Moiseev

commit sha ffe5fc21735cb415a870b8c7fef9c16a787235eb

Minor cleanup, renaming

view details

Anton Moiseev

commit sha 4bf03fbff5717201048d4a2b611b8cdcf35fccbb

Add test for destroy page command

view details

Anton Moiseev

commit sha dd1a6b45a99e81e3eab36d4c3400c1ae285f186d

Split page destroy test into three

view details

Peter Pistorius

commit sha 86a0d647eb324a94c8ac44f751f511d12f675b08

Update packages/web/src/graphql/withCell.js

view details

Peter Pistorius

commit sha 12cf2222c705d31ef39d46a0f6976d4c55ed6228

Merge branch 'master' into cell-query-props

view details

Peter Pistorius

commit sha 34669c9602e99554f27fd84f4d53fe5887bfe490

Merge branch 'master' into cell-query-props

view details

push time in a month

MemberEvent

pull request commentredwoodjs/redwood

enable typescript services and sdl

@peterp you got it, i will also rebase off master tomorrow so it'll be up to date

jmreidy

comment created time in a month

Pull request review commentredwoodjs/redwood

enable typescript services and sdl

+/*

I'm commenting out the import for now, since the generated test doesn't actually do anything with the import. I figure when we start building out the auto-generated test assertions we can remove the comments from the generation. Alternatively I can remove the comments (although a linter will warn about the unused import)

jmreidy

comment created time in 2 months

Pull request review commentredwoodjs/redwood

enable typescript services and sdl

 global.__dirname = __dirname  import { loadGeneratorFixture } from 'src/lib/test'+import { getDefaultArgs } from 'src/lib'  import * as sdl from '../sdl'  afterEach(() => {   jest.clearAllMocks() }) -test('returns exactly 3 files', async () => {-  const files = await sdl.files({ name: 'Post', crud: false })+const extensionForBaseArgs = (baseArgs) =>+  baseArgs && baseArgs.typescript ? 'ts' : 'js' -  expect(Object.keys(files).length).toEqual(3)-})+const itReturnsExactlyThreeFiles = (baseArgs = {}) => {

(Although, to argue against myself, I just duped test calls for the scaffold generator in two different description blocks...)

jmreidy

comment created time in 2 months

Pull request review commentredwoodjs/redwood

enable typescript services and sdl

+import { UserWhereUniqueInput } from '@prisma/client'

Yep exactly. They're not present in the generated JS

jmreidy

comment created time in 2 months

Pull request review commentredwoodjs/redwood

enable typescript services and sdl

 global.__dirname = __dirname  import { loadGeneratorFixture } from 'src/lib/test'+import { getDefaultArgs } from 'src/lib'  import * as sdl from '../sdl'  afterEach(() => {   jest.clearAllMocks() }) -test('returns exactly 3 files', async () => {-  const files = await sdl.files({ name: 'Post', crud: false })+const extensionForBaseArgs = (baseArgs) =>+  baseArgs && baseArgs.typescript ? 'ts' : 'js' -  expect(Object.keys(files).length).toEqual(3)-})+const itReturnsExactlyThreeFiles = (baseArgs = {}) => {

The reason I'm doing this is to avoid duplicating the same set of tests within typescript and javascript description blocks. I'd be happy to employ another solution here. (Alternatively we just duplicate the tests, but that feels slightly brittle to me)

jmreidy

comment created time in 2 months

Pull request review commentredwoodjs/redwood

enable typescript services and sdl

+import gql from 'graphql-tag'

It works when building, but VS Code complains about it. Is there a way of configuring VSCode to know to look for the auto-import plugin?

jmreidy

comment created time in 2 months

pull request commentredwoodjs/redwood

Add path specification to scaffolds

Love this! Can't wait to put it to use. Thanks @jtoar !

jtoar

comment created time in 2 months

push eventjmreidy/redwood

Justin Reidy

commit sha d806b10d336734a5bb2da181b390bd0f4bcdcc54

fix test regression

view details

push time in 2 months

pull request commentredwoodjs/redwood

enable typescript services and sdl

@cannikin @peterp @thedavidprice @guledali This should now be ready for review! Thanks for your patience.

jmreidy

comment created time in 2 months

push eventjmreidy/redwood

David S Price

commit sha dfc834a74b960a94f8dd2cc52c8541c7687298ad

add ErrorOverlayPlugin

view details

Anirudh Nimmagadda

commit sha 963b5cd01a21757e51f971eba0e812ec0ce4f6a3

'yarn rw dev' now only starts the API and DB servers when the api folder is present

view details

Anirudh Nimmagadda

commit sha 64826b2a345e98cf66dad5dcdfcc17c9c7f60217

Bugfix: reintroduced ability to start only the web or api side

view details

Peter Pistorius

commit sha d26cc45a12cd9874cbab7ccb4c47e6f9260cd48e

Make RedwoodProvider auth aware.

view details

Peter Pistorius

commit sha e4494d59ad8cec3caa8e30874ccecdbe30909552

Improve comments.

view details

Peter Pistorius

commit sha 64baaedc3208e3b97f80ec0f495339d1181354c0

Add a way to extract the user from the headers.

view details

Peter Pistorius

commit sha 7306cf97a42de16b21772035459be66e5db68a4d

Fix types.

view details

Peter Pistorius

commit sha 110a68cae5e63ab4a7e6d75119c013cc209ccf0e

Formatting.

view details

Dominic

commit sha 31a69761a0c52a8ad99d55f9af61e999bb5dabf5

Add README stubs to packages lacking one The stub comprises the following table of contents: * Purpose * Package lead * Roadmap * Overview * Contributing * FAQ Not all of the sections have to be a section, but all of them should be addressed. The structure is general and will probably change considerably.

view details

Peter Pistorius

commit sha 625fe16bbd5cf6c496cccd1a56bf6f2f440d28ad

Add option to compile jsx.

view details

Peter Pistorius

commit sha 3a9fcb4bc87322d49b49b5dfb002ed33a1107c5b

Add auth package stub.

view details

Peter Pistorius

commit sha 3bb7049e74ccf7cf06af4562123ce14b1193ee04

Use same react types version.

view details

Peter Pistorius

commit sha 9163720cc777b055d8ca330240d774657c1b5dd8

Add auth package.

view details

Peter Pistorius

commit sha 05c9999acd484ce83516e000ddd485304c49e532

Make auth package compile with TypeScript.

view details

vikash-eatgeek

commit sha bc4f1d4f1e5cac1f770836c47b1e5a3bfbd9f922

Add console log on rebuild complete

view details

Peter Pistorius

commit sha 1cdf621938509273d054143a991fa4f5e2f30614

Add initial implementation of AuthRoute.

view details

Robert Broersm

commit sha c0417c7a96a43bcc02ae6422b053c369bc87df63

Convert custom webpack cell-loader into Babel Plugin

view details

Peter Pistorius

commit sha 3bb22fc900b34162ff3886086b4279ff07584a6c

Merge pull request #490 from ackinc/fix/conditionally-start-api-and-db Fix: 'yarn rw dev' now only starts the API and DB servers when the api folder is present

view details

Peter Pistorius

commit sha e8f5c053490c2ad8323f17cd15066eac7869abf1

Merge pull request #504 from vikash-eatgeek/chore/rebuild_console_log Add console log on rebuild complete

view details

David S Price

commit sha 9b1fb26c800d9947ab81e7fe69ae233ca5324bb4

move settings to webpack dev config

view details

push time in 2 months

push eventjmreidy/redwood

Anirudh Nimmagadda

commit sha 711687b5344de5dfb943a42c34efd176846c3288

'yarn rw dev' now only starts the API and DB servers when the api folder is present

view details

Anirudh Nimmagadda

commit sha b6d339ab49c784eb7e7e9ecad432a4f254c24b0b

Bugfix: reintroduced ability to start only the web or api side

view details

vikash-eatgeek

commit sha f0f259181127315b1384e241582d2dc93109abde

Add console log on rebuild complete

view details

Rob Cameron

commit sha 3f249a861fcc84398ac16ea09013fbc2844642c9

Adds function generator (#517) * Adds function generator Closes #516 * Remove comment, old code * Adds test for updated templateForComponentFile * Update test path * Try another path Co-authored-by: Rob Cameron <rob.cameron@fastmail.com>

view details

Rob Cameron

commit sha 43c01bd2ecb959b0bff536ffc082b3eb18743a93

Fix handler export in generated function

view details

David S Price

commit sha af9b478310c36c0b5f927873b1ed5d8879b4e7ac

add ErrorOverlayPlugin

view details

David S Price

commit sha 3ee5db417b1b4844c5e62bfe25afb23324704784

move settings to webpack dev config

view details

David Price

commit sha 52976a27bd74a576682f503abbf5dfe2f29d30a1

add Yargs links to CLI README

view details

Anthony Powell

commit sha e95eec4660187aa98654cad957128c2806155d3f

Fix NamesCell reload after deleting item (#519) Use pluralCamelName in place of hardcoded string when performing refetchQuery in delete handler

view details

Dominic

commit sha 5b9eb65ecfd2c76cbd47f67669184002a18905f5

Add README stubs to packages lacking one The stub comprises the following table of contents: * Purpose * Package lead * Roadmap * Overview * Contributing * FAQ Not all of the sections have to be a section, but all of them should be addressed. The structure is general and will probably change considerably.

view details

Dominic

commit sha 72c3203df9613531837ab05207bb63a75ab811aa

Rename section titles and add instructional content

view details

Robert Broersm

commit sha 9d9d6d58d14b874d50154f72ea460d19947bc1bc

Convert custom webpack cell-loader into Babel Plugin

view details

Robert

commit sha 560494f275454fb51df667f36d6635f4f829d0bd

Apply suggestions from code review Added some documentation and improved readability Co-authored-by: Peter Pistorius <peter.pistorius@gmail.com>

view details

Robert

commit sha de323dbfe88ff2f26f8845092ed1304a24301b09

Code readability tweaks

view details

Robert

commit sha 25c021ec90a5bc4d6324554cf361e01304c0ec60

Remove empty comment line

view details

Robert Broersm

commit sha 6ecd3239ffd427cd7a39e1b015ff8711a07cc506

test(core): add tests for babel cell plugin

view details

Robert Broersm

commit sha d2b4e54830c788bd8d72e5bca24b5baef911b0a0

Move babel-plugin-tester to devDependencies

view details

Peter Pistorius

commit sha 06f437553bb362c3ed22f7bc98440bf1904347e6

Make RedwoodProvider auth aware.

view details

Peter Pistorius

commit sha fc19147e4c40d5a788475c597dc11a473c89a7a6

Improve comments.

view details

Peter Pistorius

commit sha 2dfa3bcabd355aac5e53899d1bfadd3b22c7c58c

Add a way to extract the user from the headers.

view details

push time in 2 months

push eventjmreidy/redwood

Justin Reidy

commit sha 2152d6998643f05294d1528b54ee1f21a641928f

ensure tests use default builder args

view details

Justin Reidy

commit sha bd44e900214b678cda3739cbb7f8d99ca169b099

update scaffold code

view details

push time in 2 months

Pull request review commentredwoodjs/redwood

[wip] enable typescript services and sdl

 export const generateTemplate = (templateFilename, { name, root, ...rest }) => {   const parser = {

This code wasn't working previously, since templateFilename === template

jmreidy

comment created time in 2 months

push eventjmreidy/redwood

Justin Reidy

commit sha 852defefcaf3f29198db63cdd26cf8a31a304325

add javascript flag to sdl and service

view details

push time in 2 months

issue commentredwoodjs/redwood

TypeScript: Generators and Templates tracking issue

@MarkPollmann FYI I've extracted the functionality to transform generated TS into prettier-ified JS, you can take a look at my PR or just branch off it.

thedavidprice

comment created time in 2 months

push eventjmreidy/redwood

Justin Reidy

commit sha 2b4cbe17dd77e39131f2d0a088f7ec6ecbf4baf1

extract transform from service, get it working with SDL

view details

push time in 2 months

push eventjmreidy/redwood

Justin Reidy

commit sha f8c0b20ad11e04ed5a4461b1f80e3f61ad733837

use only ts template for services

view details

push time in 2 months

push eventjmreidy/redwood

Justin Reidy

commit sha c4b21082ec7105793435d6bbff0716f4de504d9e

add graphql types for generated relations in services

view details

push time in 2 months

issue commentredwoodjs/redwood

TypeScript: Generators and Templates tracking issue

I've picked up SDL and Service, will post in the forum for volunteers for the rest!

thedavidprice

comment created time in 2 months

push eventjmreidy/redwood

Justin Reidy

commit sha a4d75ce7e47ffb28334c960fa75d06d6cda41e2f

remote dupe test fixtures

view details

push time in 2 months

Pull request review commentredwoodjs/redwood

[wip] enable typescript services and sdl

+import { db } from 'src/lib/db'+<%if (crud) { %>import {+  ${singularPascalName}WhereUniqueInput,+  ${singularPascalName}CreateInput,+  ${singularPascalName}UpdateInput,+} from '@prisma/client'+<% } %>+export const ${pluralCamelName} = () => {+  return db.${singularCamelName}.findMany()+}<% if (crud) { %>++export const ${singularCamelName} = ({ id }: ${singularPascalName}WhereUniqueInput) => {+  return db.${singularCamelName}.findOne({+    where: { id },+  })+}++interface Create${singularPascalName}Args {+  input: ${singularPascalName}CreateInput+}++export const create${singularPascalName} = ({ input }: Create${singularPascalName}Args) => {+  return db.${singularCamelName}.create({+    data: input,+  })+}++interface Update${singularPascalName}Args {+  where: ${singularPascalName}WhereUniqueInput+  input: ${singularPascalName}UpdateInput+}++export const update${singularPascalName} = ({ id, input }: Update${singularPascalName}Args) => {+  return db.${singularCamelName}.update({+    data: input,+    where: { id },+  })+}++export const delete${singularPascalName} = ({ id }: ${singularPascalName}WhereUniqueInput) => {+  return db.${singularCamelName}.delete({+    where: { id },+  })+}<% } %><% if (relations.length) { %>++export const ${singularPascalName} = {<% relations.forEach(relation => { %>+  ${relation}: (_obj, { root }) => db.${singularCamelName}.findOne({ where: { id: root.id } }).${relation}(),<% }) %>

image

Does this look about right?

jmreidy

comment created time in 2 months

pull request commentredwoodjs/redwood

[wip] enable typescript services and sdl

I've added tests for SDL and service generation, and updated the generated crud service files to have proper types for function parameters.

Next I'll need to update the scaffold generator to support typescript, and finally update the generators to use a single TS template and then transpile to JS for default.

I'll update the PR description to include a checklist reflecting the above.

jmreidy

comment created time in 2 months

Pull request review commentredwoodjs/redwood

[wip] enable typescript services and sdl

+import { db } from 'src/lib/db'+import {+  UserProfileWhereUniqueInput,+  UserProfileCreateInput,+  UserProfileUpdateInput,+} from '@prisma/client'+++export const userProfiles = () => {+  return db.userProfile.findMany()+}++export const userProfile = ({ id }: UserProfileWhereUniqueInput) => {+  return db.userProfile.findOne({+    where: { id },+  })+}

@guledali updated generated files to include types, let me know what you think

jmreidy

comment created time in 2 months

push eventjmreidy/redwood

Justin Reidy

commit sha 3ced7d65c2e284842076aae403d06d33375b2dbb

add tests for service generation

view details

push time in 2 months

pull request commentredwoodjs/redwood

[wip] enable typescript services and sdl

@guledali What do you think about how we type the function params?

There's a couple options.

Inline:

export const updateUserProfile = ({ id, input }: { id: UserProfileWhereUniqueInput, input: UserProfileUpdateInput }) => {

Named args interface:

interface UpdateUserProfileArgs {
  id: UserProfileWhereUniqueInput;
  input: UserProfileUpdateInput;
}

export const updateUserProfile = ({ id, input }: UpdateUserProfileArgs) => {
jmreidy

comment created time in 2 months

push eventjmreidy/redwood

David S Price

commit sha dfc834a74b960a94f8dd2cc52c8541c7687298ad

add ErrorOverlayPlugin

view details

Anirudh Nimmagadda

commit sha 963b5cd01a21757e51f971eba0e812ec0ce4f6a3

'yarn rw dev' now only starts the API and DB servers when the api folder is present

view details

Anirudh Nimmagadda

commit sha 64826b2a345e98cf66dad5dcdfcc17c9c7f60217

Bugfix: reintroduced ability to start only the web or api side

view details

Peter Pistorius

commit sha d26cc45a12cd9874cbab7ccb4c47e6f9260cd48e

Make RedwoodProvider auth aware.

view details

Peter Pistorius

commit sha e4494d59ad8cec3caa8e30874ccecdbe30909552

Improve comments.

view details

Peter Pistorius

commit sha 64baaedc3208e3b97f80ec0f495339d1181354c0

Add a way to extract the user from the headers.

view details

Peter Pistorius

commit sha 7306cf97a42de16b21772035459be66e5db68a4d

Fix types.

view details

Peter Pistorius

commit sha 110a68cae5e63ab4a7e6d75119c013cc209ccf0e

Formatting.

view details

Dominic

commit sha 31a69761a0c52a8ad99d55f9af61e999bb5dabf5

Add README stubs to packages lacking one The stub comprises the following table of contents: * Purpose * Package lead * Roadmap * Overview * Contributing * FAQ Not all of the sections have to be a section, but all of them should be addressed. The structure is general and will probably change considerably.

view details

Peter Pistorius

commit sha 625fe16bbd5cf6c496cccd1a56bf6f2f440d28ad

Add option to compile jsx.

view details

Peter Pistorius

commit sha 3a9fcb4bc87322d49b49b5dfb002ed33a1107c5b

Add auth package stub.

view details

Peter Pistorius

commit sha 3bb7049e74ccf7cf06af4562123ce14b1193ee04

Use same react types version.

view details

Peter Pistorius

commit sha 9163720cc777b055d8ca330240d774657c1b5dd8

Add auth package.

view details

Peter Pistorius

commit sha 05c9999acd484ce83516e000ddd485304c49e532

Make auth package compile with TypeScript.

view details

vikash-eatgeek

commit sha bc4f1d4f1e5cac1f770836c47b1e5a3bfbd9f922

Add console log on rebuild complete

view details

Peter Pistorius

commit sha 1cdf621938509273d054143a991fa4f5e2f30614

Add initial implementation of AuthRoute.

view details

Robert Broersm

commit sha c0417c7a96a43bcc02ae6422b053c369bc87df63

Convert custom webpack cell-loader into Babel Plugin

view details

Peter Pistorius

commit sha 3bb22fc900b34162ff3886086b4279ff07584a6c

Merge pull request #490 from ackinc/fix/conditionally-start-api-and-db Fix: 'yarn rw dev' now only starts the API and DB servers when the api folder is present

view details

Peter Pistorius

commit sha e8f5c053490c2ad8323f17cd15066eac7869abf1

Merge pull request #504 from vikash-eatgeek/chore/rebuild_console_log Add console log on rebuild complete

view details

David S Price

commit sha 9b1fb26c800d9947ab81e7fe69ae233ca5324bb4

move settings to webpack dev config

view details

push time in 2 months

pull request commentredwoodjs/redwood

[wip] enable typescript services and sdl

@thedavidprice Awesome! This is all the info I need. I'm moving forward with the SDL and service generators, and will start coordinating with the community on related TS issues. I just pushed up unit testing to cover the TS sdl use case, and I'm working on that for services as well.

@guledali great callout, I'm updating services to follow this style, thanks for the poke on it!

jmreidy

comment created time in 2 months

push eventjmreidy/redwood

Justin Reidy

commit sha 8b35c64f1080f62a16c36d682d25054e6fe59628

update tests for sdl

view details

push time in 2 months

pull request commentredwoodjs/redwood

[wip] enable typescript services and sdl

@thedavidprice hats off for fantastic documentation and breakdown in that tracking issue. Thanks so much for the clarifying commentary both there and in this thread.

Two last questions from me:

  • do we want to rewrite the yargs generator files themselves as TS?
  • how should we batch these changes? 523_typescript_templates feature branch?

And yes, happy to help organize the effort and pull in folks from the community, just let me know if you have any specific guidance on how you'd like me to proceed there.

jmreidy

comment created time in 2 months

pull request commentredwoodjs/redwood

[wip] enable typescript services and sdl

A couple other options:

  • we enable TS for scaffold, but only for non-web files
  • we update all generators to support TS, but don't land it until router support lands

On Fri, May 8, 2020 at 12:27 PM Rob Cameron notifications@github.com wrote:

Hmm, I don't love the idea of only the sdl and services generators supporting TS and not the others...ideally all the generators should offer the same experience. But I guess we have to start somewhere?

What do you think @thedavidprice https://github.com/thedavidprice and @mojombo https://github.com/mojombo? How's the developer experience with only those two generators being typescript enabled? Maybe if you try the --typescript flag with any of the other generators you get some console output telling you "Typescript support is coming soon" and we can replace them one at a time?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/redwoodjs/redwood/pull/515#issuecomment-625898010, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAIY3N5LJ5QQBO6YHYDJUDRQQXIXANCNFSM4MZZJ6RQ .

jmreidy

comment created time in 2 months

pull request commentredwoodjs/redwood

[wip] enable typescript services and sdl

@cannikin realizing as well that if we generate TS SDL files, and then run scaffold, scaffold would check for the existence of a js file and generate one.

I'm hesitant to add typescript to scaffold, since converting web files to use TS is not nearly as straightforward right now (until changes to Router and Cells land etc).

I'm considering the following:

  • enable a typescript flag for service and sdl generation, as in this PR
  • update scaffold to check for the existence of js OR ts service and SDL files when executing

What do y'all think?

jmreidy

comment created time in 2 months

pull request commentredwoodjs/redwood

[wip] enable typescript services and sdl

@peterp makes sense. How would a consumer enable JS instead of TS? Pass a --typsescript false flag?

jmreidy

comment created time in 2 months

pull request commentredwoodjs/redwood

enable typescript services and sdl

@cannikin thanks, I'll mark this as draft until i add tests

jmreidy

comment created time in 2 months

push eventjmreidy/redwood

Justin Reidy

commit sha f36fd54e30ba8383afdb04b5a1751db70d1434fb

fix compilation issue

view details

push time in 2 months

PR opened DefinitelyTyped/DefinitelyTyped

add "extensions" arg to require-dir

Please fill in this template.

  • [X] Use a meaningful title for the pull request. Include the name of the package modified.
  • [X] Test the change in your own code. (Compile and run.)
  • [X] Add or edit tests to reflect the change. (Run with npm test.)
  • [ ] Follow the advice from the readme.
  • [ ] Avoid common mistakes.
  • [ ] Run npm run lint package-name (or tsc if no tslint.json is present).

Select one of these and delete the others:

If adding a new definition:

  • [ ] The package does not already provide its own types, or cannot have its .d.ts files generated via --declaration
  • [ ] If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package.
  • [ ] Create it with dts-gen --dt, not by basing it on an existing project.
  • [ ] Represents shape of module/library correctly
  • [ ] tslint.json should be present and it shouldn't have any additional or disabling of rules. Just content as { "extends": "dtslint/dt.json" }. If for reason the some rule need to be disabled, disable it for that line using // tslint:disable-next-line [ruleName] and not for whole package so that the need for disabling can be reviewed.
  • [ ] tsconfig.json should have noImplicitAny, noImplicitThis, strictNullChecks, and strictFunctionTypes set to true.

If changing an existing definition:

  • [X] Provide a URL to documentation or source code which provides context for the suggested changes: https://github.com/aseemk/requireDir#options
  • [ ] If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the header.
  • [X] Include tests for your changes
  • [ ] If you are making substantial changes, consider adding a tslint.json containing { "extends": "dtslint/dt.json" }. If for reason the any rule need to be disabled, disable it for that line using // tslint:disable-next-line [ruleName] and not for whole package so that the need for disabling can be reviewed.

If removing a declaration:

  • [ ] If a package was never on DefinitelyTyped, you don't need to do anything. (If you wrote a package and provided types, you don't need to register it with us.)
  • [ ] Delete the package's directory.
  • [ ] Add it to notNeededPackages.json.
+11 -6

0 comment

2 changed files

pr created time in 2 months

create barnchjmreidy/DefinitelyTyped

branch : update_require-dir

created branch time in 2 months

push eventjmreidy/redwood

Justin Reidy

commit sha e566c5645929dbf69f81eed5409f9255a1d94e8e

enable typescript services and sdl

view details

push time in 2 months

push eventjmreidy/DefinitelyTyped

Dmytro Gokun

commit sha cdc9c593eb56a06867bf066430295987d4c41b64

[mapbox-gl] add LngLat.distanceTo (#43084)

view details

Michel Bitter

commit sha 698d4c6c1c73e0c86d52dd79db259bd8280a019f

Update Methods by implementing real values (#43104)

view details

Lemon Marie Garrett

commit sha e0faeb6bbeff3ef49e089a80fc2efcff863eb112

update pagination proptypes according to updated docs for react-native-snap-carousel (#43097)

view details

Vincenzo Chianese

commit sha 819ef44294850bc27ab011f6c60f302836e75288

fix: security in OAS2 is a dictionary of string (#43105)

view details

CarlosKlapp

commit sha be266a9ccac43d043c683c725a04cb14b4b78297

[Node] (Crypto) {KeyObject} V12 add unit test symmetricKeySize (#43109) Related to PR #43052

view details

Piotr Błażejewicz (Peter Blazejewicz)

commit sha f633bcdf259a837575f13a1159de54f7c0245664

feat(pixelmatch): update to version 5.1 (#43096) - new `diffMask` option - rewrite default value documentation for options - test amend - apply DT Prettier styling to source files https://github.com/mapbox/pixelmatch/compare/v5.0.0...v5.1.0 Thanks!

view details

wslaghekke

commit sha 8dbf6731f0d336ac1d4bf33049e51d31e68a591c

Add missing showGroundAtmosphere to Globe (#43110)

view details

Piotr Błażejewicz (Peter Blazejewicz)

commit sha 63af21defcf90ddf78023d86247501b02c027851

feat(karma-material-reporter): new type definition (#42993) - type definition for v1.1 - tests https://github.com/ameerthehacker/karma-material-reporter Thanks!

view details

Ramin B

commit sha 53c87a1624eba7b7ef572930c7a3b05552a639cd

Allow `null` in `CompletionCallback` type (#42802) The current `CompletionCallback` type doesn't allow you to set `error: null`, which is required if you don't have an actual error. This change allows for that

view details

Louis-Dominique Dubeau

commit sha 2c58b77f66fa22553ce81db73a4f94d88e921677

[terminal-kit]: fix the typings for Callback and inputField (#42804) * Fix the typing of Callback. The previous typing for `Callback` makes no sense. If someone used a callback that had both attributes (which is the most common case), then `err` would be typed as `undefined` inside the callback. However, whether or not `err` is undefined is not determined by the number of parameters set on the callback. The previous typing would have been correct if there was a guaranteed that when the callback has two parameters, the first one is necessarily `undefined`. But there is no such guarantee. If an error happened, then the first parameter is **not** undefined. * Fix the return values of inputField. The Promise was declared to resolve to `boolean` which is absolutely incorrect. `inputField`'s promise resolves to a string. If cancelation was allowed the user canceled (hit escape), then the final value may be undefined this is true both for the promise and the callback. * Make the promise mandatory on the return value of inputField. The promise on the object returned by inputField is always present. * Fix the return value of inputField to always return a value. inputField *always* returns an object, *irrespective* of whether a callback is passed. The object is more complex than currently defined but I only use the `promise` field on it and have no inclination to figure the whole object's structure. Someone else will have to figure it out. * Drop the explicit typings on the callback parameters. They override, and consequently they obscure, the typings that are provided by the definition files. * Test that abort field is present on return value of inputField. terminal-kit *always* provides it, callback or no callback. * The new typings make input be possibly undefined.

view details

Alex Jerabek

commit sha 32ea5fc74dfc237ad888790bff9e767f6677e7d4

[office-js-preview] Updating office-js-preview with the latest PivotFilter APIs (#43119) * Removing prompt verbage from selection binding options * Update office-js-preview withthe latest from the CDN

view details

Marcelo Castagna

commit sha 5e3bb0afa927584116a5772f2374a5eea3c31842

Add missing methods for Signale 1.4 (#42798) * missing number array test * fix whitespace * fix comment alignment Co-authored-by: Castagna, Marcelo Sebastian <MCastagna@srt.gov.ar>

view details

Kevin Hinterlong

commit sha ccd1e018469ffc931e8971afabaff02885e33982

new @ember/controller transitionToRoute method (#42808) Co-authored-by: Kevin Hinterlong <hinterlong@verizonmedia.com>

view details

Piotr Błażejewicz (Peter Blazejewicz)

commit sha 5ed9dc7696c4c14845c5ddae3966beac690c9588

update(browser-resolve): align with v1.11 (#42807) - add version to TS Header - align package configuration - align package definition with the orignal package details: https://github.com/defunctzombie/node-browser-resolve/blob/master/index.js - remove 3-slashes reference as duplicate - minor refine for `callback` `error` parameter (can be null as per usage) - update authors - update tests https://github.com/defunctzombie/node-browser-resolve#api Thanks!

view details

Chris Wiggins

commit sha cbeb5ba463863f25927aa86e129fd3045c4fa3b7

Updates tar-fs to include pack option (#42813) * Updates tar-fs to include pack option * Switch away from require * Remove explicit typescript version

view details

Tim

commit sha c65e5f754929f85cd42565a2ddf25da41c1ae71f

ssh2: Fix callback types (#42823) * Fix callback types These were half-fixed recently (in my local version `err` cannot be `undefined`). But if you check the code the second parameter to all the callbacks should be `| undefined` too. I haven't checked all these callbacks exhaustively. I also changed the SFTP callbacks from `any` to `Error | undefined`. Again I haven't fully analysed the entire code but it seems likely that this is the correc type. Also changed some fields to use `?` which is a bit more idiomatic, and fixed the type of the `getConnections` callback (according to the Node typings - who knows if those are correct?). * Missed one parameter

view details

Ruby Quail

commit sha f92c1d4227cb7fc02155c870249ac06ff972397f

adding types for b-spline package (#43007) * add b-spline types Signed-off-by: Ruby Quail <ruby@rubyquail.design> * Update index.d.ts * Update index.d.ts * fixed an error Signed-off-by: Ruby Quail <ruby@rubyquail.design> * fix tslint Signed-off-by: Ruby Quail <ruby@rubyquail.design> * export = Signed-off-by: Ruby Quail <ruby@rubyquail.design> * fixed export syntax Signed-off-by: Ruby Quail <ruby@rubyquail.design> * require format Signed-off-by: Ruby Quail <ruby@rubyquail.design> * missed a semicolon Signed-off-by: Ruby Quail <ruby@rubyquail.design>

view details

Adam Zerella

commit sha 9582dc2bb785785d56b99c60af00ac6f9d1cba5c

Add type def for clamp (#43011) Co-authored-by: Adam Zerella <adamzerella@users.noreply.github.com>

view details

Adam Zerella

commit sha 3cbb889216a94f7cb0b90e0de8de8d1fa5fd2a17

Add type definitions for math-expression-evaluator (#43009) Co-authored-by: Adam Zerella <adamzerella@users.noreply.github.com>

view details

Josh Holmer

commit sha c6b8f6a5195440fa5d39949a91bd570cdd52c5af

Add rc-steps definition (#43015)

view details

push time in 2 months

PR opened redwoodjs/redwood

enable typescript services and sdl

What

Enables the generation of sdl and service files in TypeScript. Uses the --typescript boolean flag passed to generate service and generate sdl. Defaults to false

Testing

Tested locally with redwood-tools. Is there a way of testing via unit tests?

+19 -10

0 comment

3 changed files

pr created time in 2 months

create barnchjmreidy/redwood

branch : convert_api_to_ts

created branch time in 2 months

Pull request review commentredwoodjs/redwood

Add @redwoodjs/auth package

+import type { default as Netlify } from 'gotrue-js'+import type { User as NetlifyUser } from 'gotrue-js'+import type { Auth0Client as Auth0 } from '@auth0/auth0-spa-js'++// TODO: Can also return an Auth0 user which doesn't have a definition.+// eslint-disable-next-line @typescript-eslint/no-empty-interface+export interface Auth0User {}+export type { NetlifyUser }++export interface AuthClient {+  restoreAuthState?(): void | Promise<any>+  login(options?: any): Promise<any>

I see what you're saying. Even if you mark options as optional with a type, that still implies the Auth0 version would accept the options arg.

You could do something like this:

export interface AuthClient {
  restoreAuthState?(): void | Promise<any>
  login(): Promise<any>
  logout(): void | Promise<void>
}

export type AuthClientAuth0 = AuthClient

export interface AuthClientNetlify extends Omit<AuthClient, 'login'> {
  login(options: {
    email: string
    password: string
    remember?: boolean
  }): Promise<NetlifyUser>
  client: Netlify
}

...only problem there is that Netlify Auth Clients will need to do something like (client as AuthClientNetlify).login(args)

but it's possible a consumer would've already cast it anyway

peterp

comment created time in 2 months

Pull request review commentredwoodjs/redwood

Add @redwoodjs/auth package

 const Route = () => {   return null } +const PrivateRoute = (props) => {+  return <Route private {...props} />+}++const PrivatePageLoader = ({ useAuth, children }) => {+  const { loading, authenticated } = useAuth()++  if (loading) {+    return null+  }++  if (authenticated) {+    return children+  } else {+    // TODO: Should we navigate away, exec a function?

Good point on nested routes, top level prop fn makes sense.

I wonder if we could have a default functionality that also shows a NotAuthorized page, similar to the existing NotFound and FatalError pages.

peterp

comment created time in 2 months

Pull request review commentredwoodjs/redwood

Add @redwoodjs/auth package

+import { useState, useEffect } from 'react'++import { GraphQLProvider, createGraphQLClient } from 'src/graphql'++const useAuthStub = () => ({ loading: false, authenticated: false })++/**+ * Redwood's Provider ties together our authentication and Apollo's GraphQL Provider+ * when you pass the `useAuth` hook from `@redwoodjs/auth`+ * The authentication token is added to the headers of the GraphQL client.+ */+const RedwoodProvider = ({ useAuth = useAuthStub, children }) => {+  const { loading, authenticated, getToken, type } = useAuth()+  const [authToken, setAuthToken] = useState()++  useEffect(() => {+    if (authenticated) {+      getToken().then((token) => setAuthToken(token))+    }+  }, [authenticated, getToken])++  // This really sucks because rendering is completely blocked whilst we're+  // restoring authentication.+  if (loading) {+    return null+  }+  // If we have an authToken then modify the headers of the GraphQL client.+  const client = authToken+    ? createGraphQLClient({+        headers: {+          // Used by `api` to determine the auth type.+          'X-Redwood-Auth-Type': type,

Right on! Totally agreed. Something to figure out if it becomes a pain in the future.

peterp

comment created time in 2 months

Pull request review commentredwoodjs/redwood

Add @redwoodjs/auth package

+import { useState, useEffect } from 'react'++import { GraphQLProvider, createGraphQLClient } from 'src/graphql'++const useAuthStub = () => ({ loading: false, authenticated: false })++/**+ * Redwood's Provider ties together our authentication and Apollo's GraphQL Provider+ * when you pass the `useAuth` hook from `@redwoodjs/auth`+ * The authentication token is added to the headers of the GraphQL client.+ */+const RedwoodProvider = ({ useAuth = useAuthStub, children }) => {+  const { loading, authenticated, getToken, type } = useAuth()+  const [authToken, setAuthToken] = useState()++  useEffect(() => {+    if (authenticated) {+      getToken().then((token) => setAuthToken(token))+    }+  }, [authenticated, getToken])++  // This really sucks because rendering is completely blocked whilst we're+  // restoring authentication.+  if (loading) {+    return null+  }+  // If we have an authToken then modify the headers of the GraphQL client.+  const client = authToken+    ? createGraphQLClient({+        headers: {+          // Used by `api` to determine the auth type.+          'X-Redwood-Auth-Type': type,

Would be nice if we had shared constants across web and api

peterp

comment created time in 2 months

Pull request review commentredwoodjs/redwood

Add @redwoodjs/auth package

+import { useState, useEffect } from 'react'++import { GraphQLProvider, createGraphQLClient } from 'src/graphql'++const useAuthStub = () => ({ loading: false, authenticated: false })++/**+ * Redwood's Provider ties together our authentication and Apollo's GraphQL Provider+ * when you pass the `useAuth` hook from `@redwoodjs/auth`+ * The authentication token is added to the headers of the GraphQL client.+ */+const RedwoodProvider = ({ useAuth = useAuthStub, children }) => {+  const { loading, authenticated, getToken, type } = useAuth()+  const [authToken, setAuthToken] = useState()++  useEffect(() => {+    if (authenticated) {+      getToken().then((token) => setAuthToken(token))+    }+  }, [authenticated, getToken])++  // This really sucks because rendering is completely blocked whilst we're+  // restoring authentication.+  if (loading) {

Hmm interesting. What if we wrapped the restoreAuth call in a requestIdleCallback here? https://github.com/redwoodjs/redwood/pull/497/files#diff-750ebfc0b1cca76d488951096093372dR55

peterp

comment created time in 2 months

Pull request review commentredwoodjs/redwood

Add @redwoodjs/auth package

+import { useState, useEffect } from 'react'++import { GraphQLProvider, createGraphQLClient } from 'src/graphql'++const useAuthStub = () => ({ loading: false, authenticated: false })++/**+ * Redwood's Provider ties together our authentication and Apollo's GraphQL Provider+ * when you pass the `useAuth` hook from `@redwoodjs/auth`+ * The authentication token is added to the headers of the GraphQL client.

💯

peterp

comment created time in 2 months

Pull request review commentredwoodjs/redwood

Add @redwoodjs/auth package

 const Route = () => {   return null } +const PrivateRoute = (props) => {+  return <Route private {...props} />+}++const PrivatePageLoader = ({ useAuth, children }) => {+  const { loading, authenticated } = useAuth()++  if (loading) {+    return null+  }++  if (authenticated) {+    return children+  } else {+    // TODO: Should we navigate away, exec a function?

Exec a function sounds good. Thinking out loud, maybe pages could export an unauthorized render func? Similar to how Cells work?

peterp

comment created time in 2 months

Pull request review commentredwoodjs/redwood

Add @redwoodjs/auth package

 const Route = () => {   return null } +const PrivateRoute = (props) => {+  return <Route private {...props} />

Dig it 💯

peterp

comment created time in 2 months

Pull request review commentredwoodjs/redwood

Add @redwoodjs/auth package

+{+  "extends": "../../tsconfig.compilerOption.json",+  "compilerOptions": {+    "tsBuildInfoFile": "dist/tsconfig.tsbuildinfo",+    "baseUrl": ".",+    "outDir": "dist",+    "rootDir": "src",+    // gotrue-js does not return types for `removeSavedSession` and `recoverSession`+    "noImplicitAny": false,

Boo. Could we extend with a .d.ts module? Alternatively I'd be happy to contribute by adding those types upstream to gotrue

peterp

comment created time in 2 months

Pull request review commentredwoodjs/redwood

Add @redwoodjs/auth package

+{

👏 👏 👏 👏 👏 TYPESCRIPT woo hoo!

peterp

comment created time in 2 months

Pull request review commentredwoodjs/redwood

Add @redwoodjs/auth package

+import type { default as Netlify } from 'gotrue-js'+import type { User as NetlifyUser } from 'gotrue-js'+import type { Auth0Client as Auth0 } from '@auth0/auth0-spa-js'++// TODO: Can also return an Auth0 user which doesn't have a definition.+// eslint-disable-next-line @typescript-eslint/no-empty-interface+export interface Auth0User {}+export type { NetlifyUser }++export interface AuthClient {+  restoreAuthState?(): void | Promise<any>+  login(options?: any): Promise<any>+  logout(): void | Promise<void>+  getToken(): Promise<null | string>+  currentUser(): Promise<null | Auth0User | NetlifyUser>+  client: SupportedAuthClients+  type: SupportedAuthTypes+}++export type AuthClientAuth0 = AuthClient++export interface AuthClientNetlify extends AuthClient {+  login(options: {+    email: string+    password: string+    remember?: boolean+  }): Promise<NetlifyUser>+  client: Netlify+}++export type SupportedAuthClients = Auth0 | Netlify+export type SupportedAuthTypes = 'auth0' | 'netlify'++const mapAuthClientAuth0 = (client: Auth0): AuthClientAuth0 => {+  return {+    type: 'auth0',+    client,+    restoreAuthState: async () => {+      if (window.location.search.includes('code=')) {+        const { appState } = await client.handleRedirectCallback()+        window.history.replaceState(+          {},+          document.title,+          appState && appState.targetUrl+            ? appState.targetUrl+            : window.location.pathname+        )+      }+    },+    login: async () => client.loginWithRedirect(),+    logout: () => client.logout(),+    getToken: async () => client.getTokenSilently(),+    currentUser: async () => {+      const user = await client.getUser()+      return user || null+    },+  }+}++const mapAuthClientNetlify = (client: Netlify): AuthClientNetlify => {+  return {+    type: 'netlify',+    client,+    login: async ({ email, password, remember }) =>+      client.login(email, password, remember),+    logout: async () => {+      const user = await client.currentUser()+      return user?.logout()+    },+    getToken: async () => {+      const user = await client.currentUser()+      return user?.jwt() || null+    },+    currentUser: async () => client.currentUser(),+  }+}++export const createAuthClient = (+  client: SupportedAuthClients,+  type: SupportedAuthTypes+): AuthClient => {+  switch (type) {

Same comment on enum versus types as above

peterp

comment created time in 2 months

Pull request review commentredwoodjs/redwood

Add @redwoodjs/auth package

+import type { default as Netlify } from 'gotrue-js'+import type { User as NetlifyUser } from 'gotrue-js'+import type { Auth0Client as Auth0 } from '@auth0/auth0-spa-js'++// TODO: Can also return an Auth0 user which doesn't have a definition.+// eslint-disable-next-line @typescript-eslint/no-empty-interface+export interface Auth0User {}+export type { NetlifyUser }++export interface AuthClient {+  restoreAuthState?(): void | Promise<any>+  login(options?: any): Promise<any>

Add TODO to add options typing

peterp

comment created time in 2 months

Pull request review commentredwoodjs/redwood

Add @redwoodjs/auth package

 import { GraphQLDate, GraphQLTime, GraphQLDateTime } from 'graphql-iso-date' import apiPackageJson from 'src/../package.json'  /**- * This adds scalar types for dealing with Date, Time, and DateTime, and adds a root- * `Query` type which is needed to start the GraphQL server on a fresh install.+ * This adds scalar types for dealing with Date, Time, and DateTime,+ * and adds a root Query type which is needed to start the GraphQL server on a+ * fresh install.  */ export const schema = gql`

Just a note of thankfulness for the consistently solid documentation!

peterp

comment created time in 2 months

Pull request review commentredwoodjs/redwood

Add @redwoodjs/auth package

+import type { APIGatewayProxyEvent, Context } from 'aws-lambda'+import fetch from 'node-fetch'++export type SupportedAuthTypes = 'auth0' | 'netlify'++type NetlifyClientContext = Context & {+  clientContext: {+    user?: any+  }+}++// TODO: Define what an Auth0 user looks like.+const REDWOOD_AUTH_TYPE_HEADER = 'x-redwood-auth-type'++export const getUserFromContext = async ({+  event,+  context,+}: {+  event: APIGatewayProxyEvent+  context: NetlifyClientContext+}) => {+  const type = event?.headers[REDWOOD_AUTH_TYPE_HEADER] as SupportedAuthTypes+  switch (type) {

If using an enum above for SupportAuthTypes, could use something like https://github.com/UselessPickles/ts-enum-util here

peterp

comment created time in 2 months

Pull request review commentredwoodjs/redwood

Add @redwoodjs/auth package

+import type { APIGatewayProxyEvent, Context } from 'aws-lambda'+import fetch from 'node-fetch'++export type SupportedAuthTypes = 'auth0' | 'netlify'

What do you think of using an enum here?

peterp

comment created time in 2 months

Pull request review commentredwoodjs/redwood

Add @redwoodjs/auth package

+import type { APIGatewayProxyEvent, Context } from 'aws-lambda'+import fetch from 'node-fetch'++export type SupportedAuthTypes = 'auth0' | 'netlify'++type NetlifyClientContext = Context & {+  clientContext: {+    user?: any+  }+}++// TODO: Define what an Auth0 user looks like.+const REDWOOD_AUTH_TYPE_HEADER = 'x-redwood-auth-type'++export const getUserFromContext = async ({+  event,+  context,+}: {+  event: APIGatewayProxyEvent+  context: NetlifyClientContext

If this is going to be generic across solutions, might as well create a new generic context here (even if it's just a wrapper for NetflifyClientContext)

peterp

comment created time in 2 months

issue commentredwoodjs/redwood

BYO Components to Scaffold Generator

Super naive implementation here just to play with ergonomics https://github.com/redwoodjs/redwood/pull/489/files

(related engine package: https://github.com/jmreidy/redwood-scaffold-engine-test)

jmreidy

comment created time in 2 months

PR opened redwoodjs/redwood

spiking custom engine

Used in combination with https://github.com/jmreidy/redwood-scaffold-engine-test

+35 -17

0 comment

1 changed file

pr created time in 2 months

create barnchjmreidy/redwood

branch : spiking_custom_engine

created branch time in 2 months

fork jmreidy/redwood

Bringing full-stack to the JAMstack.

https://redwoodjs.com

fork in 2 months

create barnchjmreidy/redwood-scaffold-engine-test

branch : master

created branch time in 2 months

created repositoryjmreidy/redwood-scaffold-engine-test

created time in 2 months

issue commentredwoodjs/redwood

BYO Components to Scaffold Generator

I wanted to report back on an initial spike on this.

Actually switching out the scaffold templates is easy. All that really needs to be switched are components, layouts, and assets. The approach I spiked was to add an additional flag, --engine, which would point to a template engine package. For example, --engine chakra would look up a package of redwood-scaffold-engine-chakra. This package would contain alternate assets, components, and layouts folders.

The problem with this approach is the intermingling of logic code and scaffold template code. This is particularly acute with Cells. I think there's a serious risk of template engines getting out of sync with redwood scaffolding.

My proposal would be to hold on enabling alternate template engines until there's confidence that the generated code is fairly stable.

jmreidy

comment created time in 2 months

issue openedredwoodjs/redwood

BYO Components to Scaffold Generator

As noted in discussion here, while the default scaffold templates are pretty great, there's massive divergence in component library preference in the community. Ideally, scaffolders could generate useful code while enabling users to bring their own component library of choice.

Idea

Enable specification of --template CLI arg, for example --template charka, which would look for the package redwood-scaffold-component-chakra. If that package exists, loads template files from that package instead of default location.

Initial Concerns

Keeping template packages in sync with rw package version seems like a pain, esp in early days.

Todo

  • [ ] Spike the idea above to see if it's reasonable ... profit?

created time in 2 months

more