Coding Automation Lesson #1
From "Programadores Anónimos"
Welcome to my talk
# INTRODUCITON
When I started to coding
# INTRODUCITON
I realized that I was rewriting the same sentences everyday.
# INTRODUCITON
I was solving similar problems.
Sometimes, I was forced to return to my search engine and visit those purple results to find answers to the same questions.
# INTRODUCITON
I’ll talk about some automation tools that will help you focus on the problem with fewer keystrokes.
Boilerplate
Refers to a set of static code that can be used as a starting point.
ng, cra, npx, vite*
Snippet
Similar to boilerplate but for a small amount of code.
emmet, vsCode, live templates Jet Brains
Linter
A set of analyzing tools that alert the user about possible problems with their source code during development time.
# DEFINITIONS
How can I generate the boilerplate to start a new project, find an appropriate solution and spend less time in the search engine?
# SUMMARY
Stop wasting time reviewing code standards in a PR.
Take some time to setup an appropriate set of tools
# CODE STANDARDS
Source: Google JavaScript Style Guide
# CODE STANDARDS
Source: Google JavaScript Style Guide
Automate the rules with Eslint
{
"Function Component": {
"prefix": "fc",
"body": [
"interface $1Props {",
"\t$2",
"}",
" ",
"const $1: FunctionComponent<$1Props> = ($3) => {",
"\treturn ( $0 );",
"}",
" ",
"export default $1;"
],
"description": "Function Component"
}
}
# HOW TO CREATE SNIPPETS
Create the snippets with common problems you have.
Context + Typescript
Create your own context with placeholder types.
Responsive grid CSS
CSS snippet to create a grid Layout, including the HTML container.
Async Testing
Initial boilerplate to test your async component, including the setup for a specific framework.
# CHAPTER 2
import {Command} from '@oclif/core'
export default class World extends Command {
static description = 'Say hello world'
static examples = [
`<%= config.bin %> <%= command.id %>
hello world! (./src/commands/hello/world.ts)`,
]
static flags = {}
static args = []
async run(): Promise<void> {
this.log('hello world! (./src/commands/hello/world.ts)')
}
}
# YOUR OWN CLI-TOOL
oclif is an open source framework for building a command line interface (CLI) in Node.js
You can create multiples files, or edit the existing ones.
Fake data
Create mock data to test your components
Add a component
Add a new component of your visual library within a specific file.
Create new
Add files to the appropriate folder within your project scaffolding, including some boilerplate.
# YOUR OWN CLI-TOOL
# GIT HOOKS
Early validation is the best way to guarantee quality code
Auto format
Auto format the code before syncing up with the remote.
Commit messages
Help the developer to create the commit message.
Testing
Run unit testing, visual testing, or/and regression testing before allowing the merge process.
# GIT HOOKS
# AI TOOLS
Be confident about the new generation of tools. Let the AI help your team
Documentation
Automatic component documentation using an AI asistant.
Fake data
Create real fake data using an AI asistant.
Onboarding
Build an AI that help to onboard new people using data about the Company and the source code.
# AI TOOLS
# DOCUMENTATION
Create your personal database with code you create
Check your personal database before using the search engine
Blogging
Create a blog explain how you solve different problems.
Private repository *
Organize your solution within a private repository.
Journey Log
Document your mental process in a journal; this information can be helpful in the future.
# DOCUMENTATION
* Be careful, it could be agains the law
Follow me on:
@thecapnews
/in/thecap-developer/
/@programadoresanonimos
/programadoresanonimos
/c/programadoresanonimos