Skip to content

Commit

Permalink
bump deps; reduce babel;
Browse files Browse the repository at this point in the history
  • Loading branch information
elbakerino committed Sep 20, 2024
1 parent 88330e9 commit 05bb52a
Show file tree
Hide file tree
Showing 6 changed files with 6,044 additions and 7,089 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/blank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Set Branch
Expand Down
18 changes: 2 additions & 16 deletions babel.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,6 @@
"@babel/preset-typescript"
],
"plugins": [
"@babel/plugin-proposal-private-methods",
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-transform-template-literals",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-nullish-coalescing-operator",
[
"@babel/plugin-proposal-object-rest-spread",
{
"useBuiltIns": true
}
],
"@babel/plugin-proposal-class-properties"
],
"env": {
"cjs": {
Expand All @@ -37,7 +23,7 @@
"@babel/preset-env",
{
"targets": {
"node": "14"
"node": "18"
},
"modules": false
}
Expand All @@ -46,7 +32,7 @@
"@babel/preset-typescript",
{
"targets": {
"node": "14"
"node": "18"
},
"modules": false
}
Expand Down
2 changes: 0 additions & 2 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ const base: Partial<Config.InitialOptions> = {
'json',
'node',
],
collectCoverage: true,
coveragePathIgnorePatterns: [
'(tests/.*.mock).(jsx?|tsx?|ts?|js?)$',
],
verbose: true,
}

const config: Config.InitialOptions = {
Expand Down
40 changes: 40 additions & 0 deletions merge-dirs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env node
import fs from 'node:fs'
import path from 'node:path'

function copyFile(file, location) {
fs.mkdirSync(path.dirname(file), {
mode: 0x1ed,
recursive: true,
})
fs.writeFileSync(file, fs.readFileSync(location))
}

function mergeDirs(src, dest, overwrite = true) {
const files = fs.readdirSync(src)

files.forEach((file) => {
const srcFile = path.join(src, file)
const destFile = path.join(dest, file)
const stats = fs.lstatSync(srcFile)

if(stats.isDirectory()) {
mergeDirs(srcFile, destFile)
} else {
if(overwrite || !fs.existsSync(destFile)) {
copyFile(destFile, srcFile)
}
// skip when not overwrite and file exists
}
})
}

const argv = process.argv.slice(2)

const helpString = `Usage: merge-dirs source destination [--overwrite]`
if(argv.length < 2 || argv.includes('--help')) {
console.log(helpString)
process.exit()
}

mergeDirs(argv[0], argv[1], argv[2] === '--overwrite')
Loading

0 comments on commit 05bb52a

Please sign in to comment.