aios-core 4.4.3 → 4.4.5
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.
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
# - SHA256 hashes for change detection
|
|
8
8
|
# - File types for categorization
|
|
9
9
|
#
|
|
10
|
-
version: 4.4.
|
|
11
|
-
generated_at: "2026-02-
|
|
10
|
+
version: 4.4.5
|
|
11
|
+
generated_at: "2026-02-25T01:54:44.280Z"
|
|
12
12
|
generator: scripts/generate-install-manifest.js
|
|
13
13
|
file_count: 1084
|
|
14
14
|
files:
|
package/package.json
CHANGED
|
@@ -122,6 +122,7 @@ const TRANSLATIONS = {
|
|
|
122
122
|
proKeyInvalid: 'Invalid format. Expected: PRO-XXXX-XXXX-XXXX-XXXX',
|
|
123
123
|
proKeyValidated: 'License validated: {key}',
|
|
124
124
|
proModuleNotAvailable: 'Pro license module not available. Ensure @aios-fullstack/pro is installed.',
|
|
125
|
+
proModuleBootstrap: 'Pro license module not found locally. Installing @aios-fullstack/pro to bootstrap...',
|
|
125
126
|
proServerUnreachable: 'License server is unreachable. Check your internet connection and try again.',
|
|
126
127
|
proVerifyingAccessShort: 'Verifying access...',
|
|
127
128
|
proAccessConfirmed: 'Pro access confirmed.',
|
|
@@ -279,6 +280,7 @@ const TRANSLATIONS = {
|
|
|
279
280
|
proKeyInvalid: 'Formato inválido. Esperado: PRO-XXXX-XXXX-XXXX-XXXX',
|
|
280
281
|
proKeyValidated: 'Licença validada: {key}',
|
|
281
282
|
proModuleNotAvailable: 'Módulo de licença Pro não disponível. Certifique-se de que @aios-fullstack/pro está instalado.',
|
|
283
|
+
proModuleBootstrap: 'Módulo de licença Pro não encontrado localmente. Instalando @aios-fullstack/pro...',
|
|
282
284
|
proServerUnreachable: 'Servidor de licenças inacessível. Verifique sua conexão com a internet e tente novamente.',
|
|
283
285
|
proVerifyingAccessShort: 'Verificando acesso...',
|
|
284
286
|
proAccessConfirmed: 'Acesso Pro confirmado.',
|
|
@@ -435,6 +437,7 @@ const TRANSLATIONS = {
|
|
|
435
437
|
proKeyInvalid: 'Formato inválido. Esperado: PRO-XXXX-XXXX-XXXX-XXXX',
|
|
436
438
|
proKeyValidated: 'Licencia validada: {key}',
|
|
437
439
|
proModuleNotAvailable: 'Módulo de licencia Pro no disponible. Asegúrese de que @aios-fullstack/pro esté instalado.',
|
|
440
|
+
proModuleBootstrap: 'Módulo de licencia Pro no encontrado localmente. Instalando @aios-fullstack/pro...',
|
|
438
441
|
proServerUnreachable: 'Servidor de licencias inaccesible. Verifique su conexión a internet e intente nuevamente.',
|
|
439
442
|
proVerifyingAccessShort: 'Verificando acceso...',
|
|
440
443
|
proAccessConfirmed: 'Acceso Pro confirmado.',
|
|
@@ -145,30 +145,70 @@ function showStep(current, total, label) {
|
|
|
145
145
|
console.log(colors.dim(' ' + '─'.repeat(44)));
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
+
/**
|
|
149
|
+
* Try to load a pro license module via multiple resolution paths.
|
|
150
|
+
*
|
|
151
|
+
* Resolution order:
|
|
152
|
+
* 1. Relative path (framework-dev mode: ../../../../pro/license/{name})
|
|
153
|
+
* 2. @aios-fullstack/pro package (brownfield: node_modules/@aios-fullstack/pro/license/{name})
|
|
154
|
+
* 3. Absolute path via aios-core in node_modules (brownfield upgrade)
|
|
155
|
+
* 4. Absolute path via @aios-fullstack/pro in user project (npx context)
|
|
156
|
+
*
|
|
157
|
+
* Path 4 is critical for npx execution: when running `npx aios-core install`,
|
|
158
|
+
* require() resolves from the npx temp directory, not process.cwd(). After
|
|
159
|
+
* bootstrap installs @aios-fullstack/pro in the user's project, only an
|
|
160
|
+
* absolute path to process.cwd()/node_modules/@aios-fullstack/pro/... works.
|
|
161
|
+
*
|
|
162
|
+
* @param {string} moduleName - Module filename without extension (e.g., 'license-api')
|
|
163
|
+
* @returns {Object|null} Loaded module or null
|
|
164
|
+
*/
|
|
165
|
+
function loadProModule(moduleName) {
|
|
166
|
+
const path = require('path');
|
|
167
|
+
|
|
168
|
+
// 1. Framework-dev mode (cloned repo with pro/ submodule)
|
|
169
|
+
try {
|
|
170
|
+
return require(`../../../../pro/license/${moduleName}`);
|
|
171
|
+
} catch { /* not available */ }
|
|
172
|
+
|
|
173
|
+
// 2. @aios-fullstack/pro package (works when aios-core is a local dependency)
|
|
174
|
+
try {
|
|
175
|
+
return require(`@aios-fullstack/pro/license/${moduleName}`);
|
|
176
|
+
} catch { /* not available */ }
|
|
177
|
+
|
|
178
|
+
// 3. aios-core in node_modules (brownfield upgrade from >= v4.2.15)
|
|
179
|
+
try {
|
|
180
|
+
const absPath = path.join(process.cwd(), 'node_modules', 'aios-core', 'pro', 'license', moduleName);
|
|
181
|
+
return require(absPath);
|
|
182
|
+
} catch { /* not available */ }
|
|
183
|
+
|
|
184
|
+
// 4. @aios-fullstack/pro in user project (npx context — require resolves from
|
|
185
|
+
// temp dir, so we need absolute path to where bootstrap installed the package)
|
|
186
|
+
try {
|
|
187
|
+
const absPath = path.join(process.cwd(), 'node_modules', '@aios-fullstack', 'pro', 'license', moduleName);
|
|
188
|
+
return require(absPath);
|
|
189
|
+
} catch { /* not available */ }
|
|
190
|
+
|
|
191
|
+
return null;
|
|
192
|
+
}
|
|
193
|
+
|
|
148
194
|
/**
|
|
149
195
|
* Try to load the license API client via lazy import.
|
|
196
|
+
* Attempts multiple resolution paths for framework-dev, greenfield, and brownfield.
|
|
150
197
|
*
|
|
151
198
|
* @returns {{ LicenseApiClient: Function, licenseApi: Object }|null} License API or null
|
|
152
199
|
*/
|
|
153
200
|
function loadLicenseApi() {
|
|
154
|
-
|
|
155
|
-
return require('../../../../pro/license/license-api');
|
|
156
|
-
} catch {
|
|
157
|
-
return null;
|
|
158
|
-
}
|
|
201
|
+
return loadProModule('license-api');
|
|
159
202
|
}
|
|
160
203
|
|
|
161
204
|
/**
|
|
162
205
|
* Try to load the feature gate via lazy import.
|
|
206
|
+
* Attempts multiple resolution paths for framework-dev, greenfield, and brownfield.
|
|
163
207
|
*
|
|
164
208
|
* @returns {{ featureGate: Object }|null} Feature gate or null
|
|
165
209
|
*/
|
|
166
210
|
function loadFeatureGate() {
|
|
167
|
-
|
|
168
|
-
return require('../../../../pro/license/feature-gate');
|
|
169
|
-
} catch {
|
|
170
|
-
return null;
|
|
171
|
-
}
|
|
211
|
+
return loadProModule('feature-gate');
|
|
172
212
|
}
|
|
173
213
|
|
|
174
214
|
/**
|
|
@@ -1192,6 +1232,48 @@ async function runProWizard(options = {}) {
|
|
|
1192
1232
|
showProHeader();
|
|
1193
1233
|
}
|
|
1194
1234
|
|
|
1235
|
+
// Pre-check: If license module is not available (brownfield upgrade from older version),
|
|
1236
|
+
// install @aios-fullstack/pro first to get the license API, then proceed with gate.
|
|
1237
|
+
if (!loadLicenseApi()) {
|
|
1238
|
+
const fs = require('fs');
|
|
1239
|
+
const path = require('path');
|
|
1240
|
+
const { execSync } = require('child_process');
|
|
1241
|
+
|
|
1242
|
+
showInfo(t('proModuleBootstrap'));
|
|
1243
|
+
|
|
1244
|
+
// Ensure package.json exists
|
|
1245
|
+
const packageJsonPath = path.join(targetDir, 'package.json');
|
|
1246
|
+
if (!fs.existsSync(packageJsonPath)) {
|
|
1247
|
+
execSync('npm init -y', { cwd: targetDir, stdio: 'pipe' });
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
// Install @aios-fullstack/pro to get license module
|
|
1251
|
+
const proDir = path.join(targetDir, 'node_modules', '@aios-fullstack', 'pro');
|
|
1252
|
+
if (!fs.existsSync(proDir)) {
|
|
1253
|
+
const installSpinner = createSpinner(t('proInstallingPackage'));
|
|
1254
|
+
installSpinner.start();
|
|
1255
|
+
try {
|
|
1256
|
+
execSync('npm install @aios-fullstack/pro', {
|
|
1257
|
+
cwd: targetDir,
|
|
1258
|
+
stdio: 'pipe',
|
|
1259
|
+
timeout: 120000,
|
|
1260
|
+
});
|
|
1261
|
+
installSpinner.succeed(t('proPackageInstalled'));
|
|
1262
|
+
} catch (err) {
|
|
1263
|
+
installSpinner.fail(t('proPackageInstallFailed'));
|
|
1264
|
+
result.error = tf('proNpmInstallFailed', { message: err.message });
|
|
1265
|
+
return result;
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
// Clear require cache so loadLicenseApi() picks up newly installed module
|
|
1270
|
+
Object.keys(require.cache).forEach((key) => {
|
|
1271
|
+
if (key.includes('license-api') || key.includes('@aios-fullstack')) {
|
|
1272
|
+
delete require.cache[key];
|
|
1273
|
+
}
|
|
1274
|
+
});
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1195
1277
|
// Step 1: License Gate
|
|
1196
1278
|
const licenseResult = await stepLicenseGate({
|
|
1197
1279
|
key: options.key || process.env.AIOS_PRO_KEY,
|
|
@@ -1255,6 +1337,7 @@ module.exports = {
|
|
|
1255
1337
|
stepLicenseGateWithKey,
|
|
1256
1338
|
stepLicenseGateWithKeyInteractive,
|
|
1257
1339
|
stepLicenseGateWithEmail,
|
|
1340
|
+
loadProModule,
|
|
1258
1341
|
loadLicenseApi,
|
|
1259
1342
|
loadFeatureGate,
|
|
1260
1343
|
loadProScaffolder,
|