create-ifc-lite 1.1.4 → 1.1.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.
Files changed (2) hide show
  1. package/dist/index.js +59 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -107,6 +107,64 @@ function fixPackageJson(targetDir, projectName) {
107
107
  }
108
108
  writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
109
109
  }
110
+ function fixTsConfig(targetDir) {
111
+ const tsconfigPath = join(targetDir, 'tsconfig.json');
112
+ // Write standalone tsconfig without monorepo references
113
+ const tsconfig = {
114
+ compilerOptions: {
115
+ target: 'ES2022',
116
+ lib: ['ES2022', 'DOM', 'DOM.Iterable'],
117
+ module: 'ESNext',
118
+ moduleResolution: 'bundler',
119
+ jsx: 'react-jsx',
120
+ strict: true,
121
+ esModuleInterop: true,
122
+ skipLibCheck: true,
123
+ noEmit: true,
124
+ baseUrl: '.',
125
+ paths: {
126
+ '@/*': ['./src/*']
127
+ }
128
+ },
129
+ include: ['src/**/*'],
130
+ exclude: ['node_modules']
131
+ };
132
+ writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 2));
133
+ }
134
+ function fixViteConfig(targetDir) {
135
+ const viteConfigPath = join(targetDir, 'vite.config.ts');
136
+ // Write standalone vite config - packages resolve from node_modules
137
+ const viteConfig = `import { defineConfig } from 'vite';
138
+ import react from '@vitejs/plugin-react';
139
+ import path from 'path';
140
+
141
+ export default defineConfig({
142
+ plugins: [react()],
143
+ resolve: {
144
+ alias: {
145
+ '@': path.resolve(__dirname, './src'),
146
+ },
147
+ },
148
+ server: {
149
+ port: 3000,
150
+ open: true,
151
+ },
152
+ build: {
153
+ target: 'esnext',
154
+ },
155
+ optimizeDeps: {
156
+ exclude: ['@duckdb/duckdb-wasm'],
157
+ },
158
+ assetsInclude: ['**/*.wasm'],
159
+ });
160
+ `;
161
+ writeFileSync(viteConfigPath, viteConfig);
162
+ }
163
+ function fixViewerTemplate(targetDir, projectName) {
164
+ fixPackageJson(targetDir, projectName);
165
+ fixTsConfig(targetDir);
166
+ fixViteConfig(targetDir);
167
+ }
110
168
  async function main() {
111
169
  const args = process.argv.slice(2);
112
170
  if (args.includes('--help') || args.includes('-h')) {
@@ -142,7 +200,7 @@ async function main() {
142
200
  // Download the actual viewer from GitHub
143
201
  const success = await downloadViewer(targetDir, projectName);
144
202
  if (success) {
145
- fixPackageJson(targetDir, projectName);
203
+ fixViewerTemplate(targetDir, projectName);
146
204
  }
147
205
  else {
148
206
  console.error(' Failed to download viewer. Creating minimal fallback...');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ifc-lite",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "Create IFC-Lite projects with one command",
5
5
  "type": "module",
6
6
  "bin": {