@papercraneai/cli 1.6.0-beta.0 → 1.6.0-beta.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/lib/dev-server.js +7 -3
- package/package.json +1 -1
package/lib/dev-server.js
CHANGED
|
@@ -5,8 +5,12 @@ import os from 'os';
|
|
|
5
5
|
import { fileURLToPath } from 'url';
|
|
6
6
|
import { execSync } from 'child_process';
|
|
7
7
|
|
|
8
|
+
import { createRequire } from 'module';
|
|
9
|
+
const require = createRequire(import.meta.url);
|
|
10
|
+
|
|
8
11
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
9
12
|
const cliRoot = path.resolve(__dirname, '..');
|
|
13
|
+
const cliVersion = require(path.join(cliRoot, 'package.json')).version;
|
|
10
14
|
|
|
11
15
|
// Local dev: running from source (e.g. tools/papercrane-cli/).
|
|
12
16
|
// Published: running from inside node_modules/@papercraneai/cli/.
|
|
@@ -277,7 +281,7 @@ export async function generateScaffolding(workspaceDir) {
|
|
|
277
281
|
const pkg = {
|
|
278
282
|
private: true,
|
|
279
283
|
dependencies: {
|
|
280
|
-
"@papercraneai/cli": isLocalDev ? `file:${cliRoot}` :
|
|
284
|
+
"@papercraneai/cli": isLocalDev ? `file:${cliRoot}` : cliVersion,
|
|
281
285
|
},
|
|
282
286
|
};
|
|
283
287
|
await fs.writeFile(pkgPath, JSON.stringify(pkg, null, 2), 'utf-8');
|
|
@@ -326,10 +330,10 @@ export async function generateScaffolding(workspaceDir) {
|
|
|
326
330
|
|
|
327
331
|
// next.config.mjs
|
|
328
332
|
const nextConfigPath = path.join(workspaceDir, 'next.config.mjs');
|
|
329
|
-
const transpileLine = isLocalDev ? ` transpilePackages: ['@papercraneai/cli'],\n` : '';
|
|
330
333
|
const nextConfig = `/** @type {import('next').NextConfig} */
|
|
331
334
|
const nextConfig = {
|
|
332
|
-
|
|
335
|
+
transpilePackages: ['@papercraneai/cli'],
|
|
336
|
+
turbopack: {
|
|
333
337
|
root: ${JSON.stringify(workspaceDir)},
|
|
334
338
|
},
|
|
335
339
|
};
|