@omni-oss/create-jobs 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/create-jobs.cjs +1 -1
- package/dist/create-jobs.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/schemas-DiJRB439.js +1 -0
- package/dist/{schemas-CySsa0xy.mjs → schemas-DqxD-_k8.mjs} +17 -17
- package/package.json +1 -1
- package/dist/schemas-BnpD42eF.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.
|
|
3
3
|
|
|
4
4
|
- - -
|
|
5
|
+
## @omni-oss/create-jobs-v0.1.9 - 2026-02-14
|
|
6
|
+
#### Bug Fixes
|
|
7
|
+
- (**@omni-oss/create-jobs**) improve artifact name escaping - (4eb9d91) - Clarence Manuel
|
|
8
|
+
#### Miscellaneous Chores
|
|
9
|
+
- (**@omni-oss/create-jobs**) fix tests - (fabe516) - Clarence Manuel
|
|
10
|
+
- add npmignore to scripts - (40e7d91) - Clarence Manuel
|
|
11
|
+
|
|
12
|
+
- - -
|
|
13
|
+
|
|
5
14
|
## @omni-oss/create-jobs-v0.1.8 - 2026-02-12
|
|
6
15
|
#### Bug Fixes
|
|
7
16
|
- (**@omni-oss/create-jobs**) output relative paths - (db68af6) - Clarence Manuel
|
package/dist/create-jobs.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
"use strict";const r=require("node:fs/promises"),i=require("@commander-js/extra-typings"),s=require("./schemas-
|
|
2
|
+
"use strict";const r=require("node:fs/promises"),i=require("@commander-js/extra-typings"),s=require("./schemas-DiJRB439.js"),l=new i.Command;l.argument("<input>","The input file to read from.").option("-o, --output <output>","The output file to write to.").option("-r, --root <root>","Override the workspace root.").action(async(n,e)=>{const a=await r.readFile(n,"utf-8"),u=JSON.parse(a),t=s.TaskResultArraySchema.safeParse(u);if(t.success){const c=t.data,o=s.createJobs(c,e.root);e.output?await r.writeFile(e.output,JSON.stringify(o,null,2)):console.log(o)}else console.error(t.error),process.exit(1)}).parseAsync();
|
package/dist/create-jobs.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
import r from "node:fs/promises";
|
|
3
3
|
import { Command as u } from "@commander-js/extra-typings";
|
|
4
|
-
import { T as c, c as p } from "./schemas-
|
|
4
|
+
import { T as c, c as p } from "./schemas-DqxD-_k8.mjs";
|
|
5
5
|
const l = new u();
|
|
6
6
|
l.argument("<input>", "The input file to read from.").option("-o, --output <output>", "The output file to write to.").option("-r, --root <root>", "Override the workspace root.").action(async (s, t) => {
|
|
7
7
|
const a = await r.readFile(s, "utf-8"), n = JSON.parse(a), o = c.safeParse(n);
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./schemas-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./schemas-DiJRB439.js");exports.TaskResultArraySchema=e.TaskResultArraySchema;exports.TaskResultSchema=e.TaskResultSchema;exports.createJobs=e.createJobs;
|
package/dist/index.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("node:path"),u=require("node:process"),e=require("zod");function b(s,a){a||(a=u.cwd());const i={test:{rust:[],typescript:[]},build:{rust:[],typescript:[]},publish:{generic:[],npm:[],rust_github:[]}};for(const t of s){if(t.status==="skipped")continue;const o=t.task;(o.task_name==="test"||t.details.meta?.is_test_task)&&(t.details.meta?.language==="rust"&&i.test.rust.push(n(t,a)),t.details.meta?.language==="typescript"&&i.test.typescript.push(n(t,a))),(o.task_name==="build"||t.details.meta?.is_build_task)&&(t.details.meta?.language==="rust"&&i.build.rust.push(n(t,a)),t.details.meta?.language==="typescript"&&i.build.typescript.push(n(t,a))),(o.task_name==="publish"||t.details.meta?.is_publish_task)&&(t.details.meta?.language==="typescript"?i.publish.npm.push(n(t,a)):t.details.meta?.language==="rust"?i.publish.rust_github.push(n(t,a)):i.publish.generic.push(n(t,a)))}return i}function n(s,a){const i=[],t=[];if(s.details.output_files&&s.details.output_files.length>0)for(const o of s.details.output_files){const l=r.resolve(s.task.project_dir,o);m(s.task.project_dir,l)?t.push(r.relative(s.task.project_dir,l)):i.push(r.relative(a,l))}return{task_name:s.task.task_name,project_name:s.task.project_name,artifacts:{project:{name:`project-${c(s.task.project_name)}__${c(s.task.task_name)}`,files:t,files_count:t.length},workspace:{name:`workspace-${c(s.task.project_name)}__${c(s.task.task_name)}`,files:i,files_count:i.length}},project_dir:r.relative(a,s.task.project_dir),meta:s.details.meta??{}}}function m(s,a){const i=r.relative(s,a);return i&&!i.startsWith("..")&&!r.isAbsolute(i)}function c(s){let a=encodeURIComponent(s);return/^(con|prn|aux|nul|com[1-9]|lpt[1-9])$/i.test(a)&&(a=`_${a}`),a}const k=e.z.object({secs:e.z.number().int().nonnegative().describe("The number of whole seconds elapsed."),nanos:e.z.number().int().nonnegative().describe("The number of nanoseconds elapsed.")}),f=e.z.object({runner:e.z.string().describe("The runner to use for the target.")}),g=e.z.object({npm:e.z.boolean().optional().describe("Whether to publish to npm."),github:e.z.boolean().optional().describe("Whether to publish to github.")}),_=e.z.object({type:e.z.string().optional().describe("The type of project (e.g., library, service, application)."),language:e.z.string().optional().describe("The primary language of the project."),targets:e.z.record(e.z.string(),f).optional().describe("The targets to build."),release:g.optional(),is_publish_task:e.z.boolean().optional().describe("Whether this is a publish job."),is_build_task:e.z.boolean().optional().describe("Whether this is a build job."),is_test_task:e.z.boolean().optional().describe("Whether this is a test job.")}),d=e.z.object({meta:_.optional(),output_files:e.z.array(e.z.string()).optional().describe("The output files generated.")}),p=e.z.object({task_name:e.z.string().describe("The short name of the task (e.g., 'test', 'build')."),task_command:e.z.string().describe("The command executed for the task."),project_name:e.z.string().describe("The name of the project."),project_dir:e.z.string().describe("The absolute directory path of the project."),full_task_name:e.z.string().describe("The fully qualified task name (e.g., 'omni_utils#test')."),dependencies:e.z.array(e.z.string()).describe("A list of dependent task names."),enabled:e.z.boolean().or(e.z.string()).optional().describe("Whether the task is enabled by configuration. Either a boolean or a tera template string that evaluates to a boolean."),interactive:e.z.boolean().describe("Whether the task is interactive."),persistent:e.z.boolean().describe("Whether the task is persistent.")}),z=e.z.object({status:e.z.literal("completed"),hash:e.z.string().describe("The task's content hash (Base64 encoded string). Used for caching."),task:p,exit_code:e.z.number().int().describe("The exit code of the executed command (typically 0 for success)."),elapsed:k.describe("The duration the task took to execute."),cache_hit:e.z.boolean().describe("Indicates if the result was pulled from cache."),details:d}),j=e.z.object({status:e.z.literal("errored"),task:p,error:e.z.string().describe("The error message."),details:d}),T=e.z.object({status:e.z.literal("skipped"),task:p,skip_reason:e.z.string().describe("The reason the task was skipped (e.g., 'disabled')."),details:d}),h=e.z.discriminatedUnion("status",[z,T,j]).describe("Schema for a single task execution result (completed or skipped)."),y=e.z.array(h).describe("An array of task execution results.");exports.TaskResultArraySchema=y;exports.TaskResultSchema=h;exports.createJobs=b;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import n from "node:path";
|
|
2
2
|
import h from "node:process";
|
|
3
3
|
import { z as e } from "zod";
|
|
4
4
|
function x(s, a) {
|
|
@@ -21,19 +21,19 @@ function x(s, a) {
|
|
|
21
21
|
for (const t of s) {
|
|
22
22
|
if (t.status === "skipped")
|
|
23
23
|
continue;
|
|
24
|
-
const
|
|
25
|
-
(
|
|
24
|
+
const r = t.task;
|
|
25
|
+
(r.task_name === "test" || t.details.meta?.is_test_task) && (t.details.meta?.language === "rust" && i.test.rust.push(o(t, a)), t.details.meta?.language === "typescript" && i.test.typescript.push(o(t, a))), (r.task_name === "build" || t.details.meta?.is_build_task) && (t.details.meta?.language === "rust" && i.build.rust.push(o(t, a)), t.details.meta?.language === "typescript" && i.build.typescript.push(o(t, a))), (r.task_name === "publish" || t.details.meta?.is_publish_task) && (t.details.meta?.language === "typescript" ? i.publish.npm.push(o(t, a)) : t.details.meta?.language === "rust" ? i.publish.rust_github.push(o(t, a)) : i.publish.generic.push(o(t, a)));
|
|
26
26
|
}
|
|
27
27
|
return i;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function o(s, a) {
|
|
30
30
|
const i = [], t = [];
|
|
31
31
|
if (s.details.output_files && s.details.output_files.length > 0)
|
|
32
|
-
for (const
|
|
33
|
-
const l =
|
|
32
|
+
for (const r of s.details.output_files) {
|
|
33
|
+
const l = n.resolve(s.task.project_dir, r);
|
|
34
34
|
u(s.task.project_dir, l) ? t.push(
|
|
35
|
-
|
|
36
|
-
) : i.push(
|
|
35
|
+
n.relative(s.task.project_dir, l)
|
|
36
|
+
) : i.push(n.relative(a, l));
|
|
37
37
|
}
|
|
38
38
|
return {
|
|
39
39
|
task_name: s.task.task_name,
|
|
@@ -50,17 +50,17 @@ function r(s, a) {
|
|
|
50
50
|
files_count: i.length
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
|
-
project_dir:
|
|
53
|
+
project_dir: n.relative(a, s.task.project_dir),
|
|
54
54
|
meta: s.details.meta ?? {}
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
function u(s, a) {
|
|
58
|
-
const i =
|
|
59
|
-
return i && !i.startsWith("..") && !
|
|
58
|
+
const i = n.relative(s, a);
|
|
59
|
+
return i && !i.startsWith("..") && !n.isAbsolute(i);
|
|
60
60
|
}
|
|
61
61
|
function c(s) {
|
|
62
|
-
let a = s
|
|
63
|
-
return
|
|
62
|
+
let a = encodeURIComponent(s);
|
|
63
|
+
return /^(con|prn|aux|nul|com[1-9]|lpt[1-9])$/i.test(a) && (a = `_${a}`), a;
|
|
64
64
|
}
|
|
65
65
|
const b = e.object({
|
|
66
66
|
secs: e.number().int().nonnegative().describe("The number of whole seconds elapsed."),
|
|
@@ -70,7 +70,7 @@ const b = e.object({
|
|
|
70
70
|
}), f = e.object({
|
|
71
71
|
npm: e.boolean().optional().describe("Whether to publish to npm."),
|
|
72
72
|
github: e.boolean().optional().describe("Whether to publish to github.")
|
|
73
|
-
}),
|
|
73
|
+
}), k = e.object({
|
|
74
74
|
type: e.string().optional().describe("The type of project (e.g., library, service, application)."),
|
|
75
75
|
language: e.string().optional().describe("The primary language of the project."),
|
|
76
76
|
targets: e.record(e.string(), m).optional().describe("The targets to build."),
|
|
@@ -79,7 +79,7 @@ const b = e.object({
|
|
|
79
79
|
is_build_task: e.boolean().optional().describe("Whether this is a build job."),
|
|
80
80
|
is_test_task: e.boolean().optional().describe("Whether this is a test job.")
|
|
81
81
|
}), p = e.object({
|
|
82
|
-
meta:
|
|
82
|
+
meta: k.optional(),
|
|
83
83
|
output_files: e.array(e.string()).optional().describe("The output files generated.")
|
|
84
84
|
}), d = e.object({
|
|
85
85
|
task_name: e.string().describe("The short name of the task (e.g., 'test', 'build')."),
|
|
@@ -93,7 +93,7 @@ const b = e.object({
|
|
|
93
93
|
),
|
|
94
94
|
interactive: e.boolean().describe("Whether the task is interactive."),
|
|
95
95
|
persistent: e.boolean().describe("Whether the task is persistent.")
|
|
96
|
-
}),
|
|
96
|
+
}), g = e.object({
|
|
97
97
|
status: e.literal("completed"),
|
|
98
98
|
hash: e.string().describe(
|
|
99
99
|
"The task's content hash (Base64 encoded string). Used for caching."
|
|
@@ -116,7 +116,7 @@ const b = e.object({
|
|
|
116
116
|
skip_reason: e.string().describe("The reason the task was skipped (e.g., 'disabled')."),
|
|
117
117
|
details: p
|
|
118
118
|
}), T = e.discriminatedUnion("status", [
|
|
119
|
-
|
|
119
|
+
g,
|
|
120
120
|
j,
|
|
121
121
|
_
|
|
122
122
|
]).describe(
|
package/package.json
CHANGED
package/dist/schemas-BnpD42eF.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const n=require("node:path"),u=require("node:process"),e=require("zod");function b(s,a){a||(a=u.cwd());const i={test:{rust:[],typescript:[]},build:{rust:[],typescript:[]},publish:{generic:[],npm:[],rust_github:[]}};for(const t of s){if(t.status==="skipped")continue;const o=t.task;(o.task_name==="test"||t.details.meta?.is_test_task)&&(t.details.meta?.language==="rust"&&i.test.rust.push(r(t,a)),t.details.meta?.language==="typescript"&&i.test.typescript.push(r(t,a))),(o.task_name==="build"||t.details.meta?.is_build_task)&&(t.details.meta?.language==="rust"&&i.build.rust.push(r(t,a)),t.details.meta?.language==="typescript"&&i.build.typescript.push(r(t,a))),(o.task_name==="publish"||t.details.meta?.is_publish_task)&&(t.details.meta?.language==="typescript"?i.publish.npm.push(r(t,a)):t.details.meta?.language==="rust"?i.publish.rust_github.push(r(t,a)):i.publish.generic.push(r(t,a)))}return i}function r(s,a){const i=[],t=[];if(s.details.output_files&&s.details.output_files.length>0)for(const o of s.details.output_files){const l=n.resolve(s.task.project_dir,o);m(s.task.project_dir,l)?t.push(n.relative(s.task.project_dir,l)):i.push(n.relative(a,l))}return{task_name:s.task.task_name,project_name:s.task.project_name,artifacts:{project:{name:`project-${c(s.task.project_name)}__${c(s.task.task_name)}`,files:t,files_count:t.length},workspace:{name:`workspace-${c(s.task.project_name)}__${c(s.task.task_name)}`,files:i,files_count:i.length}},project_dir:n.relative(a,s.task.project_dir),meta:s.details.meta??{}}}function m(s,a){const i=n.relative(s,a);return i&&!i.startsWith("..")&&!n.isAbsolute(i)}function c(s){let a=s.replace(/[/\\?%*:|"<> \x00-\x1f]/g,"_");return a=a.replace(/[.\s]+$/,""),/^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])$/i.test(a)&&(a+="_"),a||"unsaved_file"}const f=e.z.object({secs:e.z.number().int().nonnegative().describe("The number of whole seconds elapsed."),nanos:e.z.number().int().nonnegative().describe("The number of nanoseconds elapsed.")}),k=e.z.object({runner:e.z.string().describe("The runner to use for the target.")}),g=e.z.object({npm:e.z.boolean().optional().describe("Whether to publish to npm."),github:e.z.boolean().optional().describe("Whether to publish to github.")}),_=e.z.object({type:e.z.string().optional().describe("The type of project (e.g., library, service, application)."),language:e.z.string().optional().describe("The primary language of the project."),targets:e.z.record(e.z.string(),k).optional().describe("The targets to build."),release:g.optional(),is_publish_task:e.z.boolean().optional().describe("Whether this is a publish job."),is_build_task:e.z.boolean().optional().describe("Whether this is a build job."),is_test_task:e.z.boolean().optional().describe("Whether this is a test job.")}),p=e.z.object({meta:_.optional(),output_files:e.z.array(e.z.string()).optional().describe("The output files generated.")}),d=e.z.object({task_name:e.z.string().describe("The short name of the task (e.g., 'test', 'build')."),task_command:e.z.string().describe("The command executed for the task."),project_name:e.z.string().describe("The name of the project."),project_dir:e.z.string().describe("The absolute directory path of the project."),full_task_name:e.z.string().describe("The fully qualified task name (e.g., 'omni_utils#test')."),dependencies:e.z.array(e.z.string()).describe("A list of dependent task names."),enabled:e.z.boolean().or(e.z.string()).optional().describe("Whether the task is enabled by configuration. Either a boolean or a tera template string that evaluates to a boolean."),interactive:e.z.boolean().describe("Whether the task is interactive."),persistent:e.z.boolean().describe("Whether the task is persistent.")}),z=e.z.object({status:e.z.literal("completed"),hash:e.z.string().describe("The task's content hash (Base64 encoded string). Used for caching."),task:d,exit_code:e.z.number().int().describe("The exit code of the executed command (typically 0 for success)."),elapsed:f.describe("The duration the task took to execute."),cache_hit:e.z.boolean().describe("Indicates if the result was pulled from cache."),details:p}),j=e.z.object({status:e.z.literal("errored"),task:d,error:e.z.string().describe("The error message."),details:p}),T=e.z.object({status:e.z.literal("skipped"),task:d,skip_reason:e.z.string().describe("The reason the task was skipped (e.g., 'disabled')."),details:p}),h=e.z.discriminatedUnion("status",[z,T,j]).describe("Schema for a single task execution result (completed or skipped)."),y=e.z.array(h).describe("An array of task execution results.");exports.TaskResultArraySchema=y;exports.TaskResultSchema=h;exports.createJobs=b;
|