monaca / monaca-lib Goto Github PK
View Code? Open in Web Editor NEWnpm package for handling Monaca cloud API and local debugging API
Home Page: http://monaca.io
License: Other
npm package for handling Monaca cloud API and local debugging API
Home Page: http://monaca.io
License: Other
@andipavllo @frankdiox
Reported by @anatoo.
Since 1.0.0-rc2, angular2-onsenui
requires TypeScript 2.x but current monaca-lib is using TypeScript 1.8.10 as a build dependency.
So monaca-lib
needs to update typescript
in package.json
from 1.8.10
to 2.0.10
(latest).
But I am not sure that it is enough, so could you update typescript
in right way?
Note:
The first time I execute the command 'monaca livesync', it will fail quite often.
I have no CLI error message, but the monacan debugger does not respond.
The second time the command work correctly.
In Angular 2 templates, if I add an <img>
with a relative path like this:
<img src="image.png">
I get the following error:
Module not found: Error: Cannot resolve 'file' or 'directory' ./image.png
I am forced to use absolute paths but in that case the app will only work when deployed in the root.
When clean installing monaca-cli and configure a proxy server, it will return an error like the one below.
# monaca proxy set http://localhost:1080
Unable to set proxy server: Error: ENOENT, open '/root/.cordova/monaca_config.json'
Can you please create the configuration file if it is not found?
If the project has very large amount of files, it will cause trouble when getting file tree from the debugger. When calling this.monaca.getLocalProjectFiles() from Localkit.getProjectFiles(), it is actually filtering to get files in the "/www" directory, and ignoring all dot-files.
However, Monaca.getLocalProjectFiles() first get all files in the specified directory and calculating CRC32 hash for each found files, before filtering out the unnecessary files.
Therefore, please fix the logic and only calculate the hash files that are necessary to use.
Please pass client_info parameter as follows:
version
: Passed from monaca-cli or Localkit. Should be something like: monaca-cli 1.0.2
. Must be passed by the caller of the JavaScript API.os
: Operating system that monaca-lib is running on.Please add a feature like .gitignore
for monaca cli and localkit.
When there is a file called .monacaignore
in the project dir, the specified files and directories will not uploaded and downloaded.
Please implement in a different branch called monacaignore
.
I think the templates should generate a README.md
file with information about how it was created and how to install Monaca CLI and how to run the app.
I do these steps:
here is the terminal output:
? Do you want to continue? (y/N) y
? Do you want to continue? Yes
Running Transpiler...
> com.######[email protected] monaca:transpile
> npm run build
npm ERR! Missing script: "build"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR! npm run
what should to do to solve?
Currently cloneProject()
function is spawning all Promises at once, which causes large number of server connection which possibly lead to timeout. Please consider implementing some way to limit the number of concurrency.
Please create and complete the test spec for monaca-lib.
There are many features that are added after our last change to the test spec.
Can you please add new tests and complete all test cases?
Can I use this for the backend api? If so, how ? I'm using the vue template for onsen ui, but I keep getting errors everywhere when I'm importing this.
Sorry if this sounds like a silly question, I searched everywhere and still couldn't find an answer...
Hi there,
Do you have any plan to merge the following PRs in a near future: #162, #160, #157 and #156
The adbkit dependency shold also be changed to use @devicefarmer/adbkit since OpenSTF no longer maintains this project (openstf/adbkit#132). And bumping adbkit to @devicefarmer/adbkit 3.2.3 would also fix a bunch of node-forge vulnerabilities (GHSA-x4jg-mjrx-434g, GHSA-cfm4-qjh2-4765, GHSA-92xj-mqp7-vmcj, GHSA-2r2c-g63r-vccr, GHSA-8fr3-hfg3-gpgp, GHSA-5rrq-pxf6-6jx5, GHSA-wxgw-qj99-44c2 and GHSA-gf8q-jrpm-jvxq).
Or maybe monaca-lib isn't affected by these vulnerabilities?
Thank you
With this latest release of the cli (2.5.0), the lib no longer allows logging in.
We have the following gulp task setup (and have tried adding a logout function 1st to clear whatever is in the mem)
gulp.task('monaca-login', (done) => {
monaca.login(monacaEmail, monacaPassword).then(
() => {
done();
},
(error) => {
console.log('monaca-login', error);
if (error) throw error;
}
);
});
this results in the following issue
monaca-login { status: 'fail',
code: 400,
message: 'Your client is old version. Please upgrade to the latest version.' }
Hey there!
I'm new to Monaca, loving it so far. I am trying to use Monaca with vue-loader/webpack?
I started off with the "no framework, Blank Template", and thought I could use monaca transpile
to build .vue files.
Seems like monaca transpile
only supports react & angular2 ?
What's the best way to integrate vue-loader with Monaca hybrid apps?
Thanks!
We are trying to perform Monaca tasks programmatically to automate the app build process. Please note that everything works fine from the Monaca IDE using a browser, however, the last step which is related to triggering the build fails when we do things programmatically.
Below is the process that we are following:
We can successfully perform the first four (4) steps using your NPM library programmatically but during the 5th step, we get the following build error:
Fetching Build Queue Data...
-> Fetched data for queue ID xxxxxxxxxxxxxx
Preparing Build Environment...
Creating Project Build Workspace...
Fetching Project Content...
Downloading Project Archive...
Extracting Project Archive...
Fetching Project Info...
Build Error: Error: Failed to fetch project info with error : Error: project_info.json not found.
We have noticed that if before the 5th step we trigger the build from the Monaca IDE using a browser manually, then the 5th step is successful using the NPM libraries. However, we want to fully automate this process and we would like to find the fix for the build failure.
Folks at Monaca support believe that it is a monaca-lib issue.
Please find npm project src files with this comment.
src.zip
The getLocalProjectFiles
method doesn't use the ignore patterns from the .monacaignore
file when getting a listing of files in the project directory. This is a problem on projects with a large number of files in the node_modules
folder because it will either take a very long time to get the file listing, or the JS heap will run out of memory.
This is the line that is causing the issue:
https://github.com/monaca/monaca-lib/blob/2.7.5/src/monaca.js#L1458
v2.7.5 is where the issue first occurs.
The same issue does not seem to occur in v2.7.4 and earlier.
npm install
.#!/usr/bin/env node
const Monaca = require('monaca-lib').Monaca;
const monaca = new Monaca({clientType: 'cli'});
monaca.login("[email protected]", "password")
.then(() => monaca.setProjectId(process.cwd(), "project_id"))
.then(() => monaca.uploadProject(process.cwd()))
.catch((error) => console.log(error));
node ./script.js
.Successfully read the local files and then uploads the files to your Monaca project.
An Error is thrown:
Reading Local Files...
Reading Remote Files...
<--- Last few GCs --->
[27880:0x103000c00] 83925 ms: Mark-sweep 1400.4 (1511.0) -> 1400.4 (1480.0) MB, 2555.4 / 0.0 ms (+ 0.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 2555 ms) last resort
[27880:0x103000c00] 86320 ms: Mark-sweep 1400.4 (1480.0) -> 1400.4 (1480.0) MB, 2393.4 / 0.0 ms last resort
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x1554ac228799 <JSObject>
1: /* anonymous */(aka /* anonymous */) [PROJECT_PATH/node_modules/monaca-lib/node_modules/q/q.js:~1585] [pc=0xb56a773efb3](this=0x170969282311 <undefined>,undefined=0x170969282311<undefined>,promise=0x2d22d4abbf81 <Object map = 0x3cffc4b7ebc1>,index=17726)
2: arguments adaptor frame: 4->3
3: reduce(this=0x325b4d343c31 <JSArray[137441]>)
5: /* an...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node::Abort() [~/.nvm/versions/node/v8.6.0/bin/node]
2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [~/.nvm/versions/node/v8.6.0/bin/node]
3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [~/.nvm/versions/node/v8.6.0/bin/node]
4: v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [~/.nvm/versions/node/v8.6.0/bin/node]
5: v8::internal::Runtime_AllocateInTargetSpace(int, v8::internal::Object**, v8::internal::Isolate*) [~/.nvm/versions/node/v8.6.0/bin/node]
6: 0xb56a75846fd
I think cordova cli crashes.
Hi @JW-Vinayak
I saw it spawns npm in the replaceTemplate
method. This will fail if npm is not installed since it's not trying to execute a local npm version.
Test and verify that it works in Node 5. If not, resolve all issues.
npm ERR! gentlyRm C:\Users\Fran\.cordova\node_modules\.bin\tsc.cmd is outside C:\Users\Fran\.babun\cygwin\home\Fran\workspace\monaca-cli and not a link
npm ERR! gentlyRm C:\Users\Fran\.cordova\node_modules\.bin\tsserver.cmd is outside C:\Users\Fran\.babun\cygwin\home\Fran\workspace\monaca-cli and not a link
When trying to download a React template it also installs TypeScript and fails.
@andipavllo @erisu @frankdiox
Environment
Monaca CLI 2.1.7
monaca-lib 2.2.4
Encountered problem
The current webpack config for Angular 2 crashes with the following error when foo.html
which is loaded by require('foo.html')
contains an unresolvable path (in a src
attribute of img
element).
ERROR in ./src/app/app.html
Module not found: Error: Cannot resolve 'file' or 'directory' ./images/pokemon/icons/{{ p.id }}.png in /Users/asial/temp/angular2-onsenui-pokedex/src/app
@ ./src/app/app.html 1:475-523
How to reproduce
First, run the commands below:
git clone https://github.com/argelius/angular2-onsenui-pokedex.git --no-checkout
cd angular2-onsenui-pokedex
git checkout 2e4210bffa21bd0daaddc76028b3c0082601b0ff
Next, make this change in src/app/app.html
:
<img class="sprite" src="/images/pokemon/sprites/{{ pokemon.id }}.png">
<img class="sprite" src="./images/pokemon/sprites/{{ pokemon.id }}.png">
(This is required for running this app in Cordova environment. Otherwise, we would get the following error.)
Then, run the commands below:
npm install
monaca transpile # cause the error
FYI:
If we use template: (content of app.html)
instead of template: require('./app.html')
, it worked fine on Cordova environment:
But I think this is not a straightforward solution.
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.