profile
viewpoint
Luca Barone cloud-walker translated.com Rome

cloud-walker/gulp-gettext 5

Compile .po files to .mo

cloud-walker/client-firebase 2

Npm package to use firebase thanks to browserify

cloud-walker/an-old-hope-syntax-atom 0

Atom theme inspired by a galaxy far far away...

cloud-walker/atom-an-old-hope-remastered-syntax 0

A rewritten version of the original an-old-hope syntax

cloud-walker/browserify-gulp-bundler 0

My personal solution for browsery + gulp use

cloud-walker/client-backfire 0

Npm package to use backfire thanks to browserify!

issue openedfile-icons/icons

Add support for Snowpack config files

image

This is the tool: https://www.snowpack.dev/

Here the config files supported: https://www.snowpack.dev/#config-files

created time in 6 days

issue openedfile-icons/vscode

Add support for snowpack config files

image

This is the tool: https://www.snowpack.dev/

created time in 6 days

issue commentsindresorhus/np

ERR 400 2FA when no 2fa is configured on account/repo

The actual --no-2fa support version seems to be 6.4:

https://github.com/sindresorhus/np/releases/tag/v6.4.0

badluck13

comment created time in 10 days

startedyannickcr/eslint-plugin-react

started time in 12 days

startedfacebook/react

started time in 12 days

startedGoogleChrome/lighthouse

started time in 12 days

startedstorybookjs/presets

started time in 12 days

startedtesting-library/jest-dom

started time in 12 days

startedtesting-library/dom-testing-library

started time in 12 days

startedtreosh/lighthouse-ci-action

started time in 12 days

startedUX-and-I/storybook-design-token

started time in 12 days

startedtannerlinsley/react-query-devtools

started time in 12 days

startedtannerlinsley/react-query

started time in 15 days

startedReactTraining/react-router

started time in 21 days

startedstorybookjs/storybook

started time in 21 days

startedtannerlinsley/react-ranger

started time in a month

startedschollz/croc

started time in a month

created repositorycloud-walker/foo3

created time in a month

created repositorycloud-walker/foo2

created time in a month

created repositorycloud-walker/foo

created time in a month

startedkvz/locutus

started time in 2 months

push eventcloud-walker/express-demo

Luca Barone

commit sha 8eac6e1c572709511d72e3c4748724b6c2127a38

:bug: Fix wront koa-router import (#8)

view details

Luca Barone

commit sha 999d488ccf520432639709aee45b227589c4c41a

Introduce lint-staged for formatting, linting and testing

view details

push time in 2 months

delete branch cloud-walker/express-demo

delete branch : fix-wrong-koa-import

delete time in 2 months

push eventcloud-walker/express-demo

Luca Barone

commit sha 8eac6e1c572709511d72e3c4748724b6c2127a38

:bug: Fix wront koa-router import (#8)

view details

push time in 2 months

PR opened cloud-walker/express-demo

Reviewers
:sparkles: Lint staged, closes #4

This PR introduces lint-staged, a package to automate formatting, linting & testing of staged files before committing, so that all the code that is modified in local environments is always checked before reaching remote!

+619 -2

0 comment

6 changed files

pr created time in 2 months

create barnchcloud-walker/express-demo

branch : lint-staged

created branch time in 2 months

create barnchcloud-walker/express-demo

branch : fix-wrong-koa-import

created branch time in 2 months

issue closedcloud-walker/express-demo

Add format script using prettier

We should add a format script that launch prettier to format all the files!

closed time in 2 months

cloud-walker

issue commentcloud-walker/express-demo

Add format script using prettier

closed by #6

cloud-walker

comment created time in 2 months

issue commentcloud-walker/express-demo

Add `lint` script using `eslint`

Closed by #6

cloud-walker

comment created time in 2 months

delete branch cloud-walker/express-demo

delete branch : koajs

delete time in 2 months

push eventcloud-walker/express-demo

Giorgio Pagliaro

commit sha 9f28d2516128b6573880ed4ad5a18f59ff145949

Koajs + Eslint +Prettier (#6) * moved to koajs from express * autoreview * prefix in math router * eslint * styling * prettier * prettier * getRouter * promise in start server

view details

push time in 2 months

PR merged cloud-walker/express-demo

Reviewers
Koajs + Eslint +Prettier
+885 -278

0 comment

11 changed files

Giorgio27

pr closed time in 2 months

Pull request review commentcloud-walker/express-demo

Koajs + Eslint

+{+  "env": {+    "browser": true,

Perché ti server browser come env? Non siamo dentro node in teoria? 🤔

Giorgio27

comment created time in 2 months

Pull request review commentcloud-walker/express-demo

Koajs + Eslint

+{+  "env": {+    "browser": true,+    "es2021": true+  },+  "extends": "eslint:recommended",+  "parserOptions": {+    "ecmaVersion": 12,+    "sourceType": "module"+  },+  "rules": {+    "indent": ["error", 2],+    "linebreak-style": ["error", "unix"],

Questo lasciamolo fare a prettier #3

Giorgio27

comment created time in 2 months

Pull request review commentcloud-walker/express-demo

Koajs + Eslint

+{+  "env": {+    "browser": true,+    "es2021": true+  },+  "extends": "eslint:recommended",+  "parserOptions": {+    "ecmaVersion": 12,+    "sourceType": "module"+  },+  "rules": {+    "indent": ["error", 2],+    "linebreak-style": ["error", "unix"],+    "quotes": ["error", "single"],+    "semi": ["error", "never"]

Questo lasciamolo fare a prettier #3

Giorgio27

comment created time in 2 months

Pull request review commentcloud-walker/express-demo

Koajs + Eslint

-import express from 'express'-import { getMathRoutes } from './math'--export const getRoutes = () => {

Il motivo per cui Kent aveva fatto questa funzione getRoutes è per motivi di riproducibilità, e testing, così come hai rifattorizzato il modulo, dovrebbe funzionare lo stesso, ma così il primo import a routes/index.js scatenerà immediatamente la creazione del router e dal quel momento in poi si avrà sempre la stessa reference del router (che potrebbe essere quello che vogliamo eh 🤔 )

Giorgio27

comment created time in 2 months

Pull request review commentcloud-walker/express-demo

Koajs + Eslint

+{+  "env": {+    "browser": true,+    "es2021": true+  },+  "extends": "eslint:recommended",+  "parserOptions": {+    "ecmaVersion": 12,+    "sourceType": "module"+  },+  "rules": {+    "indent": ["error", 2],

Questo lasciamolo fare a prettier #3

Giorgio27

comment created time in 2 months

Pull request review commentcloud-walker/express-demo

Koajs + Eslint

-import express from 'express'-import { getMathRoutes } from './math'--export const getRoutes = () => {-  const router = express.Router()-  router.use('/math', getMathRoutes())-  return router-}+import Router from 'koa-router'+import mathRouter from './math'

Quando possibile preferisco esporre i moduli facendo "name exports", sono meglio per vari motivi:

  • è meno facile dimenticarsi di dare il nome alle funzioni che esporti
  • essendo tutti named, gli editors tipo vscode fanno meno fatica a ritrovare i moduli con l'intellisense

Ho recuperato al volo un articolo al riguardo, non sono sicuro fosse quello che lessi io a suo tempo... https://humanwhocodes.com/blog/2019/01/stop-using-default-exports-javascript-module/

Giorgio27

comment created time in 2 months

Pull request review commentcloud-walker/express-demo

Koajs + Eslint

+{+  "env": {+    "browser": true,+    "es2021": true+  },+  "extends": "eslint:recommended",+  "parserOptions": {+    "ecmaVersion": 12,+    "sourceType": "module"+  },+  "rules": {+    "indent": ["error", 2],+    "linebreak-style": ["error", "unix"],+    "quotes": ["error", "single"],

Questo lasciamolo fare a prettier #3

Giorgio27

comment created time in 2 months

Pull request review commentcloud-walker/express-demo

Koajs + Eslint

     "@babel/core": "^7.11.5",     "@babel/preset-env": "^7.11.5",     "@babel/register": "^7.11.5",-    "express": "^4.17.1",-    "express-async-errors": "^3.1.1",+    "koa": "^2.13.0",+    "koa-router": "^9.4.0",

Il pacchetto ora si chiama @koa/router (https://www.npmjs.com/package/@koa/router)

Da qualche anno esiste questa feature di npm che si chiama packages scope, quindi puoi raggruppare una serie di pacchetti simili sotto ad un unico namespace (in questo caso @koa/<subpackage>)

Giorgio27

comment created time in 2 months

PullRequestReviewEvent
PullRequestReviewEvent

issue openedcloud-walker/express-demo

Migrate to `yarn` over `npm` as package manager

Translated devs uses yarn as main package manager, so it could be cool to learn using it over bare npm.

It should be easy, just install yarn, and switch from package-lock.json to yarn.lock

created time in 2 months

issue openedcloud-walker/express-demo

Add `lint` script using `eslint`

created time in 2 months

issue openedcloud-walker/express-demo

Add format script using prettier

We should add a format script that launch prettier to format all the files!

created time in 2 months

delete branch cloud-walker/express-demo

delete branch : jest

delete time in 2 months

push eventcloud-walker/express-demo

Giorgio Pagliaro

commit sha 7aef7b7f89b1049befb29b5206574121c6f0e6d0

tests on start server (#2) * test on start server * silent logger in spec, styling * logger test

view details

push time in 2 months

PR merged cloud-walker/express-demo

tests on start server
+102 -10

0 comment

6 changed files

Giorgio27

pr closed time in 2 months

PullRequestReviewEvent

Pull request review commentcloud-walker/express-demo

tests on start server

+import { startServer } from './start'+import supertest from 'supertest'+import logger from 'loglevel'++const port = 3002+let server++beforeEach(async () => {+  server = await startServer({ port })+})++afterEach(async () => {+  await server.close()+})

In teoria, se stai seguendo la struttura dei describe, questi due andrebbero nel blocco di codice del describe corrispondente, a meno che non vuoi che questi lifecycle vengano triggerati in tutti i describe potenziali di questo test 🤔

Giorgio27

comment created time in 2 months

PullRequestReviewEvent

Pull request review commentcloud-walker/express-demo

tests on start server

 export const startServer = ({ port = process.env.PORT } = {}) => {   app.use('/api', getRoutes())    const errorMiddleware = (error, req, res, next) => {-    logger.info(error)     if (res.headersSent) {       next(error)     } else {-      logger.error(error)

Questo doveva esserci (e ho paura che ti rompa il test nel senso che partirà il console.error), l'unico modo che conosco per non sporcare l'output dei test è:

describe('sadsadas', () => {
  it('ciao', () => {
    const originalConsoleError = console.error
    console.error = jest.fn()

    // scrivi il tuo test qui

    // a un certo punto puoi fare expect sul console.error mockato con jest.fn
    expect(console.error).toHaveBeenCalled()
    // oppure
    expect(console.error).toHaveBeenCalledWith('qualcosa')

    console.error = originalConsoleError
  })
})
Giorgio27

comment created time in 2 months

Pull request review commentcloud-walker/express-demo

tests on start server

 export const startServer = ({ port = process.env.PORT } = {}) => {     }   } +  app.get('/ping/success', (req, res) => res.json({ message: 'pong' }))

casco anche io spesso nella tentazione di tornare un espressione invece che il blocco di codice nelle arrow functions, ma attenzione che così rischi di tornare cose che a volte non vorresti, personalmente quando ho il dubbio, apro il blocco di codice senza return, così impongo undefined come valore di ritorno.

In questo caso non so res.json(...) se torna qualcosa (e vabè, in questo caso specifico potrebbe non fregarci nulla comunque, essendo un handler di express...)

Giorgio27

comment created time in 2 months

Pull request review commentcloud-walker/express-demo

tests on start server

+import { startServer } from './start'+import supertest from 'supertest'+const port = 3002

metterei port vicino a server, o comunque non lo raggrupperei con gli import

Giorgio27

comment created time in 2 months

PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent

create barnchcloud-walker/express-demo

branch : master

created branch time in 2 months

MemberEvent

created repositorycloud-walker/express-demo

An example minimal expressjs setup for teaching purposes

created time in 2 months

startedmikecao/umami

started time in 2 months

issue commentrexxars/react-markdown

react-markdown doesn't handle numeric "source" props

I don't remember the precise motivation behind my request (I asked more than a year a ago), but I can guess that was because I was implementing a custom CMS system, that was using react-markdown to handle content, that was out of my control (headless CMS).

That content could be a plain number sometimes.

cloud-walker

comment created time in 3 months

issue commentchakra-ui/chakra-ui

[Theme/GlobalStyle API] Any supposedly global style gets scoped to body

I guess this is the problem:

https://github.com/chakra-ui/chakra-ui/blob/59b2496be148f668df216e20bbf7c496468d5765/packages/system/src/providers.tsx#L93

ljosberinn

comment created time in 3 months

more