Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dist/azure/manifest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ module.exports = (env) => {
...gitversion.map(task => ({ path: '../tools/azure', packagePath: `${task.path}/tools/azure` })),
...gitversion.map(task => ({ path: '../tools/libs', packagePath: `${task.path}/tools/libs` })),
...gitversion.map(task => ({ path: '../tools/lib.mjs', packagePath: `${task.path}/tools/lib.mjs` })),
...gitversion.map(task => ({ path: '../rolldown-runtime.mjs', packagePath: `${task.path}/rolldown-runtime.mjs` })),
...gitreleasemanager.map(task => ({ path: task.path, packagePath: `${task.path}` })),
...gitreleasemanager.map(task => ({ path: '../tools/azure', packagePath: `${task.path}/tools/azure` })),
...gitreleasemanager.map(task => ({ path: '../tools/libs', packagePath: `${task.path}/tools/libs` })),
...gitreleasemanager.map(task => ({ path: '../tools/lib.mjs', packagePath: `${task.path}/tools/lib.mjs` })),
...gitreleasemanager.map(task => ({ path: '../rolldown-runtime.mjs', packagePath: `${task.path}/rolldown-runtime.mjs` })),
],
categories: [
'Azure Pipelines'
Expand Down
24 changes: 24 additions & 0 deletions dist/rolldown-runtime.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//#region \0rolldown/runtime.js
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
key = keys[i];
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
get: ((k) => from[k]).bind(null, key),
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
value: mod,
enumerable: true
}) : target, mod));
//#endregion
export { __toESM as n, __commonJSMin as t };
219 changes: 105 additions & 114 deletions dist/tools/azure/agent.mjs
Original file line number Diff line number Diff line change
@@ -1,123 +1,114 @@
import * as os from 'node:os';
import * as process from 'node:process';
import { B as BuildAgentBase } from '../libs/agents.mjs';

const CMD_PREFIX = "##vso[";
var TaskResult = /* @__PURE__ */ ((TaskResult2) => {
TaskResult2[TaskResult2["Succeeded"] = 0] = "Succeeded";
TaskResult2[TaskResult2["SucceededWithIssues"] = 1] = "SucceededWithIssues";
TaskResult2[TaskResult2["Failed"] = 2] = "Failed";
TaskResult2[TaskResult2["Cancelled"] = 3] = "Cancelled";
TaskResult2[TaskResult2["Skipped"] = 4] = "Skipped";
return TaskResult2;
})(TaskResult || {});
import { t as BuildAgentBase } from "../libs/agents.mjs";
import * as os from "node:os";
import * as process from "node:process";
//#region src/agents/azure/command.ts
var CMD_PREFIX = "##vso[";
var TaskResult = /* @__PURE__ */ function(TaskResult) {
TaskResult[TaskResult["Succeeded"] = 0] = "Succeeded";
TaskResult[TaskResult["SucceededWithIssues"] = 1] = "SucceededWithIssues";
TaskResult[TaskResult["Failed"] = 2] = "Failed";
TaskResult[TaskResult["Cancelled"] = 3] = "Cancelled";
TaskResult[TaskResult["Skipped"] = 4] = "Skipped";
return TaskResult;
}({});
/**
* Command Format:
* ##vso[artifact.command key=value;key=value]user message
*
* Examples:
* ##vso[task.progress value=58]
* ##vso[task.issue type=warning;]This is the user warning message
**/
function issueCommand(command, properties, message) {
const cmd = new Command(command, properties, message);
process.stdout.write(`${cmd.toString()}${os.EOL}`);
}
class Command {
command;
message;
properties;
constructor(command, properties, message) {
if (!command) {
command = "missing.command";
}
this.command = command;
this.properties = properties;
this.message = message;
}
toString() {
let cmdStr = CMD_PREFIX + this.command;
if (this.properties && Object.keys(this.properties).length > 0) {
cmdStr += " ";
for (const key in this.properties) {
if (Object.prototype.hasOwnProperty.call(this.properties, key)) {
const val = this.properties[key];
if (val) {
cmdStr += `${key}=${escapeProperty(`${val || ""}`)};`;
}
}
}
}
cmdStr += "]";
const message = `${this.message || ""}`;
cmdStr += escapeData(message);
return cmdStr;
}
const cmd = new Command(command, properties, message);
process.stdout.write(`${cmd.toString()}${os.EOL}`);
}
var Command = class {
command;
message;
properties;
constructor(command, properties, message) {
if (!command) command = "missing.command";
this.command = command;
this.properties = properties;
this.message = message;
}
toString() {
let cmdStr = CMD_PREFIX + this.command;
if (this.properties && Object.keys(this.properties).length > 0) {
cmdStr += " ";
for (const key in this.properties) if (Object.prototype.hasOwnProperty.call(this.properties, key)) {
const val = this.properties[key];
if (val) cmdStr += `${key}=${escapeProperty(`${val || ""}`)};`;
}
}
cmdStr += "]";
const message = `${this.message || ""}`;
cmdStr += escapeData(message);
return cmdStr;
}
};
function escapeData(s) {
return toCommandValue(s).replace(/%/g, "%AZP25").replace(/\r/g, "%0D").replace(/\n/g, "%0A");
return toCommandValue(s).replace(/%/g, "%AZP25").replace(/\r/g, "%0D").replace(/\n/g, "%0A");
}
function escapeProperty(s) {
return toCommandValue(s).replace(/%/g, "%AZP25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/]/g, "%5D").replace(/;/g, "%3B");
return toCommandValue(s).replace(/%/g, "%AZP25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/]/g, "%5D").replace(/;/g, "%3B");
}
function toCommandValue(input) {
if (input === null || input === void 0) {
return "";
} else if (typeof input === "string" || input instanceof String) {
return input;
}
return JSON.stringify(input);
}

class BuildAgent extends BuildAgentBase {
agentName = "Azure Pipelines";
sourceDirVariable = "BUILD_SOURCESDIRECTORY";
tempDirVariable = "AGENT_TEMPDIRECTORY";
cacheDirVariable = "AGENT_TOOLSDIRECTORY";
addPath(inputPath) {
super.addPath(inputPath);
issueCommand("task.prependpath", {}, inputPath);
}
info = (message) => {
process.stdout.write(`${message}${os.EOL}`);
};
debug = (message) => issueCommand("task.debug", {}, message);
warn = (message) => issueCommand("task.issue", { type: "warning" }, message);
error = (message) => issueCommand("task.issue", { type: "error" }, message);
setSucceeded = (message, done) => this._setResult(TaskResult.Succeeded, message, done);
setFailed = (message, done) => this._setResult(TaskResult.Failed, message, done);
setOutput = (name, value) => this._setVariable(name, value, true);
setVariable = (name, value) => this._setVariable(name, value);
updateBuildNumber = (version) => this._updateBuildNumber(version);
_updateBuildNumber(version) {
this.debug(`build number: ${version}`);
issueCommand("build.updatebuildnumber", {}, version);
}
_setResult(result, message, done) {
this.debug(`task result: ${TaskResult[result]}`);
if (result === TaskResult.Failed && message) {
this.error(message);
} else if (result === TaskResult.SucceededWithIssues && message) {
this.warn(message);
} else {
this.info(message);
}
const properties = { result: TaskResult[result] };
if (done) {
properties["done"] = "true";
}
issueCommand("task.complete", properties, message);
}
_setVariable(name, val, isOutput = false) {
const key = this._getVariableKey(name);
const varValue = val || "";
process.env[key] = varValue;
issueCommand(
"task.setvariable",
{
variable: name || "",
isOutput: (isOutput || false).toString(),
issecret: "false"
},
varValue
);
}
_getVariableKey(name) {
return name.replace(/\./g, "_").replace(/ /g, "_").toUpperCase();
}
if (input === null || input === void 0) return "";
else if (typeof input === "string" || input instanceof String) return input;
return JSON.stringify(input);
}

//#endregion
//#region src/agents/azure/build-agent.ts
var BuildAgent = class extends BuildAgentBase {
agentName = "Azure Pipelines";
sourceDirVariable = "BUILD_SOURCESDIRECTORY";
tempDirVariable = "AGENT_TEMPDIRECTORY";
cacheDirVariable = "AGENT_TOOLSDIRECTORY";
addPath(inputPath) {
super.addPath(inputPath);
issueCommand("task.prependpath", {}, inputPath);
}
info = (message) => {
process.stdout.write(`${message}${os.EOL}`);
};
debug = (message) => issueCommand("task.debug", {}, message);
warn = (message) => issueCommand("task.issue", { type: "warning" }, message);
error = (message) => issueCommand("task.issue", { type: "error" }, message);
setSucceeded = (message, done) => this._setResult(TaskResult.Succeeded, message, done);
setFailed = (message, done) => this._setResult(TaskResult.Failed, message, done);
setOutput = (name, value) => this._setVariable(name, value, true);
setVariable = (name, value) => this._setVariable(name, value);
updateBuildNumber = (version) => this._updateBuildNumber(version);
_updateBuildNumber(version) {
this.debug(`build number: ${version}`);
issueCommand("build.updatebuildnumber", {}, version);
}
_setResult(result, message, done) {
this.debug(`task result: ${TaskResult[result]}`);
if (result === TaskResult.Failed && message) this.error(message);
else if (result === TaskResult.SucceededWithIssues && message) this.warn(message);
else this.info(message);
const properties = { result: TaskResult[result] };
if (done) properties["done"] = "true";
issueCommand("task.complete", properties, message);
}
_setVariable(name, val, isOutput = false) {
const key = this._getVariableKey(name);
const varValue = val || "";
process.env[key] = varValue;
issueCommand("task.setvariable", {
variable: name || "",
isOutput: (isOutput || false).toString(),
issecret: "false"
}, varValue);
}
_getVariableKey(name) {
return name.replace(/\./g, "_").replace(/ /g, "_").toUpperCase();
}
};
//#endregion
export { BuildAgent };
//# sourceMappingURL=agent.mjs.map

//# sourceMappingURL=agent.mjs.map
Loading