@adobe/aio-commerce-lib-app 0.3.1 → 0.3.2
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/CHANGELOG.md +6 -0
- package/dist/cjs/commands/index.cjs +14 -7
- package/dist/es/commands/index.mjs +14 -7
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @adobe/aio-commerce-lib-app
|
|
2
2
|
|
|
3
|
+
## 0.3.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#262](https://github.com/adobe/aio-commerce-sdk/pull/262) [`7cb9252`](https://github.com/adobe/aio-commerce-sdk/commit/7cb9252736acd34f5490e2dc940b74a7ec40f17c) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Dependencies should be installed early in the init process.
|
|
8
|
+
|
|
3
9
|
## 0.3.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -945,12 +945,11 @@ async function ensureAppConfig(domains, cwd = process.cwd()) {
|
|
|
945
945
|
if (domains.has("businessConfig.schema")) await addExtensionPointToAppConfig(CONFIGURATION_EXTENSION_POINT_ID, rootDirectory, " This extension is required for business configuration. Do not remove.");
|
|
946
946
|
await addExtensionPointToAppConfig(EXTENSIBILITY_EXTENSION_POINT_ID, rootDirectory, " This extension is required for app management. Do not remove.");
|
|
947
947
|
}
|
|
948
|
-
/** Install
|
|
949
|
-
function
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
const packagesToInstall = packages.join(" ");
|
|
948
|
+
/** Install the given dependencies */
|
|
949
|
+
function runInstall(packageManager, dependencies, cwd = process.cwd()) {
|
|
950
|
+
const dependencyListString = dependencies.map((dependency) => ` - ${dependency}`).join("\n");
|
|
951
|
+
consola.consola.info(`Installing the following dependencies with ${packageManager}:\n${dependencyListString}`);
|
|
952
|
+
const packagesToInstall = dependencies.join(" ");
|
|
954
953
|
const installCommand = {
|
|
955
954
|
pnpm: `pnpm add ${packagesToInstall}`,
|
|
956
955
|
yarn: `yarn add ${packagesToInstall}`,
|
|
@@ -967,6 +966,12 @@ function installDependencies(packageManager, domains, cwd = process.cwd()) {
|
|
|
967
966
|
throw new Error(`Failed to install dependencies automatically. Please install manually: ${installCommand}`, { cause: error });
|
|
968
967
|
}
|
|
969
968
|
}
|
|
969
|
+
/** Install required dependencies */
|
|
970
|
+
function installDependencies(packageManager, domains, cwd = process.cwd()) {
|
|
971
|
+
const packages = [];
|
|
972
|
+
if (domains.has("businessConfig.schema")) packages.push("@adobe/aio-commerce-lib-config");
|
|
973
|
+
runInstall(packageManager, packages, cwd);
|
|
974
|
+
}
|
|
970
975
|
/** Run the generation command */
|
|
971
976
|
async function runGeneration(appConfig, execCommand) {
|
|
972
977
|
try {
|
|
@@ -985,19 +990,21 @@ async function ensureInstallYaml(domains, cwd = process.cwd()) {
|
|
|
985
990
|
|
|
986
991
|
//#endregion
|
|
987
992
|
//#region source/commands/init/main.ts
|
|
993
|
+
const REQUIRED_DEPENDENCIES = ["@adobe/aio-commerce-lib-app", "@adobe/aio-commerce-sdk"];
|
|
988
994
|
/** Initialize the project with @adobe/aio-commerce-lib-config */
|
|
989
995
|
async function exec() {
|
|
990
996
|
try {
|
|
991
997
|
consola.consola.start("Initializing app...");
|
|
992
998
|
const { execCommand, packageManager } = await ensurePackageJson();
|
|
999
|
+
runInstall(packageManager, REQUIRED_DEPENDENCIES);
|
|
993
1000
|
const { config: config$1, domains } = await ensureCommerceAppConfig();
|
|
1001
|
+
installDependencies(packageManager, domains);
|
|
994
1002
|
(0, child_process.execSync)(`npm pkg set name="${config$1.metadata.id}"`);
|
|
995
1003
|
(0, child_process.execSync)(`npm pkg set version="${config$1.metadata.version}"`);
|
|
996
1004
|
(0, child_process.execSync)(`npm pkg set description="${config$1.metadata.description}"`);
|
|
997
1005
|
await runGeneration(config$1, execCommand);
|
|
998
1006
|
await ensureAppConfig(domains);
|
|
999
1007
|
await ensureInstallYaml(domains);
|
|
1000
|
-
installDependencies(packageManager, domains);
|
|
1001
1008
|
consola.consola.success("Initialization complete!");
|
|
1002
1009
|
consola.consola.box([
|
|
1003
1010
|
"Next steps:",
|
|
@@ -939,12 +939,11 @@ async function ensureAppConfig(domains, cwd = process.cwd()) {
|
|
|
939
939
|
if (domains.has("businessConfig.schema")) await addExtensionPointToAppConfig(CONFIGURATION_EXTENSION_POINT_ID, rootDirectory, " This extension is required for business configuration. Do not remove.");
|
|
940
940
|
await addExtensionPointToAppConfig(EXTENSIBILITY_EXTENSION_POINT_ID, rootDirectory, " This extension is required for app management. Do not remove.");
|
|
941
941
|
}
|
|
942
|
-
/** Install
|
|
943
|
-
function
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
const packagesToInstall = packages.join(" ");
|
|
942
|
+
/** Install the given dependencies */
|
|
943
|
+
function runInstall(packageManager, dependencies, cwd = process.cwd()) {
|
|
944
|
+
const dependencyListString = dependencies.map((dependency) => ` - ${dependency}`).join("\n");
|
|
945
|
+
consola$1.info(`Installing the following dependencies with ${packageManager}:\n${dependencyListString}`);
|
|
946
|
+
const packagesToInstall = dependencies.join(" ");
|
|
948
947
|
const installCommand = {
|
|
949
948
|
pnpm: `pnpm add ${packagesToInstall}`,
|
|
950
949
|
yarn: `yarn add ${packagesToInstall}`,
|
|
@@ -961,6 +960,12 @@ function installDependencies(packageManager, domains, cwd = process.cwd()) {
|
|
|
961
960
|
throw new Error(`Failed to install dependencies automatically. Please install manually: ${installCommand}`, { cause: error });
|
|
962
961
|
}
|
|
963
962
|
}
|
|
963
|
+
/** Install required dependencies */
|
|
964
|
+
function installDependencies(packageManager, domains, cwd = process.cwd()) {
|
|
965
|
+
const packages = [];
|
|
966
|
+
if (domains.has("businessConfig.schema")) packages.push("@adobe/aio-commerce-lib-config");
|
|
967
|
+
runInstall(packageManager, packages, cwd);
|
|
968
|
+
}
|
|
964
969
|
/** Run the generation command */
|
|
965
970
|
async function runGeneration(appConfig, execCommand) {
|
|
966
971
|
try {
|
|
@@ -979,19 +984,21 @@ async function ensureInstallYaml(domains, cwd = process.cwd()) {
|
|
|
979
984
|
|
|
980
985
|
//#endregion
|
|
981
986
|
//#region source/commands/init/main.ts
|
|
987
|
+
const REQUIRED_DEPENDENCIES = ["@adobe/aio-commerce-lib-app", "@adobe/aio-commerce-sdk"];
|
|
982
988
|
/** Initialize the project with @adobe/aio-commerce-lib-config */
|
|
983
989
|
async function exec() {
|
|
984
990
|
try {
|
|
985
991
|
consola$1.start("Initializing app...");
|
|
986
992
|
const { execCommand, packageManager } = await ensurePackageJson();
|
|
993
|
+
runInstall(packageManager, REQUIRED_DEPENDENCIES);
|
|
987
994
|
const { config: config$1, domains } = await ensureCommerceAppConfig();
|
|
995
|
+
installDependencies(packageManager, domains);
|
|
988
996
|
execSync(`npm pkg set name="${config$1.metadata.id}"`);
|
|
989
997
|
execSync(`npm pkg set version="${config$1.metadata.version}"`);
|
|
990
998
|
execSync(`npm pkg set description="${config$1.metadata.description}"`);
|
|
991
999
|
await runGeneration(config$1, execCommand);
|
|
992
1000
|
await ensureAppConfig(domains);
|
|
993
1001
|
await ensureInstallYaml(domains);
|
|
994
|
-
installDependencies(packageManager, domains);
|
|
995
1002
|
consola$1.success("Initialization complete!");
|
|
996
1003
|
consola$1.box([
|
|
997
1004
|
"Next steps:",
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@adobe/aio-commerce-lib-app",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"author": "Adobe Inc.",
|
|
5
|
-
"version": "0.3.
|
|
5
|
+
"version": "0.3.2",
|
|
6
6
|
"private": false,
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": ">=20 <=24"
|
|
@@ -82,9 +82,9 @@
|
|
|
82
82
|
"@standard-schema/spec": "^1.1.0",
|
|
83
83
|
"yaml": "^2.8.2",
|
|
84
84
|
"@adobe/aio-commerce-lib-api": "0.6.1",
|
|
85
|
+
"@adobe/aio-commerce-lib-auth": "0.8.1",
|
|
85
86
|
"@adobe/aio-commerce-lib-core": "0.6.1",
|
|
86
|
-
"@adobe/aio-commerce-lib-events": "0.6.0"
|
|
87
|
-
"@adobe/aio-commerce-lib-auth": "0.8.1"
|
|
87
|
+
"@adobe/aio-commerce-lib-events": "0.6.0"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"@adobe/aio-lib-core-logging": "^3.0.2",
|
|
@@ -92,8 +92,8 @@
|
|
|
92
92
|
"@aio-commerce-sdk/config-tsdown": "1.0.0",
|
|
93
93
|
"@aio-commerce-sdk/config-typedoc": "1.0.0",
|
|
94
94
|
"@aio-commerce-sdk/config-typescript": "1.0.0",
|
|
95
|
-
"@aio-commerce-sdk/
|
|
96
|
-
"@aio-commerce-sdk/
|
|
95
|
+
"@aio-commerce-sdk/config-vitest": "1.0.0",
|
|
96
|
+
"@aio-commerce-sdk/scripting-utils": "0.2.1"
|
|
97
97
|
},
|
|
98
98
|
"sideEffects": false,
|
|
99
99
|
"scripts": {
|