electrode-io / xarc-run Goto Github PK
View Code? Open in Web Editor NEWnpm run scripts concurrently and serially, and more.
License: Apache License 2.0
npm run scripts concurrently and serially, and more.
License: Apache License 2.0
error
to cleanup hookHow can I give a task arguments ?
NPM Example: "npm run someScript -- --arg1 --arg2"
Thanks
The ReadMe mentions the possibility to specify task options. Please provide an example or test of how to access those options.
Gulp being the most used build tool and having a large set of already available plugins, mostly I see gulp extensions they depend on vinyl-fs stream pattern. If xclap could provide an extension so that the gulp users can easily migrate their gulp tasks to xclap with same streaming pattern will be very useful.
I understand that this is achievable by directly importing vinyl-fs
in xclap build file, was wondering if xclap has a different plan in achieving the similar goal.
// similar to gulp
xclap.src(["./src/**/*.js"]).pipe(babel(opts)).pipe(xclap.dest("./dest"));
I'm just trying to run npm scripts from my package.json
, but xrun
is always complaining about missing xrun-tasks.js
.
Looking at the documentation, calling
npx xrun -s i18n-mf:en i18n-mf:de
should work, but gives me an error:
[10:23:43] No xrun-tasks.js found - @xarc/run has nothing to do
Please create xrun-tasks.js - sample: https://www.npmjs.com/package/@xarc/run#a-simple-example
Adding an option -n
or --npm
does not change anything.
What am I doing wrong?
Jest's interactive --watch
mode doesn't work when run with clap
To Reproduce:
Create clap task that runs jest --watch
.
Expected: Watch mode gives you interactive menu to continue with
Outcome: watch mode just stalls after running tests
When trying to use xrun
in an environment set to 'Module', xrun will throw an error about using require() instead of import
.
[16:17:21] Unable to load ./xrun-tasks.ts: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: ./xrun-tasks.ts
require() of ES modules is not supported.
require() of ./xrun-tasks.ts from ./node_modules/.pnpm/@[email protected]/node_modules/@xarc/run/cli/parse-cmd-args.js is an ES module file as it is a .ts file whose nearest parent package.json contains "type": "module" which defines all .ts files in that package scope as ES modules.
Instead change the requiring code to use import(), or remove "type": "module" from ./package.json.
Use Case:
Building a TypeScript package that is set to use ESM ('type': 'module') and including xrun tasks for setting how to run Mocha tests causes the xrun tasks to fail.
Solution:
require
Work Around:
TS_NODE_PROJECT='./tsconfig.test.json' NODE_OPTIONS='--loader ts-node/esm --no-warnings' mocha
results in a successful pass of the tests.This page of doc: https://github.com/jchip/xclap/blob/HEAD/REFERENCE.md says
Then function can return:
- `string` - `clap` will treat the string as a shell command to be spawned.
But the actual code appears to treat a single string return as a target to invoke. See the text in xclap.spec.js
named should exe task name return by function
.
I'm not sure which is correct. Personally, the doc seems the more uniform behavior, since if I want a task executed, I merely need to say return [ 'taskname' ];
The order changed from npm, pkg ,files(electrode) to file(electrode), npm, pkg in 0.2.21.
Scripts are dependent on this order, which order should we follow?
example
In 0.2.21
"_nsOrder": {
"_namespaces": [
"electrode",
"npm",
"pkg"
],
"_overrides": {
"electrode": {
"value": 1,
"others": []
},
"npm": {
"value": 1,
"others": []
},
"pkg": {
"value": 1,
"others": []
}
}
},
In 0.2.20
"_nsOrder": {
"_namespaces": [
"npm",
"pkg",
"electrode"
],
"_overrides": {
"npm": {
"value": 1,
"others": []
},
"pkg": {
"value": 1,
"others": []
},
"electrode": {
"value": 1,
"others": []
}
}
}
There is a repository to reproduce this error https://github.com/theVeid/xclap-soe-issue
There are two tasks, that are running concurrently and both of them exit with process code not equal 0. When defining xclap.stopOnError = 'soft'
inside xclap.js
, it is expected that after first task exits xclap will wait until the second task finish too, but it is not the case until one define --soe soft
flag for xclap cli launch
Same result expected for both no-flag
and flag
command, as stopOnError
is defined inside xclap.js
file
no-flag
command will stop fully after error in first exited task, no matter that stopOnError
is defined with soft
inside xclap.js
use case: failed test coverage, want to define a post-cov task that offers a link to the HTML report (i.e. . this post cov task cannot be run if the coverage task fails (which is the point to see the HTML report).. open to PR?
Title says it.
this.argv is undefined for me.
https://github.com/jchip/xclap/blob/master/REFERENCE.md#task-options
We use xclap-cli is that the reason?
Thanks!
First of all I want to thank you guys for that awesome work you are doing. I am currently using xclap in combination with nix-clap in a bunch of projects. And everything worked fine... till now.
Currently I have to provide a list of args for a specific task option. It seams that xclap does not support that out of the box.
Expected Behaviour
clap <task> --foo value1 value2 --bar
Task option foo gets list of values.
Current Behaviour
value1 gets interpreted as new task.
Error Message: No task namespace value1 exists.
I've created an xclap.js
with the contents:
const xclap = require(`xclap`);
const tasks = {
hello: `echo hello world`,
js: () => console.log(`JS hello world`),
both: {
desc: `invoke tasks hello and js in serial order`,
task: [`hello`, `js`]
}
};
xclap.load(tasks);
And this is the output:
โ clap -f
[15:26:44] xclap version 0.2.12 at /Users/jwhitmarsh/.npm-packages/lib/node_modules/xclap
[15:26:44] NodeJS version v8.3.0 at /usr/local/bin/node
[15:26:44] CWD is /Users/jwhitmarsh/src/test-proj
[15:26:44] Loaded CWD/xclap.js
[15:26:44] No tasks found - please load some.
Usage: clap [options] [--] [task1 [task options] task2 [task options] ...]
Help: clap -h Example: clap build
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.