create-video 4.0.37 → 4.0.38

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/init.js CHANGED
@@ -65,7 +65,7 @@ const getGitStatus = async (root) => {
65
65
  }
66
66
  };
67
67
  const init = async () => {
68
- var _a, _b, _c, _d, _e, _f;
68
+ var _a, _b, _c, _d, _e, _f, _g, _h;
69
69
  const result = await (0, exports.checkGitAvailability)(process.cwd(), 'git', [
70
70
  '--version',
71
71
  ]);
@@ -138,6 +138,17 @@ const init = async () => {
138
138
  (_d = promise.stdout) === null || _d === void 0 ? void 0 : _d.pipe(process.stdout);
139
139
  await promise;
140
140
  }
141
+ else if (pkgManager === 'bun') {
142
+ log_1.Log.info('> bun install');
143
+ const promise = (0, execa_1.default)('bun', ['install'], {
144
+ cwd: projectRoot,
145
+ stdio: 'inherit',
146
+ env: { ...process.env, ADBLOCK: '1', DISABLE_OPENCOLLECTIVE: '1' },
147
+ });
148
+ (_e = promise.stderr) === null || _e === void 0 ? void 0 : _e.pipe(process.stderr);
149
+ (_f = promise.stdout) === null || _f === void 0 ? void 0 : _f.pipe(process.stdout);
150
+ await promise;
151
+ }
141
152
  else {
142
153
  log_1.Log.info('> npm install');
143
154
  const promise = (0, execa_1.default)('npm', ['install', '--no-fund'], {
@@ -145,8 +156,8 @@ const init = async () => {
145
156
  cwd: projectRoot,
146
157
  env: { ...process.env, ADBLOCK: '1', DISABLE_OPENCOLLECTIVE: '1' },
147
158
  });
148
- (_e = promise.stderr) === null || _e === void 0 ? void 0 : _e.pipe(process.stderr);
149
- (_f = promise.stdout) === null || _f === void 0 ? void 0 : _f.pipe(process.stdout);
159
+ (_g = promise.stderr) === null || _g === void 0 ? void 0 : _g.pipe(process.stderr);
160
+ (_h = promise.stdout) === null || _h === void 0 ? void 0 : _h.pipe(process.stdout);
150
161
  await promise;
151
162
  }
152
163
  await getGitStatus(projectRoot);
@@ -1,10 +1,10 @@
1
1
  import type { Template } from './templates';
2
- export type PackageManager = 'npm' | 'yarn' | 'pnpm';
2
+ export type PackageManager = 'npm' | 'yarn' | 'pnpm' | 'bun';
3
3
  export declare const selectPackageManager: () => PackageManager;
4
- export declare const getInstallCommand: (manager: PackageManager) => "yarn" | "npm i" | "pnpm i" | undefined;
4
+ export declare const getInstallCommand: (manager: PackageManager) => "yarn" | "npm i" | "pnpm i" | "bun install" | undefined;
5
5
  export declare const getDevCommand: (manager: PackageManager, template: Template) => string | undefined;
6
6
  export declare const getRenderCommandForTemplate: (manager: PackageManager, template: Template) => string | undefined;
7
- export declare const getRenderCommand: (manager: PackageManager) => "npm run build" | "yarn build" | "pnpm build" | undefined;
8
- export declare const getRunCommand: (manager: PackageManager) => "npm run" | "yarn run" | "pnpm run";
7
+ export declare const getRenderCommand: (manager: PackageManager) => "npm run build" | "yarn build" | "pnpm build" | "bun run build" | undefined;
8
+ export declare const getRunCommand: (manager: PackageManager) => "npm run" | "yarn run" | "pnpm run" | "bun run";
9
9
  export declare const getPackageManagerVersion: (manager: PackageManager) => Promise<string>;
10
10
  export declare const getPackageManagerVersionOrNull: (manager: PackageManager) => Promise<string | null>;
@@ -6,6 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getPackageManagerVersionOrNull = exports.getPackageManagerVersion = exports.getRunCommand = exports.getRenderCommand = exports.getRenderCommandForTemplate = exports.getDevCommand = exports.getInstallCommand = exports.selectPackageManager = void 0;
7
7
  const node_child_process_1 = require("node:child_process");
8
8
  const node_path_1 = __importDefault(require("node:path"));
9
+ const shouldUseBun = () => {
10
+ var _a;
11
+ if ((_a = process.env._) === null || _a === void 0 ? void 0 : _a.endsWith('/bin/bun')) {
12
+ return true;
13
+ }
14
+ return false;
15
+ };
9
16
  const shouldUseYarn = () => {
10
17
  var _a, _b;
11
18
  return Boolean(((_a = process.env.npm_execpath) === null || _a === void 0 ? void 0 : _a.includes('yarn.js')) ||
@@ -33,6 +40,9 @@ const selectPackageManager = () => {
33
40
  if (shouldUsePnpm()) {
34
41
  return 'pnpm';
35
42
  }
43
+ if (shouldUseBun()) {
44
+ return 'bun';
45
+ }
36
46
  return 'npm';
37
47
  };
38
48
  exports.selectPackageManager = selectPackageManager;
@@ -46,6 +56,9 @@ const getInstallCommand = (manager) => {
46
56
  if (manager === 'pnpm') {
47
57
  return `pnpm i`;
48
58
  }
59
+ if (manager === 'bun') {
60
+ return `bun install`;
61
+ }
49
62
  };
50
63
  exports.getInstallCommand = getInstallCommand;
51
64
  const getDevCommand = (manager, template) => {
@@ -75,6 +88,9 @@ const getStartCommand = (manager) => {
75
88
  if (manager === 'pnpm') {
76
89
  return `pnpm start`;
77
90
  }
91
+ if (manager === 'bun') {
92
+ return `bun start`;
93
+ }
78
94
  };
79
95
  const getRenderCommand = (manager) => {
80
96
  if (manager === 'npm') {
@@ -86,6 +102,9 @@ const getRenderCommand = (manager) => {
86
102
  if (manager === 'pnpm') {
87
103
  return `pnpm build`;
88
104
  }
105
+ if (manager === 'bun') {
106
+ return `bun run build`;
107
+ }
89
108
  };
90
109
  exports.getRenderCommand = getRenderCommand;
91
110
  const getRunCommand = (manager) => {
@@ -98,6 +117,9 @@ const getRunCommand = (manager) => {
98
117
  if (manager === 'pnpm') {
99
118
  return `pnpm run`;
100
119
  }
120
+ if (manager === 'bun') {
121
+ return `bun run`;
122
+ }
101
123
  throw new TypeError('unknown package manager');
102
124
  };
103
125
  exports.getRunCommand = getRunCommand;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const vitest_1 = require("vitest");
4
4
  const patch_package_json_1 = require("../patch-package-json");
5
- const packageManagers = ['npm', 'pnpm', 'yarn'];
5
+ const packageManagers = ['npm', 'pnpm', 'yarn', 'bun'];
6
6
  for (const packageManager of packageManagers) {
7
7
  (0, vitest_1.test)(`Using ${packageManager} package manager provides the correct "packageManager" entry in package.json`, () => {
8
8
  const latestRemotionVersion = '1.0.0';
@@ -62,6 +62,13 @@ const getFileForTemplate = (template, file) => {
62
62
  });
63
63
  (0, vitest_1.expect)(res.statusCode).toBe(404);
64
64
  }, 12000);
65
+ (0, vitest_1.it)(template.shortName + ' should not have a bun.lockb', async () => {
66
+ const packageLockJson = getFileForTemplate(template, 'bun.lockb');
67
+ const res = await (0, got_1.default)(packageLockJson, {
68
+ throwHttpErrors: false,
69
+ });
70
+ (0, vitest_1.expect)(res.statusCode).toBe(404);
71
+ }, 12000);
65
72
  (0, vitest_1.it)(template.shortName + ' should not have a standard entry point', async () => {
66
73
  const { contents, entryPoint } = await findFile([
67
74
  getFileForTemplate(template, 'src/index.ts'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-video",
3
- "version": "4.0.37",
3
+ "version": "4.0.38",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "bin": {