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
9
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.1.1 to 0.1.2

README.md

36

AppsCompiler.js

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

});
const modulesNotFound = [];
const host = {

@@ -113,3 +114,14 @@ getScriptFileNames: () => Object.keys(result.files),

for (const moduleName of moduleNames) {
this.resolver(moduleName, resolvedModules, containingFile, result, this.wd, moduleResHost);
const index = this.resolver(moduleName, resolvedModules, containingFile, result, this.wd, moduleResHost);
if (index === -1) {
modulesNotFound.push({
filename: containingFile,
line: 0,
character: 0,
lineText: '',
message: `Failed to resolve module: ${moduleName}`,
originalMessage: `Module not found: ${moduleName}`,
originalDiagnostic: undefined,
});
}
}

@@ -120,8 +132,18 @@ return resolvedModules;

const languageService = this.ts.createLanguageService(host, this.ts.createDocumentRegistry());
const coDiag = languageService.getCompilerOptionsDiagnostics();
if (coDiag.length !== 0) {
console.log(coDiag);
console.error('A VERY UNEXPECTED ERROR HAPPENED THAT SHOULD NOT!');
throw new Error(`Language Service's Compiler Options Diagnostics contains ${coDiag.length} diagnostics.`);
try {
const coDiag = languageService.getCompilerOptionsDiagnostics();
if (coDiag.length !== 0) {
console.log(coDiag);
console.error('A VERY UNEXPECTED ERROR HAPPENED THAT SHOULD NOT!');
throw new Error(`Language Service's Compiler Options Diagnostics contains ${coDiag.length} diagnostics.`);
}
}
catch (e) {
if (modulesNotFound.length !== 0) {
result.diagnostics = modulesNotFound;
result.duration = Date.now() - startTime;
return result;
}
throw e;
}
const src = languageService.getProgram().getSourceFile(appInfo.classFile);

@@ -213,3 +235,3 @@ this.ts.forEachChild(src, (n) => {

}
console.log(`Failed to resolve module: ${moduleName}`);
return -1;
}

@@ -216,0 +238,0 @@ getLibraryFile(fileName) {

3

compiler/getAppSource.js

@@ -50,4 +50,3 @@ "use strict";

try {
const { name, version, classFile } = JSON.parse(appJson.content);
return { name, version, classFile };
return JSON.parse(appJson.content);
}

@@ -54,0 +53,0 @@ catch (error) {

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

import { IAppInfo } from '@rocket.chat/apps-engine/definition/metadata';
import { ICompilerFile } from './ICompilerFile';
import { IAppInfo } from './IAppInfo';
export interface IAppSource {

@@ -4,0 +4,0 @@ appInfo: IAppInfo;

@@ -1,2 +0,1 @@

import { IAppInfo } from './IAppInfo';
import { IAppSource } from './IAppSource';

@@ -11,2 +10,2 @@ import { ICompilerDescriptor } from './ICompilerDescriptor';

import { CompilerFileNotFoundError } from './CompilerFileNotFoundError';
export { CompilerFileNotFoundError, IAppInfo, IAppSource, ICompilerDescriptor, ICompilerDiagnostic, ICompilerError, ICompilerFile, IFiles, IMapCompilerFile, ICompilerResult, };
export { CompilerFileNotFoundError, IAppSource, ICompilerDescriptor, ICompilerDiagnostic, ICompilerError, ICompilerFile, IFiles, IMapCompilerFile, ICompilerResult, };
{
"name": "@rocket.chat/apps-compiler",
"version": "0.1.1",
"version": "0.1.2",
"description": "The Rocket.Chat apps compiler",

@@ -9,9 +9,9 @@ "main": "index.js",

"test:watch": "mocha --require ts-node/register --watch --watch-files src, 'tests/**/*.ts'",
"build": "rm -rf dist && mkdir dist && cp package.json dist/package.json && tsc",
"build:prod": "npm run build -- --sourceMap false --declarationMap false ",
"build": "rm -rf dist && mkdir dist && cp package.json dist && tsc",
"build:prod": "npm run build -- --sourceMap false --declarationMap false && cp LICENSE dist && cp README.md dist",
"lint": "npx eslint src/**/*.ts",
"dev": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' ./index.ts",
"dev:debug": "nodemon --watch 'src/**/*.ts' --exec node -r ts-node/register --inspect --inspect=0.0.0.0:9229 ./index.ts",
"publish": "npm run build:prod && cp LICENSE dist/LICENSE && cd dist && npm publish --access public",
"pack": "npm run build:prod && cp LICENSE dist/LICENSE && cd dist && npm pack"
"publish": "npm run build:prod && cd dist && npm publish --access public",
"pack": "npm run build:prod && cd dist && npm pack"
},

@@ -54,3 +54,3 @@ "repository": {

"dependencies": {
"@rocket.chat/apps-engine": "^1.18.0-alpha.3754",
"@rocket.chat/apps-engine": "^1.19.0-alpha.4006",
"figures": "^3.0.0",

@@ -57,0 +57,0 @@ "fs-extra": "^8.1.0",

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