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

@rocket.chat/apps-compiler

Package Overview
Dependencies
Maintainers
8
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rocket.chat/apps-compiler - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0

3

AppsCompiler.js

@@ -11,2 +11,3 @@ "use strict";

const fs = __importStar(require("fs"));
const path = __importStar(require("path"));
const fallbackTypescript = __importStar(require("typescript"));

@@ -24,3 +25,3 @@ const module_1 = require("module");

this.sourcePath = sourcePath;
this.validator = new AppsEngineValidator_1.AppsEngineValidator(module_1.createRequire(`${sourcePath}/app.json`));
this.validator = new AppsEngineValidator_1.AppsEngineValidator(module_1.createRequire(path.join(sourcePath, 'app.json')));
this.typescriptCompiler = new TypescriptCompiler_1.TypescriptCompiler(sourcePath, ts, this.validator);

@@ -27,0 +28,0 @@ this.bundler = bundler_1.default(bundler_1.AvailableBundlers.esbuild);

"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -6,7 +13,11 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

Object.defineProperty(exports, "__esModule", { value: true });
const os = __importStar(require("os"));
const path_1 = __importDefault(require("path"));
const esbuild_1 = require("esbuild");
const isWin = os.platform() === 'win32';
function normalizeAppModulePath(modulePath, parentDir) {
return /\.\.?\//.test(modulePath)
? path_1.default.resolve('/', path_1.default.dirname(parentDir), modulePath).substring(1).concat('.js')
? isWin
? path_1.default.join(path_1.default.dirname(parentDir), modulePath).concat('.js')
: path_1.default.resolve('/', path_1.default.dirname(parentDir), modulePath).substring(1).concat('.js')
: modulePath;

@@ -41,8 +52,19 @@ }

const modulePath = normalizeAppModulePath(args.path, args.importer);
if (r.files[modulePath]) {
const modulePathReplaced = modulePath.replace(':\\', '');
const hasFile = !!r.files[modulePathReplaced];
if (hasFile) {
return {
namespace: 'app-source',
path: modulePath,
path: modulePathReplaced,
};
}
if (/\.\.?\//.test(args.path)) {
const indexModulePath = modulePath.replace(/\.js$/, `${path_1.default.sep}index.js`);
if (r.files[indexModulePath]) {
return {
namespace: 'app-source',
path: indexModulePath,
};
}
}
const nodeModulePath = validator.resolveAppDependencyPath(args.path);

@@ -49,0 +71,0 @@ if (!/@rocket\.chat\/apps-engine/.test(args.path) && path_1.default.isAbsolute(nodeModulePath)) {

{
"name": "@rocket.chat/apps-compiler",
"version": "0.3.1",
"version": "0.4.0",
"description": "The Rocket.Chat apps compiler",

@@ -5,0 +5,0 @@ "main": "index.js",

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