mirror of
https://github.com/theoludwig/theoludwig.git
synced 2024-12-08 00:44:30 +01:00
feat(posts): add mistakes-as-junior-developer
This commit is contained in:
parent
94212f9b5c
commit
919ebd5f3e
@ -11,6 +11,7 @@
|
||||
},
|
||||
"rules": {
|
||||
"prettier/prettier": "error",
|
||||
"unicorn/prefer-node-protocol": "off"
|
||||
"unicorn/prefer-node-protocol": "off",
|
||||
"@typescript-eslint/no-misused-promises": "off"
|
||||
}
|
||||
}
|
||||
|
2
.github/workflows/analyze.yml
vendored
2
.github/workflows/analyze.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
||||
language: ['javascript']
|
||||
|
||||
steps:
|
||||
- uses: 'actions/checkout@v2.4.0'
|
||||
- uses: 'actions/checkout@v3.0.0'
|
||||
|
||||
- name: 'Initialize CodeQL'
|
||||
uses: 'github/codeql-action/init@v1'
|
||||
|
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@ -10,10 +10,10 @@ jobs:
|
||||
build:
|
||||
runs-on: 'ubuntu-latest'
|
||||
steps:
|
||||
- uses: 'actions/checkout@v2'
|
||||
- uses: 'actions/checkout@v3.0.0'
|
||||
|
||||
- name: 'Use Node.js'
|
||||
uses: 'actions/setup-node@v2.5.1'
|
||||
uses: 'actions/setup-node@v3.0.0'
|
||||
with:
|
||||
node-version: '16.x'
|
||||
cache: 'npm'
|
||||
|
7
.github/workflows/lint.yml
vendored
7
.github/workflows/lint.yml
vendored
@ -10,10 +10,10 @@ jobs:
|
||||
lint:
|
||||
runs-on: 'ubuntu-latest'
|
||||
steps:
|
||||
- uses: 'actions/checkout@v2'
|
||||
- uses: 'actions/checkout@v3.0.0'
|
||||
|
||||
- name: 'Use Node.js'
|
||||
uses: 'actions/setup-node@v2.5.1'
|
||||
uses: 'actions/setup-node@v3.0.0'
|
||||
with:
|
||||
node-version: '16.x'
|
||||
cache: 'npm'
|
||||
@ -36,9 +36,6 @@ jobs:
|
||||
- name: 'lint:prettier'
|
||||
run: 'npm run lint:prettier'
|
||||
|
||||
- name: 'resume:validate'
|
||||
run: 'npm run resume:validate'
|
||||
|
||||
- name: 'lint:dotenv'
|
||||
uses: 'dotenv-linter/action-dotenv-linter@v2'
|
||||
with:
|
||||
|
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@ -8,7 +8,7 @@ jobs:
|
||||
release:
|
||||
runs-on: 'ubuntu-latest'
|
||||
steps:
|
||||
- uses: 'actions/checkout@v2.4.0'
|
||||
- uses: 'actions/checkout@v3.0.0'
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
@ -21,7 +21,7 @@ jobs:
|
||||
git_commit_gpgsign: true
|
||||
|
||||
- name: 'Use Node.js'
|
||||
uses: 'actions/setup-node@v2.4.0'
|
||||
uses: 'actions/setup-node@v3.0.0'
|
||||
with:
|
||||
node-version: '16.x'
|
||||
cache: 'npm'
|
||||
|
12
.github/workflows/test.yml
vendored
12
.github/workflows/test.yml
vendored
@ -10,10 +10,10 @@ jobs:
|
||||
test-unit:
|
||||
runs-on: 'ubuntu-latest'
|
||||
steps:
|
||||
- uses: 'actions/checkout@v2.4.0'
|
||||
- uses: 'actions/checkout@v3.0.0'
|
||||
|
||||
- name: 'Use Node.js'
|
||||
uses: 'actions/setup-node@v2.5.1'
|
||||
uses: 'actions/setup-node@v3.0.0'
|
||||
with:
|
||||
node-version: '16.x'
|
||||
cache: 'npm'
|
||||
@ -27,10 +27,10 @@ jobs:
|
||||
test-lighthouse:
|
||||
runs-on: 'ubuntu-latest'
|
||||
steps:
|
||||
- uses: 'actions/checkout@v2.4.0'
|
||||
- uses: 'actions/checkout@v3.0.0'
|
||||
|
||||
- name: 'Use Node.js'
|
||||
uses: 'actions/setup-node@v2.5.1'
|
||||
uses: 'actions/setup-node@v3.0.0'
|
||||
with:
|
||||
node-version: '16.x'
|
||||
cache: 'npm'
|
||||
@ -52,10 +52,10 @@ jobs:
|
||||
test-e2e:
|
||||
runs-on: 'ubuntu-latest'
|
||||
steps:
|
||||
- uses: 'actions/checkout@v2.4.0'
|
||||
- uses: 'actions/checkout@v3.0.0'
|
||||
|
||||
- name: 'Use Node.js'
|
||||
uses: 'actions/setup-node@v2.5.1'
|
||||
uses: 'actions/setup-node@v3.0.0'
|
||||
with:
|
||||
node-version: '16.x'
|
||||
cache: 'npm'
|
||||
|
@ -3,5 +3,6 @@
|
||||
"http://localhost:3000/",
|
||||
"http://localhost:3000/blog",
|
||||
"http://localhost:3000/blog/hello-world"
|
||||
]
|
||||
],
|
||||
"files": ["./public/curriculum-vitae.html"]
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ interface HeadProps {
|
||||
export const Head: React.FC<HeadProps> = (props) => {
|
||||
const {
|
||||
title = 'Divlo',
|
||||
image = '/images/icons/icon-96x96.png',
|
||||
image = 'https://divlo.fr/images/icons/icon-96x96.png',
|
||||
description,
|
||||
url = 'https://divlo.fr/'
|
||||
} = props
|
||||
|
@ -1,22 +1,22 @@
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
import fs from 'fs'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
const ejs = require('ejs')
|
||||
const date = require('date-and-time')
|
||||
const { Parcel } = require('@parcel/core')
|
||||
import ejs from 'ejs'
|
||||
import date from 'date-and-time'
|
||||
import { Parcel } from '@parcel/core'
|
||||
|
||||
const render = async (resume) => {
|
||||
const themeIndexPath = path.join(__dirname, 'theme', 'index.ejs')
|
||||
const themeBuildPath = path.join(__dirname, 'theme', 'index.html')
|
||||
const indexHTMLPath = path.join(__dirname, 'dist', 'index.html')
|
||||
const html = await ejs.renderFile(themeIndexPath, {
|
||||
export const render = async (resume) => {
|
||||
const themeIndexURL = new URL('./theme/index.ejs', import.meta.url)
|
||||
const themeBuildURL = new URL('./theme/index.html', import.meta.url)
|
||||
const indexHTMLURL = new URL('./dist/index.html', import.meta.url)
|
||||
const themeBuildPath = fileURLToPath(themeBuildURL)
|
||||
const html = await ejs.renderFile(fileURLToPath(themeIndexURL), {
|
||||
date,
|
||||
locals: {
|
||||
...resume
|
||||
}
|
||||
})
|
||||
|
||||
await fs.promises.writeFile(themeBuildPath, html, { encoding: 'utf-8' })
|
||||
await fs.promises.writeFile(themeBuildURL, html, { encoding: 'utf-8' })
|
||||
const bundler = new Parcel({
|
||||
entries: themeBuildPath,
|
||||
source: themeBuildPath,
|
||||
@ -24,9 +24,5 @@ const render = async (resume) => {
|
||||
defaultConfig: '@parcel/config-default'
|
||||
})
|
||||
await bundler.run()
|
||||
return await fs.promises.readFile(indexHTMLPath, { encoding: 'utf-8' })
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
render
|
||||
return await fs.promises.readFile(indexHTMLURL, { encoding: 'utf-8' })
|
||||
}
|
||||
|
645
jsonresume-theme-custom/package-lock.json
generated
645
jsonresume-theme-custom/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -2,9 +2,10 @@
|
||||
"name": "jsonresume-theme-custom",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"date-and-time": "2.1.2",
|
||||
"date-and-time": "2.3.0",
|
||||
"ejs": "3.1.6",
|
||||
"modern-normalize": "1.1.0"
|
||||
},
|
||||
|
18
jsonresume-theme-custom/scripts/build.js
Normal file
18
jsonresume-theme-custom/scripts/build.js
Normal file
@ -0,0 +1,18 @@
|
||||
import fs from 'fs'
|
||||
|
||||
import { render } from '../index.js'
|
||||
|
||||
const jsonResumeURL = new URL('../../resume.json', import.meta.url)
|
||||
const publicResumeURL = new URL(
|
||||
'../../public/curriculum-vitae.html',
|
||||
import.meta.url
|
||||
)
|
||||
|
||||
const dataResumeStringJSON = await fs.promises.readFile(jsonResumeURL, {
|
||||
encoding: 'utf-8'
|
||||
})
|
||||
const dataResumeJSON = JSON.parse(dataResumeStringJSON)
|
||||
const dataResumeIndexHTML = await render(dataResumeJSON)
|
||||
await fs.promises.writeFile(publicResumeURL, dataResumeIndexHTML, {
|
||||
encoding: 'utf-8'
|
||||
})
|
9997
package-lock.json
generated
9997
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
46
package.json
46
package.json
@ -13,7 +13,7 @@
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"start": "next start",
|
||||
"build": "npm run resume:export && next build",
|
||||
"build": "npm run resume:build && next build",
|
||||
"export": "next export",
|
||||
"lint:commit": "commitlint",
|
||||
"lint:editorconfig": "editorconfig-checker",
|
||||
@ -26,9 +26,7 @@
|
||||
"test:lighthouse": "lhci autorun",
|
||||
"test:e2e": "start-server-and-test \"start\" \"http://localhost:3000\" \"cypress run\"",
|
||||
"test:e2e:dev": "start-server-and-test \"dev\" \"http://localhost:3000\" \"cypress open\"",
|
||||
"resume:validate": "resume validate",
|
||||
"resume:serve": "resume serve --theme \"custom\"",
|
||||
"resume:export": "resume export \"./public/curriculum-vitae.html\" --format \"html\" --theme \"custom\"",
|
||||
"resume:build": "node ./jsonresume-theme-custom/scripts/build.js",
|
||||
"release": "semantic-release",
|
||||
"deploy": "vercel",
|
||||
"postinstall": "husky install"
|
||||
@ -40,23 +38,23 @@
|
||||
"@fortawesome/free-solid-svg-icons": "6.0.0",
|
||||
"@fortawesome/react-fontawesome": "0.1.17",
|
||||
"classnames": "2.3.1",
|
||||
"date-and-time": "2.1.2",
|
||||
"date-and-time": "2.3.0",
|
||||
"gray-matter": "4.0.3",
|
||||
"html-react-parser": "1.4.8",
|
||||
"next": "12.1.0",
|
||||
"next-mdx-remote": "4.0.0",
|
||||
"next-pwa": "5.4.4",
|
||||
"next-pwa": "5.4.6",
|
||||
"next-themes": "0.1.1",
|
||||
"next-translate": "1.3.4",
|
||||
"next-translate": "1.3.5",
|
||||
"react": "17.0.2",
|
||||
"react-dom": "17.0.2",
|
||||
"read-pkg": "7.1.0",
|
||||
"rehype-raw": "6.1.1",
|
||||
"rehype-slug": "5.0.1",
|
||||
"remark-gfm": "3.0.1",
|
||||
"sharp": "0.30.1",
|
||||
"sharp": "0.30.2",
|
||||
"shiki": "0.10.1",
|
||||
"unified": "10.1.1",
|
||||
"unified": "10.1.2",
|
||||
"unist-util-visit": "4.1.0",
|
||||
"universal-cookie": "4.0.4"
|
||||
},
|
||||
@ -64,43 +62,41 @@
|
||||
"@commitlint/cli": "16.2.1",
|
||||
"@commitlint/config-conventional": "16.2.1",
|
||||
"@lhci/cli": "0.9.0",
|
||||
"@saithodev/semantic-release-backmerge": "2.1.1",
|
||||
"@saithodev/semantic-release-backmerge": "2.1.2",
|
||||
"@semantic-release/git": "10.0.1",
|
||||
"@tailwindcss/typography": "0.5.2",
|
||||
"@testing-library/jest-dom": "5.16.2",
|
||||
"@testing-library/react": "12.1.3",
|
||||
"@types/date-and-time": "0.13.0",
|
||||
"@types/jest": "27.4.0",
|
||||
"@types/node": "17.0.19",
|
||||
"@types/react": "17.0.39",
|
||||
"@testing-library/react": "12.1.4",
|
||||
"@types/jest": "27.4.1",
|
||||
"@types/node": "17.0.21",
|
||||
"@types/react": "17.0.40",
|
||||
"@types/unist": "2.0.6",
|
||||
"@typescript-eslint/eslint-plugin": "5.12.1",
|
||||
"@typescript-eslint/eslint-plugin": "5.14.0",
|
||||
"autoprefixer": "10.4.2",
|
||||
"cypress": "9.5.0",
|
||||
"cypress": "9.5.1",
|
||||
"editorconfig-checker": "4.0.2",
|
||||
"eslint": "8.9.0",
|
||||
"eslint": "8.11.0",
|
||||
"eslint-config-conventions": "1.1.0",
|
||||
"eslint-config-next": "12.1.0",
|
||||
"eslint-config-prettier": "8.4.0",
|
||||
"eslint-config-prettier": "8.5.0",
|
||||
"eslint-plugin-import": "2.25.4",
|
||||
"eslint-plugin-prettier": "4.0.0",
|
||||
"eslint-plugin-promise": "6.0.0",
|
||||
"eslint-plugin-unicorn": "41.0.0",
|
||||
"html-w3c-validator": "1.0.0",
|
||||
"html-w3c-validator": "1.1.0",
|
||||
"husky": "7.0.4",
|
||||
"jest": "27.5.1",
|
||||
"jsonresume-theme-custom": "file:./jsonresume-theme-custom",
|
||||
"lint-staged": "12.3.4",
|
||||
"lint-staged": "12.3.5",
|
||||
"markdownlint-cli": "0.31.1",
|
||||
"next-secure-headers": "2.2.0",
|
||||
"postcss": "8.4.6",
|
||||
"postcss": "8.4.8",
|
||||
"prettier": "2.5.1",
|
||||
"prettier-plugin-tailwindcss": "0.1.7",
|
||||
"resume-cli": "3.0.6",
|
||||
"prettier-plugin-tailwindcss": "0.1.8",
|
||||
"semantic-release": "19.0.2",
|
||||
"start-server-and-test": "1.14.0",
|
||||
"tailwindcss": "3.0.23",
|
||||
"typescript": "4.4.4",
|
||||
"typescript": "4.6.2",
|
||||
"vercel": "24.0.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,44 +1,66 @@
|
||||
---
|
||||
title: '❌ Mistakes I made as a junior developer'
|
||||
description: 'Here are mistakes I made when I started, to prevent you from making the same mistakes.'
|
||||
isPublished: false
|
||||
publishedOn: '2021-12-06T22:06:33.818Z'
|
||||
isPublished: true
|
||||
publishedOn: '2022-03-14T07:42:52.989Z'
|
||||
---
|
||||
|
||||
Hello! 👋
|
||||
|
||||
I will explain some of my mistakes I made as a junior developer, so you can avoid doing them.
|
||||
I will explain some of the mistakes I made as a junior developer, so you can avoid doing them.
|
||||
|
||||
## 1. Skipped learning how to do automated tests
|
||||
|
||||
Probably one of the most common error junior developers do.
|
||||
Probably one of the most common errors junior developers does.
|
||||
|
||||
When you begin in programming, you learn a programming language, so you learn variables, conditions, loops, functions, etc.
|
||||
|
||||
With these concepts, you might start a new project, thinking that you will be able to do everything.
|
||||
With these concepts, you might start a new project, but as the project grows, you will end up using functions at multiple places in code, so if you change the behavior of a function, it will affect the whole project.
|
||||
|
||||
But as the project grows, you will end up using functions at multiple places in code, so if you change the behavior of a function, it will affect the whole project.
|
||||
And because the code grows, you might do some refactoring to make it more maintainable, but because we are humans, we make mistakes, you could accidentally break the entire project even with a tiny change you thought was safe to do.
|
||||
|
||||
And because the code grows, you might do some refactoring, but because we are humans, we make mistakes, you could accidentally break the whole project even with a tiny change you thought was safe to do.
|
||||
|
||||
If you would have automated tests, you would have a way to know if you made a mistake even before deploying to production.
|
||||
If you had automated tests, you would have a way to know if you made a mistake even before deploying to production.
|
||||
|
||||
Depending on the programming language you are using, and what is the project you are working on, writing tests will be different.
|
||||
|
||||
Be aware that there are 3 main testing strategy:
|
||||
Be aware that there are 3 main testing strategies:
|
||||
|
||||
- [Unit testing](https://en.wikipedia.org/wiki/Unit_testing)
|
||||
- [Integration testing](https://en.wikipedia.org/wiki/Integration_testing)
|
||||
- [End-to-end testing](https://en.wikipedia.org/wiki/End-to-end_testing)
|
||||
|
||||
After you learnt the basic of programming, learn how to write automated tests, it will save you a lot of time and debugging.
|
||||
After you learned the basics of programming, learn how to write automated tests, it will save you a lot of time and debugging.
|
||||
|
||||
I would even say that you should get used-to writing tests, it should be an automatism, you should not even have to think about it to do it.
|
||||
|
||||
## 2. Thinking too big, with too much abstraction
|
||||
|
||||
Abstraction is great, but it can be harder to understand what is going on if actally don't need this abstraction.
|
||||
Abstraction is great, but it can be harder to understand what is going on if actually don't need this abstraction.
|
||||
|
||||
Find the right balance, between abstraction and implementation, start simple, and then gradually improve and add more features.
|
||||
Find the right balance, between abstraction and simple implementation, start simple, and then gradually improve and add more features.
|
||||
|
||||
When you start a new project, you should focus on the core of the project, not on the details, to release as soon as possible, a working usable version of your project also called a [**Minimum Viable Product** (MVP)](https://en.wikipedia.org/wiki/Minimum_viable_product).
|
||||
When you start a new project, you should focus on the core of the project, not on the details, to release as soon as possible, a working usable version of your project also called a [**Minimum Viable Product** (MVP)](https://en.wikipedia.org/wiki/Minimum_viable_product), it is better than a half-functioning, over-engineered project.
|
||||
|
||||
## 3. Focusing on the thing that don't add value to a project
|
||||
I made this mistake while developing [Thream](https://thream.divlo.fr), your **open source** platform to stay close with your friends and communities, **talk**, chat, **collaborate**, share and **have fun**.
|
||||
|
||||
Basically, I thought it was cool, to do a "big" v1.0.0 release with a lot of features, but in fact, it was not, because I could not even show what I was developing (to the end-users, not technical people) as I was making multiple features at the same time and also mainly focused on the **REST API** side and not at all the **website (frontend)**.
|
||||
|
||||
What I recommend you to do is to start with a **v1.0.0** release as soon as possible with the minimum required features needed for your project idea, and then gradually add new features and release new versions.
|
||||
|
||||
In my example for [Thream](https://thream.divlo.fr), I could release a v1.0.0 without these features:
|
||||
|
||||
- English/French translation (could be only English)
|
||||
- Light/Dark theme (could be only Dark)
|
||||
- OAuth2 Authentication (could be only simple email/password authentication)
|
||||
- User public profile
|
||||
- Channels (maybe could be only one channel per guild to start with)
|
||||
|
||||
And probably more, what was really required with [Thream](https://thream.divlo.fr), is that users could authenticate, create a community of friends, and then they could communicate with each other with messages in real-time, really that was enough.
|
||||
|
||||
And then with this basis, I could release, v1.1.0, v1.2.0 etc. with more features, and release new versions more often to show the progress of the project, it is also more motivating to have users testing our project and to **get feedback sooner**.
|
||||
|
||||
**Start simple, improve later.**
|
||||
|
||||
## Conclusion
|
||||
|
||||
The real key to success is to **be passionate**, **keep learning** on your own, and **look at mistakes as learning experiences**.
|
||||
|
Loading…
Reference in New Issue
Block a user