update to state of the art

This commit is contained in:
s2
2020-10-10 15:18:01 +02:00
parent cf251a170f
commit 4cdcfd167c
1526 changed files with 48132 additions and 7268 deletions

38
node_modules/jake/lib/jake.js generated vendored
View File

@@ -245,29 +245,11 @@ if (!global.jake) {
};
this.createPlaceholderFileTask = function (name, namespace) {
let nsPath = '';
let filePath = name.split(':').pop(); // Strip any namespace
let parts;
let fileTaskName;
let parsed = name.split(':');
let filePath = parsed.pop(); // Strip any namespace
let task;
if (namespace) {
if (typeof namespace == 'string') {
nsPath = namespace;
}
else {
nsPath = namespace.path;
if (!namespace.isRootNamespace()) {
nsPath += ':' + namespace.name;
}
}
}
parts = nsPath.length ? nsPath.split(':') : [];
parts.push(filePath);
fileTaskName = parts.join(':');
task = jake.Task[fileTaskName];
task = namespace.resolveTask(name);
// If there's not already an existing dummy FileTask for it,
// create one
@@ -275,11 +257,21 @@ if (!global.jake) {
// Create a dummy FileTask only if file actually exists
if (fs.existsSync(filePath)) {
task = new jake.FileTask(filePath);
task.fullName = fileTaskName;
task.dummy = true;
let ns;
if (parsed.length) {
ns = namespace.resolveNamespace(parsed.join(':'));
}
else {
ns = namespace;
}
if (!namespace) {
throw new Error('Invalid namespace, cannot add FileTask');
}
ns.addTask(task);
// Put this dummy Task in the global Tasks list so
// modTime will be eval'd correctly
jake.Task[fileTaskName] = task;
jake.Task[`${ns.path}:${filePath}`] = task;
}
}

10
node_modules/jake/package.json generated vendored
View File

@@ -1,8 +1,8 @@
{
"_from": "jake@^10.6.1",
"_id": "jake@10.8.1",
"_id": "jake@10.8.2",
"_inBundle": false,
"_integrity": "sha512-eSp5h9S7UFzKdQERTyF+KuPLjDZa1Tbw8gCVUn98n4PbIkLEDGe4zl7vF4Qge9kQj06HcymnksPk8jznPZeKsA==",
"_integrity": "sha512-eLpKyrfG3mzvGE2Du8VoPbeSkRry093+tyNjdYaBbJS9v17knImYGNXQCUV0gLxQtF82m3E8iRb/wdSQZLoq7A==",
"_location": "/jake",
"_phantomChildren": {},
"_requested": {
@@ -18,8 +18,8 @@
"_requiredBy": [
"/ejs"
],
"_resolved": "https://registry.npmjs.org/jake/-/jake-10.8.1.tgz",
"_shasum": "0f6f5ef13ebe014104527fb4b1b24f44cd1f04d6",
"_resolved": "https://registry.npmjs.org/jake/-/jake-10.8.2.tgz",
"_shasum": "ebc9de8558160a66d82d0eadc6a2e58fbc500a7b",
"_spec": "jake@^10.6.1",
"_where": "D:\\Projects\\vanillajs-seed\\node_modules\\ejs",
"author": {
@@ -71,5 +71,5 @@
"test": "./bin/cli.js test",
"test:ci": "npm run lint && npm run test"
},
"version": "10.8.1"
"version": "10.8.2"
}

View File

@@ -90,7 +90,7 @@ suite('fileTask', function () {
exec('mkdir -p ./foo');
fs.writeFileSync('foo/prereq.txt', prereqData);
let out;
out =exec('./node_modules/.bin/jake -q fileTest:foo/from-prereq.txt').toString().trim();
out = exec('./node_modules/.bin/jake -q fileTest:foo/from-prereq.txt').toString().trim();
assert.equal('fileTest:foo/from-prereq.txt task', out);
let data = fs.readFileSync(process.cwd() + '/foo/from-prereq.txt');
assert.equal(prereqData, data.toString());

View File

@@ -12,6 +12,11 @@ task({'noAction': ['default']});
desc('No action, no prereqs.');
task('noActionNoPrereqs');
desc('Top-level zerbofrangazoomy task');
task('zerbofrangazoomy', function () {
console.log('Whaaaaaaaa? Ran the zerbofrangazoomy task!')
});
desc('Task that throws');
task('throwy', function () {
let errorListener = function (err) {

View File

@@ -23,6 +23,13 @@ suite('taskBase', function () {
exec('./node_modules/.bin/jake noActionNoPrereqs');
});
test('a task that exists at the top-level, and not in the specified namespace, should error', function () {
let res = require('child_process').spawnSync('./node_modules/.bin/jake',
['asdfasdfasdf:zerbofrangazoomy']);
let err = res.stderr.toString();
assert.ok(err.indexOf('Unknown task' > -1));
});
test('passing args to a task', function () {
let out = exec('./node_modules/.bin/jake -q argsEnvVars[foo,bar]').toString().trim();
let parsed = h.parse(out);

View File

@@ -68,4 +68,10 @@ suite('namespace', function () {
assert.ok(task.action.toString().indexOf('zooby:frang:w00t:bar') > -1);
});
test('resolution miss with throw error', function () {
let curr = Namespace.ROOT_NAMESPACE;
let task = curr.resolveTask('asdf:qwer');
assert.ok(!task);
});
});