Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@philidem/rewrite-relative-paths

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@philidem/rewrite-relative-paths - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

3

cli/rewrite-imports.js

@@ -33,2 +33,3 @@ #!/usr/bin/env node

monorepo: input.monorepo === true,
ignoreFiles: ['.gitignore', '.rewriteignore'],
});

@@ -39,2 +40,2 @@ }

});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmV3cml0ZS1pbXBvcnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaS9yZXdyaXRlLWltcG9ydHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBRUEsMEJBQTBCO0FBQzFCLGtEQUEwQjtBQUMxQixrREFBMEI7QUFDMUIsc0RBQXNEO0FBRXRELEtBQUssVUFBVSxHQUFHO0lBQ2hCLE1BQU0sS0FBSyxHQUFHLGVBQUs7U0FDaEIsTUFBTSxDQUFDLEdBQUcsRUFBRTtRQUNYLEtBQUssRUFBRSxLQUFLO1FBQ1osSUFBSSxFQUFFLFFBQVE7UUFDZCxRQUFRLEVBQUUsSUFBSTtLQUNmLENBQUM7U0FDRCxNQUFNLENBQUMsVUFBVSxFQUFFO1FBQ2xCLElBQUksRUFBRSxTQUFTO1FBQ2YsUUFBUSxFQUFFLEtBQUs7S0FDaEIsQ0FBQztTQUNELE1BQU0sQ0FBQyxHQUFHLEVBQUU7UUFDWCxLQUFLLEVBQUUsTUFBTTtRQUNiLElBQUksRUFBRSxTQUFTO0tBQ2hCLENBQUMsQ0FBQyxJQUtKLENBQUM7SUFFRixJQUFJLEtBQUssQ0FBQyxJQUFJLEVBQUU7UUFDZCxPQUFPLGVBQU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J0Vycm9yIHJ1bm5pbmcgY29tbWFuZCcpfS4gRXJyb3I6ICR7ZXJyLnN0YWNrfWApXG4gICk7XG59KTtcblwiLi4vcmV3cml0ZVJlcXVpcmVzXCIiXX0=
{
"name": "@philidem/rewrite-relative-paths",
"version": "1.2.1",
"version": "1.2.2",
"description": "Tool for making import paths relative to project root and making require paths relative",

@@ -5,0 +5,0 @@ "keywords": [

@@ -1,3 +0,3 @@

export declare function readIgnoreFiles(): Promise<{
export declare function readIgnoreFiles(ignoreFiles: string[]): Promise<{
isIgnored(file: string): boolean | "";
}>;

@@ -9,7 +9,7 @@ "use strict";

const ignore_1 = __importDefault(require("ignore"));
async function readIgnoreFiles() {
async function readIgnoreFiles(ignoreFiles) {
const ignoreChecker = (0, ignore_1.default)();
ignoreChecker.add('.git/');
ignoreChecker.add('node_modules/');
for (const file of ['.gitignore', '.rewriteignore']) {
for (const file of ignoreFiles) {
let fileContents;

@@ -31,2 +31,2 @@ try {

exports.readIgnoreFiles = readIgnoreFiles;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVhZElnbm9yZUZpbGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3JlYWRJZ25vcmVGaWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQSwyQkFBb0M7QUFDcEMsb0RBQTRCO0FBRXJCLEtBQUssVUFBVSxlQUFlO0lBQ25DLE1BQU0sYUFBYSxHQUFHLElBQUEsZ0JBQU0sR0FBRSxDQUFDO0lBQy9CLGFBQWEsQ0FBQyxHQUFHLENBQUMsT0FBTyxDQUFDLENBQUM7SUFDM0IsYUFBYSxDQUFDLEdBQUcsQ0FBQyxlQUFlLENBQUMsQ0FBQztJQUVuQyxLQUFLLE1BQU0sSUFBSSxJQUFJLENBQUMsWUFBWSxFQUFFLGdCQUFnQixDQUFDLEVBQUU7UUFDbkQsSUFBSSx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RixDQUFDO0FBQ0osQ0FBQztBQXJCRCwwQ0FxQkMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBwcm9taXNlcyBhcyBmcyB9IGZyb20gJ2ZzJztcbmltcG9ydCBpZ25vcmUgZnJvbSAnaWdub3JlJztcblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHJlYWRJZ25vcmVGaWxlcyhpZ25vcmVGaWxlczogc3RyaW5nW10pIHtcbiAgY29uc3QgaWdub3JlQ2hlY2tlciA9IGlnbm9yZSgpO1xuICBpZ25vcmVDaGVja2VyLmFkZCgnLmdpdC8nKTtcbiAgaWdub3JlQ2hlY2tlci5hZGQoJ25vZGVfbW9kdWxlcy8nKTtcblxuICBmb3IgKGNvbnN0IGZpbGUgb2YgaWdub3JlRmlsZXMpIHtcbiAgICBsZXQgZmlsZUNvbnRlbnRzOiBzdHJpbmc7XG4gICAgdHJ5IHtcbiAgICAgIGZpbGVDb250ZW50cyA9IGF3YWl0IGZzLnJlYWRGaWxlKGZpbGUsIHsgZW5jb2Rpbmc6ICd1dGY4JyB9KTtcbiAgICB9IGNhdGNoIChlcnIpIHtcbiAgICAgIGNvbnRpbnVlO1xuICAgIH1cblxuICAgIGlnbm9yZUNoZWNrZXIuYWRkKGZpbGVDb250ZW50cyk7XG4gIH1cblxuICByZXR1cm4ge1xuICAgIGlzSWdub3JlZChmaWxlOiBzdHJpbmcpIHtcbiAgICAgIHJldHVybiBmaWxlICYmIGlnbm9yZUNoZWNrZXIuaWdub3JlcyhmaWxlKTtcbiAgICB9LFxuICB9O1xufVxuIl19

@@ -5,2 +5,3 @@ export declare function rewriteImports(options: {

files?: string[];
ignoreFiles: string[];
}): Promise<void>;

@@ -69,5 +69,6 @@ "use strict";

var _a;
const rootDir = (0, path_1.resolve)(process.cwd(), options.dir);
const workDir = process.cwd();
const rootDir = (0, path_1.resolve)(workDir, options.dir);
console.log(`Rewriting relative paths for files in ${chalk_1.default.bold(rootDir)} so that they use ~/* convention...`);
const filter = await (0, readIgnoreFiles_1.readIgnoreFiles)();
const filter = await (0, readIgnoreFiles_1.readIgnoreFiles)(options.ignoreFiles);
const handleFile = function (file) {

@@ -77,3 +78,3 @@ if (!file.endsWith('.ts') && !file.endsWith('.tsx')) {

}
const relative = path_1.default.relative(rootDir, file);
const relative = path_1.default.relative(workDir, file);
if (relative && filter.isIgnored(relative)) {

@@ -105,3 +106,3 @@ return;

.filterDir(function (dir, stats) {
const relative = path_1.default.relative(rootDir, dir);
const relative = path_1.default.relative(workDir, dir);
return !relative || !filter.isIgnored(relative + '/');

@@ -119,2 +120,2 @@ })

exports.rewriteImports = rewriteImports;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmV3cml0ZUltcG9ydHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcmV3cml0ZUltcG9ydHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxrREFBMEI7QUFDMUIsMkJBQWdEO0FBQ2hELHNEQUE2QjtBQUM3Qiw2Q0FBeUQ7QUFDekQsdURBQW9EO0FBRXBELE1BQU0sRUFBRSxRQUFRLEVBQUUsU0FBUyxFQUFFLEdBQUcsYUFBVSxDQUFDO0FBRTNDLE1BQU0sTUFBTSxHQUFHLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQztBQUVqQyxNQUFNLEtBQUssR0FBRyxJQUFJLGlCQUFNLENBQUMsRUFBRSxXQUFXLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQztBQUU3QyxNQUFNLG1CQUFtQixHQUFHLHFDQUFxQyxDQUFDO0FBQ2xFLE1BQU0sbUJBQW1CLEdBQUcscUNBQXFDLENBQUM7QUFFbEUsU0FBUyxjQUFjLENBQUMsR0FBVztJQUNqQyxPQUFPLFVBQVUsQ0FBUyxFQUFFLE1BQ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b2luKHBhY2thZ2VzRGlyLCBwYWNrYWdlTmFtZSksIGZpbGUpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIGZpeEZpbGUocm9vdERpciwgZmlsZSk7XG4gICAgfVxuICB9O1xuXG4gIGlmIChvcHRpb25zPy5maWxlcz8ubGVuZ3RoKSB7XG4gICAgb3B0aW9ucy5maWxlcy5mb3JFYWNoKGhhbmRsZUZpbGUpO1xuICB9IGVsc2Uge1xuICAgIGNvbnN0IHN0YXJ0RGlyID0gb3B0aW9ucy5tb25vcmVwbyA/IGpvaW4ocm9vdERpciwgJ3BhY2thZ2VzJykgOiByb290RGlyO1xuXG4gICAgYXdhaXQgbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgICAgV2Fsa2VyKHN0YXJ0RGlyKVxuICAgICAgICAuZmlsdGVyRGlyKGZ1bmN0aW9uIChkaXI6IHN0cmluZywgc3RhdHM6IGZzLlN0YXRzKSB7XG4gICAgICAgICAgY29uc3QgcmVsYXRpdmUgPSBwYXRoLnJlbGF0aXZlKHJvb3REaXIsIGRpcik7XG4gICAgICAgICAgcmV0dXJuICFyZWxhdGl2ZSB8fCAhZmlsdGVyLmlzSWdub3JlZChyZWxhdGl2ZSArICcvJyk7XG4gICAgICAgIH0pXG4gICAgICAgIC5vbignZmlsZScsIGhhbmRsZUZpbGUpXG4gICAgICAgIC5vbignZW5kJywgZnVuY3Rpb24gKCkge1xuICAgICAgICAgIHJlc29sdmUodW5kZWZpbmVkKTtcbiAgICAgICAgfSk7XG4gICAgfSk7XG5cbiAgICBhd2FpdCBxdWV1ZS5vbklkbGUoKTtcbiAgfVxuXG4gIGNvbnNvbGUubG9nKGNoYWxrLmdyZWVuKGNoYWxrLmJvbGQoJ0RvbmUhJykpKTtcbn1cbiJdfQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmV3cml0ZUltcG9ydHMuanMiLCJz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IHtcbiAgICBjb25zdCBzdGFydERpciA9IG9wdGlvbnMubW9ub3JlcG8gPyBqb2luKHJvb3REaXIsICdwYWNrYWdlcycpIDogcm9vdERpcjtcblxuICAgIGF3YWl0IG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcbiAgICAgIFdhbGtlcihzdGFydERpcilcbiAgICAgICAgLmZpbHRlckRpcihmdW5jdGlvbiAoZGlyOiBzdHJpbmcsIHN0YXRzOiBmcy5TdGF0cykge1xuICAgICAgICAgIGNvbnN0IHJlbGF0aXZlID0gcGF0aC5yZWxhdGl2ZSh3b3JrRGlyLCBkaXIpO1xuICAgICAgICAgIHJldHVybiAhcmVsYXRpdmUgfHwgIWZpbHRlci5pc0lnbm9yZWQocmVsYXRpdmUgKyAnLycpO1xuICAgICAgICB9KVxuICAgICAgICAub24oJ2ZpbGUnLCBoYW5kbGVGaWxlKVxuICAgICAgICAub24oJ2VuZCcsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICByZXNvbHZlKHVuZGVmaW5lZCk7XG4gICAgICAgIH0pO1xuICAgIH0pO1xuXG4gICAgYXdhaXQgcXVldWUub25JZGxlKCk7XG4gIH1cblxuICBjb25zb2xlLmxvZyhjaGFsay5ncmVlbihjaGFsay5ib2xkKCdEb25lIScpKSk7XG59XG4iXX0=
export declare function rewriteRequires(options: {
dir: string;
ignoreFiles: string[];
}): Promise<void>;

@@ -64,13 +64,14 @@ "use strict";

async function rewriteRequires(options) {
const rootDir = path_1.default.resolve(process.cwd(), options.dir);
const workDir = process.cwd();
const rootDir = path_1.default.resolve(workDir, options.dir);
console.log(`Rewriting ~/* paths in ${chalk_1.default.bold(rootDir + '/**/*')} so that they are relative...`);
const filter = await (0, readIgnoreFiles_1.readIgnoreFiles)();
const filter = await (0, readIgnoreFiles_1.readIgnoreFiles)(options.ignoreFiles);
await new Promise((resolve, reject) => {
Walker(rootDir)
.filterDir(function (dir, stats) {
const relative = path_1.default.relative(rootDir, dir);
const relative = path_1.default.relative(workDir, dir);
return !relative || !filter.isIgnored(relative + '/');
})
.on('file', function (file, stats) {
const relative = path_1.default.relative(rootDir, file);
const relative = path_1.default.relative(workDir, file);
if (relative && filter.isIgnored(relative)) {

@@ -95,2 +96,2 @@ return;

exports.rewriteRequires = rewriteRequires;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmV3cml0ZVJlcXVpcmVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3Jld3JpdGVSZXF1aXJlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQSxrREFBMEI7QUFDMUIsMkJBQWdEO0FBRWhELHNEQUE2QjtBQUM3QixnREFBd0I7QUFDeEIsdURBQW9EO0FBRXBELE1BQU0sRUFBRSxRQUFRLEVBQUUsU0FBUyxFQUFFLEdBQUcsYUFBVSxDQUFDO0FBRTNDLE1BQU0sTUFBTSxHQUFHLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQztBQUVqQyxNQUFNLEtBQUssR0FBRyxJQUFJLGlCQUFNLENBQUMsRUFBRSxXQUFXLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQztBQUU3QyxNQUFNLG1CQUFtQixHQUFHLDZCQUE2QixDQUFDO0FBQzFELE1BQU0sbUJBQW1CLEdBQUcsaUNBQWlDLENBQUM7QUFDOUQsTUFBTSwrQkFBK0IsR0FDbkMscURBQXFELENBQUM7QUFDeEQsTUFBTSx3QkFBd0IsR0FBRyx5QkFBeUIsQ0FBQztBQUMzRCxNQUFNLHdCQUF3QixHQUFHLHlCQUF5QixDQUFDO0FBRTNELFNBQVMsY0FBYyxDQUFDLE9BQWUsRUFBRSxPQUFlO0lBQ3RELE9BQU8sVUFDTCxDQUFTLEVBQ1QsTUFBYyxFQUNkLFlBQW9CLEVBQ3BCLEtBQWE7UUFFYixNQUFNLElBQUksR0FBRyxHQUFHLEdBQUc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mIChcbiAgICAgICAgICBmaWxlLmVuZHNXaXRoKCcuanMnKSB8fFxuICAgICAgICAgIGZpbGUuZW5kc1dpdGgoJy50cycpIHx8XG4gICAgICAgICAgZmlsZS5lbmRzV2l0aCgnLmpzeCcpIHx8XG4gICAgICAgICAgZmlsZS5lbmRzV2l0aCgnLnRzeCcpIHx8XG4gICAgICAgICAgZmlsZS5pbmRleE9mKCcuJykgPT09IC0xXG4gICAgICAgICkge1xuICAgICAgICAgIGZpeEZpbGUocm9vdERpciwgZmlsZSk7XG4gICAgICAgIH1cbiAgICAgIH0pXG4gICAgICAub24oJ2VuZCcsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmVzb2x2ZSh1bmRlZmluZWQpO1xuICAgICAgfSk7XG4gIH0pO1xuXG4gIGF3YWl0IHF1ZXVlLm9uSWRsZSgpO1xuXG4gIGNvbnNvbGUubG9nKGNoYWxrLmdyZWVuKGNoYWxrLmJvbGQoJ0RvbmUhJykpKTtcbn1cbiJdfQ==
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc