@kispace-io/gs-lib 1.0.28 → 1.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,8 +4,7 @@ import {
4
4
  FileSystem,
5
5
  ProgressCallback,
6
6
  buildMap,
7
- calculateTotalSteps,
8
- createCopyAssetsFunction
7
+ calculateTotalSteps
9
8
  } from '../src/base-map-builder'
10
9
  import {GsMap} from '../src/gs-model'
11
10
 
@@ -169,8 +168,22 @@ export async function buildProject(
169
168
 
170
169
  const buildTitle = title || path.basename(mapFile, '.geospace')
171
170
 
172
- // Use standard copyAssets function
173
- const copyAssets = createCopyAssetsFunction(fs)
171
+ // Create Node.js-specific copyAssets function using native fs.cp()
172
+ const copyAssets = async (fileSys: FileSystem, outputDir: string) => {
173
+ const assetsSrc = path.resolve(projectRoot, 'assets')
174
+ const assetsDest = path.resolve(projectRoot, outputDir, 'assets')
175
+
176
+ // Check if assets directory exists
177
+ try {
178
+ await nodeFs.access(assetsSrc)
179
+ } catch {
180
+ // Assets directory doesn't exist, skip copying
181
+ return
182
+ }
183
+
184
+ // Use Node.js native fs.cp() for recursive directory copy (available since v16.7.0)
185
+ await nodeFs.cp(assetsSrc, assetsDest, { recursive: true })
186
+ }
174
187
 
175
188
  // Build using unified function
176
189
  // Dynamic import to avoid bundling esbuild in browser builds
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kispace-io/gs-lib",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "type": "module",
5
5
  "license": "EPL-2.0",
6
6
  "repository": {