@launchframe/cli 1.0.0-beta.22 → 1.0.0-beta.25
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/.claude/settings.local.json +2 -1
- package/package.json +2 -3
- package/src/commands/init.js +2 -0
- package/src/index.js +8 -0
- package/src/utils/variable-replacer.js +18 -23
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@launchframe/cli",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.25",
|
|
4
4
|
"description": "Production-ready B2B SaaS boilerplate with subscriptions, credits, and multi-tenancy",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"url": "https://github.com/launchframe/cli/issues"
|
|
35
35
|
},
|
|
36
36
|
"engines": {
|
|
37
|
-
"node": ">=
|
|
37
|
+
"node": ">=22.0.0"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"chalk": "^4.1.2",
|
|
44
44
|
"fs-extra": "^11.1.1",
|
|
45
|
-
"glob": "^10.3.10",
|
|
46
45
|
"inquirer": "^8.2.5"
|
|
47
46
|
}
|
|
48
47
|
}
|
package/src/commands/init.js
CHANGED
|
@@ -38,6 +38,8 @@ async function init(options = {}) {
|
|
|
38
38
|
|
|
39
39
|
if (!accessCheck.hasAccess) {
|
|
40
40
|
showAccessDeniedMessage();
|
|
41
|
+
trackEvent('command_executed', { command: 'init', success: false, error_message: 'access_denied' });
|
|
42
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
41
43
|
process.exit(1);
|
|
42
44
|
}
|
|
43
45
|
|
package/src/index.js
CHANGED
|
@@ -5,6 +5,14 @@ const { isLaunchFrameProject } = require('./utils/project-helpers');
|
|
|
5
5
|
const logger = require('./utils/logger');
|
|
6
6
|
const { initTelemetry, trackEvent, sanitize, setTelemetryEnabled, showTelemetryStatus } = require('./utils/telemetry');
|
|
7
7
|
|
|
8
|
+
// Detect locally linked version: npm link installs to global node_modules
|
|
9
|
+
// as a symlink. When running from a real install, __dirname is inside the
|
|
10
|
+
// global node_modules folder. When linked, it resolves to the source directory.
|
|
11
|
+
if (!__dirname.includes('node_modules')) {
|
|
12
|
+
const packageJson = require('../package.json');
|
|
13
|
+
console.log(chalk.yellow(`⚠ Running locally linked CLI v${packageJson.version} (${__dirname})`));
|
|
14
|
+
}
|
|
15
|
+
|
|
8
16
|
// Import commands
|
|
9
17
|
const { init } = require('./commands/init');
|
|
10
18
|
const { deployConfigure } = require('./commands/deploy-configure');
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
const fs = require('fs-extra');
|
|
2
|
+
const { glob } = require('node:fs');
|
|
2
3
|
const path = require('path');
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
const EXCLUDED_DIRS = new Set(['node_modules', '.git', '.next', 'dist', 'build']);
|
|
6
|
+
const BINARY_EXTENSIONS = new Set(['.png', '.jpg', '.jpeg', '.gif', '.ico', '.pdf', '.woff', '.woff2', '.ttf', '.eot']);
|
|
4
7
|
|
|
5
8
|
/**
|
|
6
9
|
* Replace template variables in all files within a directory
|
|
@@ -9,31 +12,23 @@ const { glob } = require('glob');
|
|
|
9
12
|
*/
|
|
10
13
|
async function replaceVariables(directory, variables) {
|
|
11
14
|
// Find all files (excluding node_modules, .git, binary files)
|
|
12
|
-
const files = await
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
'**/*.png',
|
|
23
|
-
'**/*.jpg',
|
|
24
|
-
'**/*.jpeg',
|
|
25
|
-
'**/*.gif',
|
|
26
|
-
'**/*.ico',
|
|
27
|
-
'**/*.pdf',
|
|
28
|
-
'**/*.woff',
|
|
29
|
-
'**/*.woff2',
|
|
30
|
-
'**/*.ttf',
|
|
31
|
-
'**/*.eot'
|
|
32
|
-
]
|
|
15
|
+
const files = await new Promise((resolve, reject) => {
|
|
16
|
+
glob('**/*', {
|
|
17
|
+
cwd: directory,
|
|
18
|
+
exclude: (name) => EXCLUDED_DIRS.has(name),
|
|
19
|
+
}, (err, matches) => err ? reject(err) : resolve(matches));
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const filtered = files.filter(f => {
|
|
23
|
+
const ext = path.extname(f).toLowerCase();
|
|
24
|
+
return !BINARY_EXTENSIONS.has(ext);
|
|
33
25
|
});
|
|
34
26
|
|
|
35
|
-
for (const file of
|
|
27
|
+
for (const file of filtered) {
|
|
36
28
|
const filePath = path.join(directory, file);
|
|
29
|
+
// Skip directories (fs.glob includes them unlike third-party glob packages)
|
|
30
|
+
const stat = await fs.stat(filePath);
|
|
31
|
+
if (stat.isDirectory()) continue;
|
|
37
32
|
await replaceVariablesInFile(filePath, variables);
|
|
38
33
|
}
|
|
39
34
|
}
|