Skip to content

Commit

Permalink
fix: restore fs-extra
Browse files Browse the repository at this point in the history
  • Loading branch information
ubermanu committed Sep 10, 2023
1 parent bbf561e commit 5a45cd9
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 11 deletions.
3 changes: 1 addition & 2 deletions packages/magefront/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

### Minor Changes

- f8da0cb: - Replace fs-extra with the node:fs functions
- Write types statically to reduce build time and overhead
- f8da0cb: Write types statically to reduce build time and overhead
- f8da0cb: Set a proper (peer) dependency version in packages

### Patch Changes
Expand Down
2 changes: 2 additions & 0 deletions packages/magefront/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"chokidar": "^3.5.3",
"cli-table": "^0.3.11",
"fast-glob": "^3.3.1",
"fs-extra": "^11.1.1",
"kleur": "^4.1.5",
"magefront-preset-default": "workspace:^",
"memoizee": "^0.4.15",
Expand All @@ -45,6 +46,7 @@
"devDependencies": {
"@types/browser-sync": "^2.27.0",
"@types/cli-table": "^0.3.2",
"@types/fs-extra": "^11.0.1",
"@types/memoizee": "^0.4.8",
"@types/node": "^20.5.9"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/magefront/src/actions/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import glob from 'fast-glob'
import fs from 'node:fs'
import fs from 'fs-extra'
import path from 'node:path'
import type { Action } from '../../types/magefront'

Expand Down Expand Up @@ -32,7 +32,7 @@ export const deploy: Action = async (context) => {
files.map(async (file) => {
const filePath = await fs.promises.realpath(path.join(buildConfig.tmp, file))
const destPath = path.join(dest, file)
return fs.promises.cp(filePath, destPath, { recursive: true })
return fs.copy(filePath, destPath)
})
)
}
8 changes: 4 additions & 4 deletions packages/magefront/src/actions/inheritance.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import glob, { type Pattern } from 'fast-glob'
import fs from 'node:fs'
import fs from 'fs-extra'
import path from 'node:path'
import type { Action } from '../../types/magefront'
import { getThemeDependencyTree } from '../magento/theme'
Expand All @@ -19,14 +19,14 @@ export const inheritance: Action = async (context) => {
await Promise.all(
files.map(async (srcPath) => {
const destPath = path.join(dest, srcPath.replace(src + '/', '/'))
await fs.promises.rm(destPath, { recursive: true })
return fs.promises.cp(path.join(rootPath, srcPath), destPath, { recursive: true })
await fs.remove(destPath)
return fs.copy(path.join(rootPath, srcPath), destPath)
})
)
}

// Clean destination dir
await fs.promises.rm(tmp, { recursive: true })
await fs.remove(tmp)

// Add the Magento core lib resources as a dependency for everyone
// Ignore the css docs and txt files
Expand Down
22 changes: 19 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5a45cd9

Please sign in to comment.