Skip to content

Commit

Permalink
feat(root): update nodejs to lts (20) wd-521 (#685)
Browse files Browse the repository at this point in the history
* ci(root): update nodejs to lts (20) wd-521

* ci(root): replace fileURLToPath with import.meta.dirname wd-521

* style(root): replace slice + sort with toSroted wd-521

* style(whatislove-dev): replace dotenv package with process.loadEnvFile wd-521

* style(whatislove-dev): revert replace dotenv package with process.loadEnvFile wd-521
  • Loading branch information
what1s1ove authored Jul 28, 2024
1 parent ee73843 commit 9d61bad
Show file tree
Hide file tree
Showing 8 changed files with 168 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.19.0
20.16.0
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ import { ProcessExitCode, getShuffledItems } from '@whatislove.dev/shared'
import ffmpeg from 'fluent-ffmpeg'
import { existsSync } from 'node:fs'
import { readdir } from 'node:fs/promises'
import { dirname, join } from 'node:path'
import { join } from 'node:path'
import { exit } from 'node:process'
import { fileURLToPath } from 'node:url'

let PROCESS_PIECE_FILE_EXT = /** @type {const} */ (`.mp4`)

let scriptDirname = dirname(fileURLToPath(import.meta.url))
let processPiecesPath = join(scriptDirname, `./process-pieces`)
let processFilePath = join(scriptDirname, `../../public/videos`, `process.mp4`)
let processPiecesPath = join(import.meta.dirname, `./process-pieces`)
let processFilePath = join(
import.meta.dirname,
`../../public/videos`,
`process.mp4`,
)

ffmpeg.setFfmpegPath(ffmpegInstaller.path)
ffmpeg.setFfprobePath(ffprobeInstaller.path)
Expand Down
4 changes: 2 additions & 2 deletions apps/careers-whatislove-dev/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fileURLToPath } from 'node:url'
import { join } from 'node:path'
import { defineConfig } from 'vite'
import babel from 'vite-plugin-babel'

Expand Down Expand Up @@ -29,7 +29,7 @@ let config = defineConfig({
alias: [
{
find: `~`,
replacement: fileURLToPath(new URL(`src`, import.meta.url)),
replacement: join(import.meta.dirname, `src`),
},
],
},
Expand Down
4 changes: 2 additions & 2 deletions apps/certifications-whatislove-dev/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import reactPlugin from '@vitejs/plugin-react'
import { fileURLToPath } from 'node:url'
import { join } from 'node:path'
import { defineConfig } from 'vite'

/** @type {import('vite').UserConfig} */
Expand All @@ -16,7 +16,7 @@ let config = defineConfig({
alias: [
{
find: `~`,
replacement: fileURLToPath(new URL(`src`, import.meta.url)),
replacement: join(import.meta.dirname, `src`),
},
],
},
Expand Down
6 changes: 4 additions & 2 deletions apps/whatislove-dev/src/data/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import process from 'node:process'

let { DEVTO_API_KEY, ENVIRONMENT, WEBMENTION_API_KEY } = process.env

let isDevelopment = ENVIRONMENT === `development`

let data = {
API: {
DEVTO_API_KEY: /** @type {string} */ (DEVTO_API_KEY),
Expand All @@ -11,8 +13,8 @@ let data = {
APP: {
ENVIRONMENT: /** @type {string} */ (ENVIRONMENT),
FLAGS: {
IS_DEVELOPMENT: ENVIRONMENT === `development`,
IS_PRODUCTION: ENVIRONMENT !== `development`,
IS_DEVELOPMENT: isDevelopment,
IS_PRODUCTION: !isDevelopment,
},
},
}
Expand Down
Loading

0 comments on commit 9d61bad

Please sign in to comment.