create-turbo 1.6.0 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -14,10 +14,7 @@ var __copyProps = (to, from, except, desc) => {
14
14
  }
15
15
  return to;
16
16
  };
17
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
18
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
19
- mod
20
- ));
17
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
21
18
 
22
19
  // src/index.ts
23
20
  var path2 = __toESM(require("path"));
@@ -34,17 +31,17 @@ var import_chalk = __toESM(require("chalk"));
34
31
  // package.json
35
32
  var package_default = {
36
33
  name: "create-turbo",
37
- version: "1.6.0",
34
+ version: "1.6.2",
38
35
  description: "Create a new Turborepo",
39
36
  homepage: "https://turborepo.org",
40
37
  license: "MPL-2.0",
41
38
  repository: {
42
39
  type: "git",
43
- url: "https://github.com/vercel/turborepo",
40
+ url: "https://github.com/vercel/turbo",
44
41
  directory: "packages/create-turbo"
45
42
  },
46
43
  bugs: {
47
- url: "https://github.com/vercel/turborepo/issues"
44
+ url: "https://github.com/vercel/turbo/issues"
48
45
  },
49
46
  bin: {
50
47
  "create-turbo": "dist/index.js"
@@ -275,21 +272,16 @@ async function run() {
275
272
  >>> TURBOREPO
276
273
  `)));
277
274
  await new Promise((resolve2) => setTimeout(resolve2, 500));
278
- console.log(
279
- ">>> Welcome to Turborepo! Let's get you set up with a new codebase."
280
- );
275
+ console.log(">>> Welcome to Turborepo! Let's get you set up with a new codebase.");
281
276
  console.log();
282
- let projectDir = path2.resolve(
283
- process.cwd(),
284
- input.length > 0 ? input[0] : (await import_inquirer.default.prompt([
285
- {
286
- type: "input",
287
- name: "dir",
288
- message: "Where would you like to create your turborepo?",
289
- default: "./my-turborepo"
290
- }
291
- ])).dir
292
- );
277
+ let projectDir = path2.resolve(process.cwd(), input.length > 0 ? input[0] : (await import_inquirer.default.prompt([
278
+ {
279
+ type: "input",
280
+ name: "dir",
281
+ message: "Where would you like to create your turborepo?",
282
+ default: "./my-turborepo"
283
+ }
284
+ ])).dir);
293
285
  const projectName = path2.basename(projectDir);
294
286
  const isYarnInstalled = shouldUseYarn();
295
287
  const isPnpmInstalled = shouldUsePnpm();
@@ -326,9 +318,7 @@ async function run() {
326
318
  let projectDirIsCurrentDir = relativeProjectDir === "";
327
319
  if (!projectDirIsCurrentDir) {
328
320
  if (import_fs.default.existsSync(projectDir) && import_fs.default.readdirSync(projectDir).length !== 0) {
329
- console.log(
330
- `\uFE0F\u{1F6A8} Oops, "${relativeProjectDir}" already exists. Please try again with a different directory.`
331
- );
321
+ console.log(`\uFE0F\u{1F6A8} Oops, "${relativeProjectDir}" already exists. Please try again with a different directory.`);
332
322
  process.exit(1);
333
323
  } else {
334
324
  import_fs.default.mkdirSync(projectDir, { recursive: true });
@@ -338,27 +328,18 @@ async function run() {
338
328
  import_fs.default.cpSync(sharedTemplate, projectDir, { recursive: true });
339
329
  let packageManagerVersion = getPackageManagerVersion(answers.packageManager);
340
330
  let packageManagerConfigs = PACKAGE_MANAGERS[answers.packageManager];
341
- let packageManager = packageManagerConfigs.find(
342
- (packageManager2) => (0, import_semver.satisfies)(packageManagerVersion, packageManager2.semver)
343
- );
331
+ let packageManager = packageManagerConfigs.find((packageManager2) => (0, import_semver.satisfies)(packageManagerVersion, packageManager2.semver));
344
332
  if (!packageManager) {
345
333
  throw new Error("Unsupported package manager version.");
346
334
  }
347
- let packageManagerTemplate = path2.resolve(
348
- __dirname,
349
- "../templates",
350
- packageManager.template
351
- );
335
+ let packageManagerTemplate = path2.resolve(__dirname, "../templates", packageManager.template);
352
336
  if (import_fs.default.existsSync(packageManagerTemplate)) {
353
337
  import_fs.default.cpSync(packageManagerTemplate, projectDir, {
354
338
  recursive: true,
355
339
  force: true
356
340
  });
357
341
  }
358
- import_fs.default.renameSync(
359
- path2.join(projectDir, "gitignore"),
360
- path2.join(projectDir, ".gitignore")
361
- );
342
+ import_fs.default.renameSync(path2.join(projectDir, "gitignore"), path2.join(projectDir, ".gitignore"));
362
343
  let sharedPkg = require(path2.join(sharedTemplate, "package.json"));
363
344
  let projectPkg = require(path2.join(projectDir, "package.json"));
364
345
  ["dependencies", "devDependencies"].forEach((pkgKey) => {
@@ -369,26 +350,15 @@ async function run() {
369
350
  });
370
351
  sharedPkg.packageManager = `${packageManager.command}@${packageManagerVersion}`;
371
352
  sharedPkg.name = projectName;
372
- import_fs.default.writeFileSync(
373
- path2.join(projectDir, "package.json"),
374
- JSON.stringify(sharedPkg, null, 2)
375
- );
353
+ import_fs.default.writeFileSync(path2.join(projectDir, "package.json"), JSON.stringify(sharedPkg, null, 2));
376
354
  console.log();
377
355
  console.log(`>>> Created a new turborepo with the following:`);
378
356
  console.log();
379
357
  console.log(` - ${import_chalk.default.bold("apps/web")}: Next.js with TypeScript`);
380
358
  console.log(` - ${import_chalk.default.bold("apps/docs")}: Next.js with TypeScript`);
381
- console.log(
382
- ` - ${import_chalk.default.bold("packages/ui")}: Shared React component library`
383
- );
384
- console.log(
385
- ` - ${import_chalk.default.bold(
386
- "packages/eslint-config-custom"
387
- )}: Shared configuration (ESLint)`
388
- );
389
- console.log(
390
- ` - ${import_chalk.default.bold("packages/tsconfig")}: Shared TypeScript \`tsconfig.json\``
391
- );
359
+ console.log(` - ${import_chalk.default.bold("packages/ui")}: Shared React component library`);
360
+ console.log(` - ${import_chalk.default.bold("packages/eslint-config-custom")}: Shared configuration (ESLint)`);
361
+ console.log(` - ${import_chalk.default.bold("packages/tsconfig")}: Shared TypeScript \`tsconfig.json\``);
392
362
  console.log();
393
363
  if (flags.install) {
394
364
  const spinner = (0, import_ora.default)({
@@ -406,18 +376,10 @@ async function run() {
406
376
  process.chdir(projectDir);
407
377
  tryGitInit(relativeProjectDir);
408
378
  if (projectDirIsCurrentDir) {
409
- console.log(
410
- `${import_chalk.default.bold(
411
- turboGradient(">>> Success!")
412
- )} Your new Turborepo is ready.`
413
- );
379
+ console.log(`${import_chalk.default.bold(turboGradient(">>> Success!"))} Your new Turborepo is ready.`);
414
380
  console.log("Inside this directory, you can run several commands:");
415
381
  } else {
416
- console.log(
417
- `${import_chalk.default.bold(
418
- turboGradient(">>> Success!")
419
- )} Created a new Turborepo at "${relativeProjectDir}".`
420
- );
382
+ console.log(`${import_chalk.default.bold(turboGradient(">>> Success!"))} Created a new Turborepo at "${relativeProjectDir}".`);
421
383
  console.log("Inside that directory, you can run several commands:");
422
384
  }
423
385
  console.log();
@@ -448,14 +410,8 @@ async function notifyUpdate() {
448
410
  if (res == null ? void 0 : res.latest) {
449
411
  const isYarn = shouldUseYarn();
450
412
  console.log();
451
- console.log(
452
- import_chalk.default.yellow.bold("A new version of `create-turbo` is available!")
453
- );
454
- console.log(
455
- "You can update by running: " + import_chalk.default.cyan(
456
- isYarn ? "yarn global add create-turbo" : "npm i -g create-turbo"
457
- )
458
- );
413
+ console.log(import_chalk.default.yellow.bold("A new version of `create-turbo` is available!"));
414
+ console.log("You can update by running: " + import_chalk.default.cyan(isYarn ? "yarn global add create-turbo" : "npm i -g create-turbo"));
459
415
  console.log();
460
416
  }
461
417
  process.exit();
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "create-turbo",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "description": "Create a new Turborepo",
5
5
  "homepage": "https://turborepo.org",
6
6
  "license": "MPL-2.0",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/vercel/turborepo",
9
+ "url": "https://github.com/vercel/turbo",
10
10
  "directory": "packages/create-turbo"
11
11
  },
12
12
  "bugs": {
13
- "url": "https://github.com/vercel/turborepo/issues"
13
+ "url": "https://github.com/vercel/turbo/issues"
14
14
  },
15
15
  "bin": {
16
16
  "create-turbo": "dist/index.js"
@@ -1,5 +1,6 @@
1
- const withTM = require("next-transpile-modules")(["ui"]);
2
-
3
- module.exports = withTM({
1
+ module.exports = {
4
2
  reactStrictMode: true,
5
- });
3
+ experimental: {
4
+ transpilePackages: ["ui"],
5
+ },
6
+ };
@@ -10,18 +10,18 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "next": "12.3.1",
13
- "react": "18.2.0",
14
- "react-dom": "18.2.0",
13
+ "react": "^18.2.0",
14
+ "react-dom": "^18.2.0",
15
15
  "ui": "*"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@babel/core": "^7.0.0",
19
19
  "eslint": "7.32.0",
20
20
  "eslint-config-custom": "*",
21
- "next-transpile-modules": "9.0.0",
22
21
  "tsconfig": "*",
23
22
  "@types/node": "^17.0.12",
24
- "@types/react": "18.0.17",
23
+ "@types/react": "^18.0.22",
24
+ "@types/react-dom": "^18.0.7",
25
25
  "typescript": "^4.5.3"
26
26
  }
27
27
  }
@@ -1,5 +1,6 @@
1
- const withTM = require("next-transpile-modules")(["ui"]);
2
-
3
- module.exports = withTM({
1
+ module.exports = {
4
2
  reactStrictMode: true,
5
- });
3
+ experimental: {
4
+ transpilePackages: ["ui"],
5
+ },
6
+ };
@@ -10,18 +10,18 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "next": "12.3.1",
13
- "react": "18.2.0",
14
- "react-dom": "18.2.0",
13
+ "react": "^18.2.0",
14
+ "react-dom": "^18.2.0",
15
15
  "ui": "*"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@babel/core": "^7.0.0",
19
19
  "eslint": "7.32.0",
20
20
  "eslint-config-custom": "*",
21
- "next-transpile-modules": "9.0.0",
22
21
  "tsconfig": "*",
23
22
  "@types/node": "^17.0.12",
24
- "@types/react": "18.0.17",
23
+ "@types/react": "^18.0.22",
24
+ "@types/react-dom": "^18.0.7",
25
25
  "typescript": "^4.5.3"
26
26
  }
27
27
  }
@@ -18,10 +18,10 @@
18
18
  "@babel/core": "^7.0.0",
19
19
  "eslint-config-custom": "workspace:*",
20
20
  "eslint": "7.32.0",
21
- "next-transpile-modules": "9.0.0",
22
21
  "tsconfig": "workspace:*",
23
22
  "@types/node": "^17.0.12",
24
- "@types/react": "18.0.17",
23
+ "@types/react": "^18.0.22",
24
+ "@types/react-dom": "^18.0.7",
25
25
  "typescript": "^4.5.3"
26
26
  }
27
27
  }
@@ -9,7 +9,7 @@
9
9
  "lint": "next lint"
10
10
  },
11
11
  "dependencies": {
12
- "next": "12.3.1",
12
+ "next": "12.3.2-canary.40",
13
13
  "react": "18.2.0",
14
14
  "react-dom": "18.2.0",
15
15
  "ui": "workspace:*"
@@ -18,10 +18,10 @@
18
18
  "@babel/core": "^7.0.0",
19
19
  "eslint-config-custom": "workspace:*",
20
20
  "eslint": "7.32.0",
21
- "next-transpile-modules": "9.0.0",
22
21
  "tsconfig": "workspace:*",
23
22
  "@types/node": "^17.0.12",
24
- "@types/react": "18.0.17",
23
+ "@types/react": "^18.0.22",
24
+ "@types/react-dom": "^18.0.7",
25
25
  "typescript": "^4.5.3"
26
26
  }
27
27
  }