Git Product home page Git Product logo

rocket.chat.apps-compiler's People

Contributors

allanpazribeiro avatar bk201- avatar cauen avatar cuonghuunguyen avatar d-gubert avatar graywolf336 avatar matheusbsilva137 avatar shiqimei avatar thassiov avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rocket.chat.apps-compiler's Issues

Fix in 0.3.1 causes import bug with module which has only 1 export

The fix in 0.3.1 cannot fit every case. It causes an error when packaging my App at: https://github.com/cuonghuunguyen/Rocket-Chat-Livechat-Clean

// constants/scheduled-jobs.ts
export const JobID = {
    CLEAN_ROOMS: 'CLEAN_ROOMS',
};

```ts
// scheduled-jobs/clean-rooms.ts
import {JobID} from '../constants/scheduled-jobs';
JobID.CLEAN_ROOMS
^^^ cannot read property CLEAN_ROOMS of undefined

The logs of the Apps CLI is not good so I had to spend hours debugging it 😓
Packaging and Deploying with my own (private) App Packager works fine

Referenced file "SettingsApi.ts" causes VERY UNEXPECTED ERROR

Having a file named "SettingsApi.ts" which is referenced from the file containing the class derived from IApp causes the error below. Changing the name of the file and the IApp reference fixes the problem.

[{
file: undefined,
start: undefined,
length: undefined,
code: 6053,
category: 1,
messageText:{
messageText: "File 'SettingsApi.ts' not found.",
category: 1,
code: 6053,
next: [Array]
},
relatedInformation: undefined
}
A VERY UNEXPECTED ERROR HAPPENED THAT SHOULD NOT!

App abstract class inheritance checking failed for multilevel inheritance

Description

If the App class extends a class that extends @rocket.chat/apps-engine/definition/App, the compiler should not complain about the missing App class inheritance.

Reproduce

In BaseAppClass.ts

import { App } from "@rocket.chat/apps-engine/definition/App";

export default BaseAppClass extends App implements SomeBaseEvent {
        // General logics of App classes
}

In RealAppClass.ts

import { BaseAppClass } from "./core/BaseAppClass";

export default RealAppClass extends BaseAppClass { //Base logic is included
        // Custom logic
}

Expected behavior

  • Compilation success
  • RealAppClass includes logic of the BaseAppClass

Actual behavior

Compilation error
» Error: ⟿ App must extend apps-engine's "App" abstract class.

[Error][Windows] Import files cause errors

By importing any .ts file in main file like:
import { SendMessageAsAppUserEndpoint } from './endpoints/SendMessageAsAppUserEndpoint';

Cuase error:

/AppData/Roaming/nvm/v14.14.0/node_modules/@rocket.chat/apps-cli/node_modules/@rocket.chat/apps-compiler/bundler/esbuild.js:54:92: error: [plugin:     
 »   apps-engine] The "path" argument must be of type string. Received undefined

Tested in Ubuntu 20.04 and its ok.


The error is caused because the modulePath is different of r.files key.

https://github.com/RocketChat/Rocket.Chat.Apps-compiler/blob/master/src/bundler/esbuild.ts#L43

Deployment failed with soft links

Description

In our codebase, there are several apps and there are some functions that I use are duplicating across the apps.
I have solved duplication by using soft links from the apps' directory to the folder that contains the general code.
When testing the new version of the Apps-CLI, I got the error EISDIR which blocks me to test more.

Expected behavior

The CLI is able to package the file under soft links

Actual behavior

image

Additional info

  • CLI version: 1.8
  • Node version: 14.11.0

Exclude tests from compiler

Related to RocketChat/Rocket.Chat.Apps-cli#43

I've added some Jest tests to my app which should be excluded from the package (all the tests are named *.spec.ts) but when I try to package the app with rc-apps v1.8.1 it I'm getting the following error because the app compiler appears to be trying to compile the tests without including the Jest dependency from package.json:

$ rc-apps package
packaging your app... !
 ›   Error: Error src/StandardTickets.spec.ts (9,1): Cannot find name 'beforeEach'.

Diagnostics Aren't Correct

{
    "filename" : "",
    "line" : 32,
    "character" : 8,
    "lineText" : "        return 'sdf';",
    "message" : "Error AsciiArtCommandsApp.ts (33,9): Type 'string' is not assignable to type 'boolean'.",
    "originalMessage" : ""
}

File name is missing and the original message is empty

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.