@sequencemedia/gulp-cli 1.1.34 → 1.1.35
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.
- package/package.json +1 -1
- package/src/config/load-files.mjs +9 -2
- package/src/index.mjs +10 -2
- package/src/run-version.mjs +8 -1
package/package.json
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
pathToFileURL
|
|
3
|
+
} from 'node:url'
|
|
4
|
+
|
|
1
5
|
import copyProps from 'copy-props'
|
|
6
|
+
|
|
2
7
|
import {
|
|
3
8
|
join,
|
|
4
9
|
extname,
|
|
@@ -24,10 +29,12 @@ export default async function loadConfigFiles (configFiles = {}, configFileOrder
|
|
|
24
29
|
const filePath = configFiles[key]
|
|
25
30
|
|
|
26
31
|
try {
|
|
32
|
+
const fileUrl = pathToFileURL(resolve(join(process.cwd(), filePath)))
|
|
33
|
+
|
|
27
34
|
const module = (
|
|
28
35
|
extname(filePath) === '.json'
|
|
29
|
-
? await import(
|
|
30
|
-
: await import(
|
|
36
|
+
? await import(fileUrl, { assert: { type: 'json' } })
|
|
37
|
+
: await import(fileUrl)
|
|
31
38
|
)
|
|
32
39
|
|
|
33
40
|
copyProps(getConfig(module), config, ({ keyChain, value }) => {
|
package/src/index.mjs
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
pathToFileURL
|
|
3
|
+
} from 'node:url'
|
|
4
|
+
|
|
1
5
|
import stdout from 'mute-stdout'
|
|
2
6
|
|
|
3
7
|
import listenForGulpEvents from './log/listen-for-gulp-events.mjs'
|
|
@@ -13,8 +17,10 @@ function getImportFromModulePath (params) {
|
|
|
13
17
|
}
|
|
14
18
|
} = params
|
|
15
19
|
|
|
20
|
+
const fileUrl = pathToFileURL(modulePath)
|
|
21
|
+
|
|
16
22
|
return (
|
|
17
|
-
import(
|
|
23
|
+
import(fileUrl)
|
|
18
24
|
.then(({ default: gulp }) => Object.assign(params, { gulp }))
|
|
19
25
|
)
|
|
20
26
|
}
|
|
@@ -26,8 +32,10 @@ function getImportFromConfigPath (params) {
|
|
|
26
32
|
}
|
|
27
33
|
} = params
|
|
28
34
|
|
|
35
|
+
const fileUrl = pathToFileURL(configPath)
|
|
36
|
+
|
|
29
37
|
return (
|
|
30
|
-
import(
|
|
38
|
+
import(fileUrl)
|
|
31
39
|
.then((tasks) => Object.assign(params, { tasks }))
|
|
32
40
|
)
|
|
33
41
|
}
|
package/src/run-version.mjs
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
pathToFileURL
|
|
3
|
+
} from 'node:url'
|
|
4
|
+
|
|
1
5
|
import {
|
|
2
6
|
join
|
|
3
7
|
} from 'node:path'
|
|
@@ -7,11 +11,14 @@ import exit from './exit.mjs'
|
|
|
7
11
|
import ROOT from '#where-am-i'
|
|
8
12
|
|
|
9
13
|
async function getGulpCliVersion () {
|
|
14
|
+
const fileUrl = pathToFileURL(join(ROOT, 'package.json'))
|
|
15
|
+
|
|
10
16
|
const {
|
|
11
17
|
default: {
|
|
12
18
|
version
|
|
13
19
|
}
|
|
14
|
-
} = await import(
|
|
20
|
+
} = await import(fileUrl, { assert: { type: 'json' } })
|
|
21
|
+
|
|
15
22
|
return version
|
|
16
23
|
}
|
|
17
24
|
|