create-ifc-lite 1.1.3 → 1.1.4
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/dist/index.js +15 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10,6 +10,15 @@ const TEMPLATES = {
|
|
|
10
10
|
};
|
|
11
11
|
const REPO_URL = 'https://github.com/louistrue/ifc-lite';
|
|
12
12
|
const VIEWER_PATH = 'apps/viewer';
|
|
13
|
+
function getLatestVersion() {
|
|
14
|
+
try {
|
|
15
|
+
const result = execSync('npm view @ifc-lite/parser version', { stdio: 'pipe' });
|
|
16
|
+
return `^${result.toString().trim()}`;
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return '^1.0.0'; // fallback
|
|
20
|
+
}
|
|
21
|
+
}
|
|
13
22
|
function printUsage() {
|
|
14
23
|
console.log(`
|
|
15
24
|
create-ifc-lite - Create IFC-Lite projects instantly
|
|
@@ -83,18 +92,14 @@ function fixPackageJson(targetDir, projectName) {
|
|
|
83
92
|
let pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
84
93
|
// Update name
|
|
85
94
|
pkg.name = projectName;
|
|
86
|
-
// Replace workspace:* with npm
|
|
95
|
+
// Replace workspace:* with latest npm version
|
|
96
|
+
const latestVersion = getLatestVersion();
|
|
87
97
|
const deps = pkg.dependencies || {};
|
|
88
98
|
for (const [name, version] of Object.entries(deps)) {
|
|
89
99
|
if (version === 'workspace:*' && name.startsWith('@ifc-lite/')) {
|
|
90
|
-
deps[name] =
|
|
100
|
+
deps[name] = latestVersion;
|
|
91
101
|
}
|
|
92
102
|
}
|
|
93
|
-
// Remove internal dependencies that aren't published
|
|
94
|
-
delete deps['@ifc-lite/cache'];
|
|
95
|
-
delete deps['@ifc-lite/export'];
|
|
96
|
-
delete deps['@ifc-lite/query'];
|
|
97
|
-
delete deps['@ifc-lite/spatial'];
|
|
98
103
|
// Remove git directory if present
|
|
99
104
|
const gitDir = join(targetDir, '.git');
|
|
100
105
|
if (existsSync(gitDir)) {
|
|
@@ -161,17 +166,18 @@ async function main() {
|
|
|
161
166
|
console.log();
|
|
162
167
|
}
|
|
163
168
|
function createBasicTemplate(targetDir, projectName) {
|
|
169
|
+
const latestVersion = getLatestVersion();
|
|
164
170
|
// package.json
|
|
165
171
|
writeFileSync(join(targetDir, 'package.json'), JSON.stringify({
|
|
166
172
|
name: projectName,
|
|
167
|
-
version: '1.1.
|
|
173
|
+
version: '1.1.4',
|
|
168
174
|
type: 'module',
|
|
169
175
|
scripts: {
|
|
170
176
|
parse: 'npx tsx src/index.ts',
|
|
171
177
|
build: 'tsc',
|
|
172
178
|
},
|
|
173
179
|
dependencies: {
|
|
174
|
-
'@ifc-lite/parser':
|
|
180
|
+
'@ifc-lite/parser': latestVersion,
|
|
175
181
|
},
|
|
176
182
|
devDependencies: {
|
|
177
183
|
typescript: '^5.3.0',
|