create-gasket-app 7.0.0-next.7 → 7.0.0-next.9
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.
|
@@ -15,6 +15,7 @@ async function loadPresets(_, context) {
|
|
|
15
15
|
const tmpDir = await mkdtemp(path.join(os.tmpdir(), `gasket-create-${context.appName}`));
|
|
16
16
|
context.tmpDir = tmpDir;
|
|
17
17
|
|
|
18
|
+
const modPath = path.join(tmpDir, 'node_modules');
|
|
18
19
|
const pkgManager = new gasketUtils.PackageManager({
|
|
19
20
|
packageManager: context.packageManager,
|
|
20
21
|
dest: tmpDir
|
|
@@ -25,17 +26,32 @@ async function loadPresets(_, context) {
|
|
|
25
26
|
const parts = /@(\^[0-9]\.|[0-9]).+/.test(preset) && preset.split('@').filter(Boolean);
|
|
26
27
|
const name = parts ? `@${parts[0]}` : preset;
|
|
27
28
|
const version = parts ? `@${parts[1]}` : '@latest';
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
// Install the preset
|
|
32
|
+
await pkgManager.exec(pkgVerb, [`${name}${version}`]);
|
|
33
|
+
// Get the package file
|
|
34
|
+
const pkgFile = require(path.join(modPath, name, 'package.json'));
|
|
35
|
+
// Import the preset via the package file attrs, name and main
|
|
36
|
+
// We can't specify the cwd for the import, so we need to use the full path
|
|
37
|
+
// expects type:module & "main": "lib/fullpath.js"
|
|
38
|
+
const mod = await import(`${modPath}/${name}/${pkgFile.main}`);
|
|
39
|
+
return mod.default || mod;
|
|
40
|
+
} catch (err) {
|
|
41
|
+
throw new Error(`Failed to install preset ${name}${version}`);
|
|
42
|
+
}
|
|
32
43
|
});
|
|
33
44
|
|
|
34
45
|
const localPresets = context.localPresets.map(async localPresetPath => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
await pkgManager.exec(pkgVerb, [localPresetPath]);
|
|
49
|
+
const pkgFile = require(path.join(localPresetPath, 'package.json'));
|
|
50
|
+
const mod = await import(`${modPath}/${pkgFile.name}/${pkgFile.main}`);
|
|
51
|
+
return mod.default || mod;
|
|
52
|
+
} catch (err) {
|
|
53
|
+
throw new Error(`Failed to install local preset ${localPresetPath}`);
|
|
54
|
+
}
|
|
39
55
|
});
|
|
40
56
|
|
|
41
57
|
context.presets = await Promise.all([...remotePresets, ...localPresets]);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import action from '../action-wrapper.js';
|
|
2
2
|
import { ConfigBuilder } from '../config-builder.js';
|
|
3
3
|
import { default as gasketUtils } from '@gasket/utils';
|
|
4
|
+
import { createRequire } from 'module';
|
|
5
|
+
const require = createRequire(import.meta.url);
|
|
6
|
+
const { dependencies } = require('../../../package.json');
|
|
4
7
|
|
|
5
8
|
/**
|
|
6
9
|
* Initializes the ConfigBuilder builder and adds to context.
|
|
@@ -18,6 +21,13 @@ async function setupPkg(gasket, context) {
|
|
|
18
21
|
type: context.typescript ? 'commonjs' : 'module'
|
|
19
22
|
}, { warnings });
|
|
20
23
|
|
|
24
|
+
// Add critical dependencies
|
|
25
|
+
pkg.add('dependencies', {
|
|
26
|
+
'@gasket/core': dependencies['@gasket/core'],
|
|
27
|
+
'@gasket/engine': dependencies['@gasket/engine'],
|
|
28
|
+
'@gasket/utils': dependencies['@gasket/utils']
|
|
29
|
+
});
|
|
30
|
+
|
|
21
31
|
const pkgManager = new gasketUtils.PackageManager(context);
|
|
22
32
|
Object.assign(context, { pkg, pkgManager });
|
|
23
33
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-gasket-app",
|
|
3
|
-
"version": "7.0.0-next.
|
|
3
|
+
"version": "7.0.0-next.9",
|
|
4
4
|
"description": "starter pack for creating a gasket app",
|
|
5
5
|
"main": "lib",
|
|
6
6
|
"bin": {
|
|
@@ -32,12 +32,11 @@
|
|
|
32
32
|
},
|
|
33
33
|
"homepage": "https://github.com/godaddy/gasket/tree/main/packages/create-gasket-app",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@gasket/core": "^7.0.0-next.
|
|
36
|
-
"@gasket/engine": "^7.0.0-next.
|
|
37
|
-
"@gasket/plugin-git": "^7.0.0-next.
|
|
38
|
-
"@gasket/plugin-logger": "^7.0.0-next.
|
|
39
|
-
"@gasket/
|
|
40
|
-
"@gasket/utils": "^7.0.0-next.7",
|
|
35
|
+
"@gasket/core": "^7.0.0-next.9",
|
|
36
|
+
"@gasket/engine": "^7.0.0-next.9",
|
|
37
|
+
"@gasket/plugin-git": "^7.0.0-next.9",
|
|
38
|
+
"@gasket/plugin-logger": "^7.0.0-next.9",
|
|
39
|
+
"@gasket/utils": "^7.0.0-next.9",
|
|
41
40
|
"commander": "^12.0.0",
|
|
42
41
|
"deepmerge": "^4.3.1",
|
|
43
42
|
"glob": "^8.1.0",
|
|
@@ -80,5 +79,5 @@
|
|
|
80
79
|
"jest": {
|
|
81
80
|
"transform": {}
|
|
82
81
|
},
|
|
83
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "d993b3d02586581fee56576d860eb2a8393e601c"
|
|
84
83
|
}
|