rocketchat / rocket.chat.apps-compiler Goto Github PK
View Code? Open in Web Editor NEWThe Rocket.Chat apps compiler.
License: MIT License
The Rocket.Chat apps compiler.
License: MIT License
I compiled my app with the latest version 0.3.1 but it seems to ignore my esModuleInterop
config.
Can anybody confirm this behavior?
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
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!
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.
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
}
RealAppClass
includes logic of the BaseAppClass
Compilation error
» Error: ⟿ App must extend apps-engine's "App" abstract class.
Maybe if we used the glob package we could even ignore files with .gitignore
🤔
Originally posted by @d-gubert in #2 (comment)
We haven't planned on allowing apps to use these packages in the run-time, and haven't measured the possible impacts/vulnerabilities it can cause. Are we required to do this here?
Originally posted by @d-gubert in #2 (comment)
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
Maybe if we used the glob package we could even ignore files with .gitignore
🤔
Originally posted by @d-gubert in #2 (comment)
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.
The CLI is able to package the file under soft links
The fs module exposes "promisified" versions of its methods via fs.promises - no need to do it manually anymore :)
Originally posted by @d-gubert in #2 (comment)
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'.
{
"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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.