Add .gitignore to exclude all node packages and lock files
This commit is contained in:
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
export declare const getFileSource: (remotionRoot: string, p: string) => Promise<string>;
|
||||
Generated
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getFileSource = void 0;
|
||||
const node_fs_1 = __importDefault(require("node:fs"));
|
||||
const node_path_1 = __importDefault(require("node:path"));
|
||||
const allowedFileExtensions = ['js', 'ts', 'tsx', 'jsx', 'map', 'mjs'];
|
||||
// Must be async function for proper error handling
|
||||
const getFileSource = (remotionRoot, p) => {
|
||||
if (!allowedFileExtensions.find((extension) => p.endsWith(extension))) {
|
||||
return Promise.reject(new Error(`Not allowed to open ${p}`));
|
||||
}
|
||||
const resolved = node_path_1.default.resolve(remotionRoot, p);
|
||||
const relativeToProcessCwd = node_path_1.default.relative(remotionRoot, resolved);
|
||||
if (relativeToProcessCwd.startsWith('..')) {
|
||||
return Promise.reject(new Error(`Not allowed to open ${relativeToProcessCwd}`));
|
||||
}
|
||||
return node_fs_1.default.promises.readFile(p, 'utf-8');
|
||||
};
|
||||
exports.getFileSource = getFileSource;
|
||||
Generated
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
export declare const getInstalledDependencies: (remotionRoot: string) => {
|
||||
dependencies: string[];
|
||||
devDependencies: string[];
|
||||
optionalDependencies: string[];
|
||||
peerDependencies: string[];
|
||||
};
|
||||
Generated
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getInstalledDependencies = void 0;
|
||||
const node_fs_1 = __importDefault(require("node:fs"));
|
||||
const node_path_1 = __importDefault(require("node:path"));
|
||||
const getInstalledDependencies = (remotionRoot) => {
|
||||
var _a, _b, _c, _d;
|
||||
const packageJsonFilePath = node_path_1.default.join(remotionRoot, 'package.json');
|
||||
const packageJson = JSON.parse(node_fs_1.default.readFileSync(packageJsonFilePath, 'utf-8'));
|
||||
const dependencies = Object.keys((_a = packageJson.dependencies) !== null && _a !== void 0 ? _a : {});
|
||||
const devDependencies = Object.keys((_b = packageJson.devDependencies) !== null && _b !== void 0 ? _b : {});
|
||||
const optionalDependencies = Object.keys((_c = packageJson.optionalDependencies) !== null && _c !== void 0 ? _c : {});
|
||||
const peerDependencies = Object.keys((_d = packageJson.peerDependencies) !== null && _d !== void 0 ? _d : {});
|
||||
return {
|
||||
dependencies,
|
||||
devDependencies,
|
||||
optionalDependencies,
|
||||
peerDependencies,
|
||||
};
|
||||
};
|
||||
exports.getInstalledDependencies = getInstalledDependencies;
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
export declare const getInstalledInstallablePackages: (remotionRoot: string) => string[];
|
||||
Generated
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getInstalledInstallablePackages = void 0;
|
||||
const studio_shared_1 = require("@remotion/studio-shared");
|
||||
const get_installed_dependencies_1 = require("./get-installed-dependencies");
|
||||
const getInstalledInstallablePackages = (remotionRoot) => {
|
||||
const { dependencies, devDependencies, optionalDependencies } = (0, get_installed_dependencies_1.getInstalledDependencies)(remotionRoot);
|
||||
const installablePackages = [
|
||||
...dependencies,
|
||||
...devDependencies,
|
||||
...optionalDependencies,
|
||||
];
|
||||
const remotionPackages = Object.entries(studio_shared_1.installableMap)
|
||||
.filter(([, _installable]) => _installable)
|
||||
.map(([pkg]) => (pkg === 'core' ? 'remotion' : `@remotion/${pkg}`))
|
||||
.filter((pkg) => installablePackages.includes(pkg));
|
||||
const installedExtraPackages = studio_shared_1.extraPackages
|
||||
.map((pkg) => pkg.name)
|
||||
.filter((pkg) => installablePackages.includes(pkg));
|
||||
return [...remotionPackages, ...installedExtraPackages];
|
||||
};
|
||||
exports.getInstalledInstallablePackages = getInstalledInstallablePackages;
|
||||
Generated
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
import type { PackageManager } from '@remotion/studio-shared';
|
||||
export declare const getInstallCommand: ({ manager, packages, version, additionalArgs, }: {
|
||||
manager: PackageManager;
|
||||
packages: string[];
|
||||
version: string;
|
||||
additionalArgs: string[];
|
||||
}) => string[];
|
||||
Generated
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getInstallCommand = void 0;
|
||||
const getInstallCommand = ({ manager, packages, version, additionalArgs, }) => {
|
||||
const pkgList = packages.map((p) => (version ? `${p}@${version}` : p));
|
||||
const commands = {
|
||||
npm: [
|
||||
'i',
|
||||
'--save-exact',
|
||||
'--no-fund',
|
||||
'--no-audit',
|
||||
...additionalArgs,
|
||||
...pkgList,
|
||||
],
|
||||
pnpm: ['i', ...additionalArgs, ...pkgList],
|
||||
yarn: ['add', '--exact', ...additionalArgs, ...pkgList],
|
||||
bun: ['i', ...additionalArgs, ...pkgList],
|
||||
};
|
||||
return commands[manager];
|
||||
};
|
||||
exports.getInstallCommand = getInstallCommand;
|
||||
Generated
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import type { LogLevel } from '@remotion/renderer';
|
||||
declare const editorNames: readonly ["atom", "/Applications/Atom Beta.app/Contents/MacOS/Atom Beta", "brackets", "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl", "/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl", "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl", "code", "code-insiders", "vscodium", "/Applications/AppCode.app/Contents/MacOS/appcode", "/Applications/CLion.app/Contents/MacOS/clion", "/Applications/IntelliJ IDEA.app/Contents/MacOS/idea", "/Applications/PhpStorm.app/Contents/MacOS/phpstorm", "/Applications/PyCharm.app/Contents/MacOS/pycharm", "/Applications/PyCharm CE.app/Contents/MacOS/pycharm", "/Applications/RubyMine.app/Contents/MacOS/rubymine", "/Applications/WebStorm.app/Contents/MacOS/webstorm", "/Applications/GoLand.app/Contents/MacOS/goland", "/Applications/Rider.app/Contents/MacOS/rider", "mvim", "emacs", "gvim", "idea", "phpstorm", "pycharm", "rubymine", "subl", "sublime_text", "vim", "webstorm", "goland", "rider", "Brackets.exe", "Code.exe", "Code - Insiders.exe", "VSCodium.exe", "atom.exe", "sublime_text.exe", "notepad++.exe", "clion.exe", "clion64.exe", "idea.exe", "idea64.exe", "phpstorm.exe", "phpstorm64.exe", "pycharm.exe", "pycharm64.exe", "rubymine.exe", "rubymine64.exe", "webstorm.exe", "webstorm64.exe", "goland.exe", "goland64.exe", "rider.exe", "rider64.exe", "nano", "cursor", "/Applications/Cursor.app/Contents/MacOS/Cursor", "Cursor.exe", "windsurf", "/Applications/Windsurf.app/Contents/MacOS/Windsurf", "Windsurf.exe", "zed"];
|
||||
export declare const getDisplayNameForEditor: (editor: Editor | null) => string | null;
|
||||
type Editor = (typeof editorNames)[number];
|
||||
type ProcessAndCommand = {
|
||||
process: string;
|
||||
command: Editor;
|
||||
};
|
||||
export declare function guessEditor(): Promise<ProcessAndCommand[]>;
|
||||
export declare function launchEditor({ colNumber, editor, fileName, lineNumber, vsCodeNewWindow, logLevel, }: {
|
||||
fileName: string;
|
||||
lineNumber: number;
|
||||
colNumber: number;
|
||||
editor: ProcessAndCommand;
|
||||
vsCodeNewWindow: boolean;
|
||||
logLevel: LogLevel;
|
||||
}): Promise<boolean>;
|
||||
export {};
|
||||
Generated
Vendored
+536
File diff suppressed because one or more lines are too long
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
export declare const resolveOutputPath: (remotionRoot: string, filePath: string) => string;
|
||||
Generated
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.resolveOutputPath = void 0;
|
||||
const node_path_1 = __importDefault(require("node:path"));
|
||||
const resolveOutputPath = (remotionRoot, filePath) => {
|
||||
const absolutePath = node_path_1.default.join(remotionRoot, filePath);
|
||||
const relativeToRoot = node_path_1.default.relative(remotionRoot, absolutePath);
|
||||
if (relativeToRoot.startsWith('..')) {
|
||||
throw new Error(`Not allowed to write to ${relativeToRoot}`);
|
||||
}
|
||||
return absolutePath;
|
||||
};
|
||||
exports.resolveOutputPath = resolveOutputPath;
|
||||
Reference in New Issue
Block a user