@cucumber/create-meta
Advanced tools
Comparing version 4.0.0 to 5.0.0
@@ -7,4 +7,4 @@ { | ||
"revision": "${BUILD_SOURCEVERSION}", | ||
"branch": "${refbranch BUILD_SOURCEBRANCH}", | ||
"tag": "${reftag BUILD_SOURCEBRANCH}" | ||
"branch": "${BUILD_SOURCEBRANCH/refs\/heads\/(.*)/\\1}", | ||
"tag": "${BUILD_SOURCEBRANCH/refs\/tags\/(.*)/\\1}" | ||
} | ||
@@ -30,2 +30,11 @@ }, | ||
}, | ||
"Bitrise": { | ||
"url": "${BITRISE_BUILD_URL}", | ||
"git": { | ||
"remote": "${GIT_REPOSITORY_URL}", | ||
"revision": "${BITRISE_GIT_COMMIT}", | ||
"branch": "${BITRISE_GIT_BRANCH}", | ||
"tag": "${BITRISE_GIT_TAG}" | ||
} | ||
}, | ||
"CircleCI": { | ||
@@ -40,3 +49,3 @@ "url": "${CIRCLE_BUILD_URL}", | ||
}, | ||
"CodeShip": { | ||
"CodeFresh": { | ||
"url": "${CF_BUILD_URL}", | ||
@@ -50,2 +59,11 @@ "git": { | ||
}, | ||
"CodeShip": { | ||
"url": "${CI_BUILD_URL}", | ||
"git": { | ||
"remote": "${CI_PULL_REQUEST/(.*)\\/pull\\/\\d+/\\1.git}", | ||
"revision": "${CI_COMMIT_ID}", | ||
"branch": "${CI_BRANCH}", | ||
"tag": null | ||
} | ||
}, | ||
"GitHub Actions": { | ||
@@ -56,4 +74,4 @@ "url": "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}", | ||
"revision": "${GITHUB_SHA}", | ||
"branch": "${refbranch GITHUB_REF}", | ||
"tag": "${reftag GITHUB_REF}" | ||
"branch": "${GITHUB_REF/refs\/heads\/(.*)/\\1}", | ||
"tag": "${GITHUB_REF/refs\/tags\/(.*)/\\1}" | ||
} | ||
@@ -71,12 +89,21 @@ }, | ||
"GoCD": { | ||
"url": "${GO_SERVER_URL}/???", | ||
"url": "${GO_SERVER_URL}/pipelines/${GO_PIPELINE_NAME}/${GO_PIPELINE_COUNTER}/${GO_STAGE_NAME}/${GO_STAGE_COUNTER}", | ||
"git": { | ||
"remote": null, | ||
"remote": "${GO_SCM_*_PR_URL/(.*)\\/pull\\/\\d+/\\1.git}", | ||
"revision": "${GO_REVISION}", | ||
"branch": null, | ||
"branch": "${GO_SCM_*_PR_BRANCH/.*:(.*)/\\1}", | ||
"tag": null | ||
} | ||
}, | ||
"Jenkins": { | ||
"url": "${BUILD_URL}", | ||
"git": { | ||
"remote": "${GIT_URL}", | ||
"revision": "${GIT_COMMIT}", | ||
"branch": "${GIT_LOCAL_BRANCH}", | ||
"tag": null | ||
} | ||
}, | ||
"Semaphore": { | ||
"url": "${SEMAPHORE_ORGANIZATION_URL}/${}", | ||
"url": "${SEMAPHORE_ORGANIZATION_URL}/jobs/${SEMAPHORE_JOB_ID}", | ||
"git": { | ||
@@ -83,0 +110,0 @@ "remote": "${SEMAPHORE_GIT_URL}", |
@@ -1,8 +0,4 @@ | ||
import { messages } from '@cucumber/messages'; | ||
export declare type CiDict = { | ||
[name: string]: CiSystem; | ||
}; | ||
export declare type EnvDict = { | ||
[name: string]: string | undefined; | ||
}; | ||
import * as messages from '@cucumber/messages'; | ||
export declare type CiDict = Record<string, CiSystem>; | ||
export declare type Env = Record<string, string | undefined>; | ||
export interface CiSystem { | ||
@@ -17,5 +13,5 @@ url: string; | ||
} | ||
export default function createMeta(toolName: string, toolVersion: string, envDict: EnvDict, ciDict?: CiDict): messages.Meta; | ||
export declare function detectCI(ciDict: CiDict, envDict: EnvDict): messages.Meta.CI | undefined; | ||
export default function createMeta(toolName: string, toolVersion: string, envDict: Env, ciDict?: CiDict): messages.Meta; | ||
export declare function detectCI(ciDict: CiDict, envDict: Env): messages.Ci | undefined; | ||
export declare function removeUserInfoFromUrl(value: string): string; | ||
//# sourceMappingURL=createMeta.d.ts.map |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -9,4 +28,5 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
const url_1 = require("url"); | ||
const messages_1 = require("@cucumber/messages"); | ||
const messages = __importStar(require("@cucumber/messages")); | ||
const ciDict_json_1 = __importDefault(require("./ciDict.json")); | ||
const evaluateVariableExpression_1 = __importDefault(require("./evaluateVariableExpression")); | ||
function createMeta(toolName, toolVersion, envDict, ciDict) { | ||
@@ -16,21 +36,21 @@ if (ciDict === undefined) { | ||
} | ||
return new messages_1.messages.Meta({ | ||
protocolVersion: messages_1.version, | ||
implementation: new messages_1.messages.Meta.Product({ | ||
return { | ||
protocolVersion: messages.version, | ||
implementation: { | ||
name: toolName, | ||
version: toolVersion, | ||
}), | ||
cpu: new messages_1.messages.Meta.Product({ | ||
}, | ||
cpu: { | ||
name: os_1.default.arch(), | ||
}), | ||
os: new messages_1.messages.Meta.Product({ | ||
}, | ||
os: { | ||
name: os_1.default.platform(), | ||
version: os_1.default.release(), | ||
}), | ||
runtime: new messages_1.messages.Meta.Product({ | ||
}, | ||
runtime: { | ||
name: 'node.js', | ||
version: process.versions.node, | ||
}), | ||
}, | ||
ci: detectCI(ciDict, envDict), | ||
}); | ||
}; | ||
} | ||
@@ -49,2 +69,6 @@ exports.default = createMeta; | ||
} | ||
if (detected.length > 1) { | ||
console.error(`@cucumber/create-meta WARNING: Detected more than one CI: ${JSON.stringify(detected, null, 2)}`); | ||
console.error('Using the first one.'); | ||
} | ||
return detected[0]; | ||
@@ -64,3 +88,3 @@ } | ||
function createCi(ciName, ciSystem, envDict) { | ||
const url = evaluate(ciSystem.url, envDict); | ||
const url = evaluateVariableExpression_1.default(ciSystem.url, envDict); | ||
if (url === undefined) { | ||
@@ -71,54 +95,14 @@ // The url is what consumers will use as the primary key for a build | ||
} | ||
return messages_1.messages.Meta.CI.create({ | ||
let branch = evaluateVariableExpression_1.default(ciSystem.git.branch, envDict); | ||
return { | ||
url, | ||
name: ciName, | ||
git: { | ||
remote: removeUserInfoFromUrl(evaluate(ciSystem.git.remote, envDict)), | ||
revision: evaluate(ciSystem.git.revision, envDict), | ||
branch: evaluate(ciSystem.git.branch, envDict), | ||
tag: evaluate(ciSystem.git.tag, envDict), | ||
remote: removeUserInfoFromUrl(evaluateVariableExpression_1.default(ciSystem.git.remote, envDict)), | ||
revision: evaluateVariableExpression_1.default(ciSystem.git.revision, envDict), | ||
branch: branch, | ||
tag: evaluateVariableExpression_1.default(ciSystem.git.tag, envDict), | ||
}, | ||
}); | ||
}; | ||
} | ||
/** | ||
* Evaluates a simple template | ||
* | ||
* @param template - the template from the ciDict.json file | ||
* @param envDict - variables | ||
* @return the evaluated template, or undefined if a variable was undefined | ||
*/ | ||
function evaluate(template, envDict) { | ||
if (template === undefined) { | ||
return undefined; | ||
} | ||
try { | ||
return template.replace(/\${((refbranch|reftag)\s+)?([^\s}]+)(\s+\|\s+([^}]+))?}/g, (substring, ...args) => { | ||
const func = args[1]; | ||
const variable = args[2]; | ||
const defaultValue = args[4]; | ||
const value = envDict[variable] || defaultValue; | ||
if (value === undefined) { | ||
throw new Error(`Undefined variable: ${variable}`); | ||
} | ||
switch (func) { | ||
case 'refbranch': | ||
return group1(value, /^refs\/heads\/(.*)/); | ||
case 'reftag': | ||
return group1(value, /^refs\/tags\/(.*)/); | ||
default: | ||
return value; | ||
} | ||
}); | ||
} | ||
catch (err) { | ||
// There was an undefined variable | ||
return undefined; | ||
} | ||
} | ||
function group1(value, regexp) { | ||
const match = value.match(regexp); | ||
if (match === null) | ||
throw new Error('No match'); | ||
return match[1]; | ||
} | ||
//# sourceMappingURL=createMeta.js.map |
@@ -25,3 +25,3 @@ "use strict"; | ||
const ci = createMeta_1.detectCI(ciDict_json_1.default, env); | ||
stdout.write(JSON.stringify(ci.toJSON(), null, 2) + '\n'); | ||
stdout.write(JSON.stringify(ci, null, 2) + '\n'); | ||
}); | ||
@@ -28,0 +28,0 @@ } |
@@ -9,3 +9,2 @@ "use strict"; | ||
const ciDict_json_1 = __importDefault(require("../src/ciDict.json")); | ||
const messages_1 = require("@cucumber/messages"); | ||
describe('createMeta', () => { | ||
@@ -26,3 +25,3 @@ it('defines the implementation product', () => { | ||
const meta = createMeta_1.default('someTool', '1.2.3', envDict, ciDict_json_1.default); | ||
assert_1.default.deepStrictEqual(meta.ci, messages_1.messages.Meta.CI.create({ | ||
const ci = { | ||
name: 'CircleCI', | ||
@@ -36,3 +35,4 @@ url: 'the-url', | ||
}, | ||
})); | ||
}; | ||
assert_1.default.deepStrictEqual(meta.ci, ci); | ||
}); | ||
@@ -48,3 +48,3 @@ it('detects GitHub Actions', () => { | ||
const meta = createMeta_1.default('someTool', '1.2.3', envDict, ciDict_json_1.default); | ||
assert_1.default.deepStrictEqual(meta.ci, messages_1.messages.Meta.CI.create({ | ||
const ci = { | ||
name: 'GitHub Actions', | ||
@@ -58,3 +58,4 @@ url: 'https://github.com/cucumber/cucumber-ruby/actions/runs/140170388', | ||
}, | ||
})); | ||
}; | ||
assert_1.default.deepStrictEqual(meta.ci, ci); | ||
}); | ||
@@ -70,3 +71,3 @@ it('detects GitHub Actions with custom base url', () => { | ||
const meta = createMeta_1.default('someTool', '1.2.3', envDict, ciDict_json_1.default); | ||
assert_1.default.deepStrictEqual(meta.ci, messages_1.messages.Meta.CI.create({ | ||
const ci = { | ||
name: 'GitHub Actions', | ||
@@ -80,3 +81,4 @@ url: 'https://github.company.com/cucumber/cucumber-ruby/actions/runs/140170388', | ||
}, | ||
})); | ||
}; | ||
assert_1.default.deepStrictEqual(meta.ci, ci); | ||
}); | ||
@@ -91,3 +93,3 @@ it('post-processes git refs to branch', () => { | ||
const meta = createMeta_1.default('someTool', '1.2.3', envDict, ciDict_json_1.default); | ||
assert_1.default.deepStrictEqual(meta.ci, messages_1.messages.Meta.CI.create({ | ||
const ci = { | ||
name: 'Azure Pipelines', | ||
@@ -101,3 +103,4 @@ url: 'the-url', | ||
}, | ||
})); | ||
}; | ||
assert_1.default.deepStrictEqual(meta.ci, ci); | ||
}); | ||
@@ -112,3 +115,3 @@ it('post-processes git refs to tag', () => { | ||
const meta = createMeta_1.default('someTool', '1.2.3', envDict, ciDict_json_1.default); | ||
assert_1.default.deepStrictEqual(meta.ci, messages_1.messages.Meta.CI.create({ | ||
const ci = { | ||
name: 'Azure Pipelines', | ||
@@ -122,5 +125,6 @@ url: 'the-url', | ||
}, | ||
})); | ||
}; | ||
assert_1.default.deepStrictEqual(meta.ci, ci); | ||
}); | ||
}); | ||
//# sourceMappingURL=createMetaTest.js.map |
{ | ||
"name": "@cucumber/create-meta", | ||
"version": "4.0.0", | ||
"version": "5.0.0", | ||
"description": "Produce the meta message for Cucumber JavaScript", | ||
@@ -10,3 +10,3 @@ "main": "dist/src/index.js", | ||
"prepublishOnly": "tsc --build tsconfig.build.json", | ||
"print-meta": "ts-node --require tsconfig-paths/register ./src/printMeta.ts" | ||
"print-meta": "ts-node --require source-map-support/register --require tsconfig-paths/register ./src/printMeta.ts" | ||
}, | ||
@@ -27,12 +27,12 @@ "repository": { | ||
"devDependencies": { | ||
"@types/glob": "^7.1.3", | ||
"@types/mocha": "^8.2.2", | ||
"@types/node": "^14.14.37", | ||
"mocha": "^8.3.2", | ||
"source-map-support": "^0.5.19", | ||
"ts-node": "^9.1.1", | ||
"typescript": "^4.2.3" | ||
"@types/glob": "7.1.3", | ||
"@types/mocha": "8.2.2", | ||
"@types/node": "15.3.0", | ||
"mocha": "8.4.0", | ||
"source-map-support": "0.5.19", | ||
"ts-node": "9.1.1", | ||
"typescript": "4.2.4" | ||
}, | ||
"dependencies": { | ||
"@cucumber/messages": "^15.0.0" | ||
"@cucumber/messages": "^16.0.0" | ||
}, | ||
@@ -39,0 +39,0 @@ "directories": { |
@@ -7,4 +7,4 @@ { | ||
"revision": "${BUILD_SOURCEVERSION}", | ||
"branch": "${refbranch BUILD_SOURCEBRANCH}", | ||
"tag": "${reftag BUILD_SOURCEBRANCH}" | ||
"branch": "${BUILD_SOURCEBRANCH/refs\/heads\/(.*)/\\1}", | ||
"tag": "${BUILD_SOURCEBRANCH/refs\/tags\/(.*)/\\1}" | ||
} | ||
@@ -30,2 +30,11 @@ }, | ||
}, | ||
"Bitrise": { | ||
"url": "${BITRISE_BUILD_URL}", | ||
"git": { | ||
"remote": "${GIT_REPOSITORY_URL}", | ||
"revision": "${BITRISE_GIT_COMMIT}", | ||
"branch": "${BITRISE_GIT_BRANCH}", | ||
"tag": "${BITRISE_GIT_TAG}" | ||
} | ||
}, | ||
"CircleCI": { | ||
@@ -40,3 +49,3 @@ "url": "${CIRCLE_BUILD_URL}", | ||
}, | ||
"CodeShip": { | ||
"CodeFresh": { | ||
"url": "${CF_BUILD_URL}", | ||
@@ -50,2 +59,11 @@ "git": { | ||
}, | ||
"CodeShip": { | ||
"url": "${CI_BUILD_URL}", | ||
"git": { | ||
"remote": "${CI_PULL_REQUEST/(.*)\\/pull\\/\\d+/\\1.git}", | ||
"revision": "${CI_COMMIT_ID}", | ||
"branch": "${CI_BRANCH}", | ||
"tag": null | ||
} | ||
}, | ||
"GitHub Actions": { | ||
@@ -56,4 +74,4 @@ "url": "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}", | ||
"revision": "${GITHUB_SHA}", | ||
"branch": "${refbranch GITHUB_REF}", | ||
"tag": "${reftag GITHUB_REF}" | ||
"branch": "${GITHUB_REF/refs\/heads\/(.*)/\\1}", | ||
"tag": "${GITHUB_REF/refs\/tags\/(.*)/\\1}" | ||
} | ||
@@ -71,12 +89,21 @@ }, | ||
"GoCD": { | ||
"url": "${GO_SERVER_URL}/???", | ||
"url": "${GO_SERVER_URL}/pipelines/${GO_PIPELINE_NAME}/${GO_PIPELINE_COUNTER}/${GO_STAGE_NAME}/${GO_STAGE_COUNTER}", | ||
"git": { | ||
"remote": null, | ||
"remote": "${GO_SCM_*_PR_URL/(.*)\\/pull\\/\\d+/\\1.git}", | ||
"revision": "${GO_REVISION}", | ||
"branch": null, | ||
"branch": "${GO_SCM_*_PR_BRANCH/.*:(.*)/\\1}", | ||
"tag": null | ||
} | ||
}, | ||
"Jenkins": { | ||
"url": "${BUILD_URL}", | ||
"git": { | ||
"remote": "${GIT_URL}", | ||
"revision": "${GIT_COMMIT}", | ||
"branch": "${GIT_LOCAL_BRANCH}", | ||
"tag": null | ||
} | ||
}, | ||
"Semaphore": { | ||
"url": "${SEMAPHORE_ORGANIZATION_URL}/${}", | ||
"url": "${SEMAPHORE_ORGANIZATION_URL}/jobs/${SEMAPHORE_JOB_ID}", | ||
"git": { | ||
@@ -83,0 +110,0 @@ "remote": "${SEMAPHORE_GIT_URL}", |
import os from 'os' | ||
import { parse as parseUrl, format as formatUrl } from 'url' | ||
import { messages, version as protocolVersion } from '@cucumber/messages' | ||
import * as messages from '@cucumber/messages' | ||
import defaultCiDict from './ciDict.json' | ||
import evaluateVariableExpression from "./evaluateVariableExpression"; | ||
export type CiDict = { [name: string]: CiSystem } | ||
export type EnvDict = { [name: string]: string | undefined } | ||
export type CiDict = Record<string,CiSystem> | ||
export type Env = Record<string,string|undefined> | ||
@@ -22,3 +23,3 @@ export interface CiSystem { | ||
toolVersion: string, | ||
envDict: EnvDict, | ||
envDict: Env, | ||
ciDict?: CiDict | ||
@@ -29,25 +30,25 @@ ): messages.Meta { | ||
} | ||
return new messages.Meta({ | ||
protocolVersion, | ||
implementation: new messages.Meta.Product({ | ||
return { | ||
protocolVersion: messages.version, | ||
implementation: { | ||
name: toolName, | ||
version: toolVersion, | ||
}), | ||
cpu: new messages.Meta.Product({ | ||
}, | ||
cpu: { | ||
name: os.arch(), | ||
}), | ||
os: new messages.Meta.Product({ | ||
}, | ||
os: { | ||
name: os.platform(), | ||
version: os.release(), | ||
}), | ||
runtime: new messages.Meta.Product({ | ||
}, | ||
runtime: { | ||
name: 'node.js', | ||
version: process.versions.node, | ||
}), | ||
}, | ||
ci: detectCI(ciDict, envDict), | ||
}) | ||
} | ||
} | ||
export function detectCI(ciDict: CiDict, envDict: EnvDict): messages.Meta.CI | undefined { | ||
const detected: messages.Meta.CI[] = [] | ||
export function detectCI(ciDict: CiDict, envDict: Env): messages.Ci | undefined { | ||
const detected: messages.Ci[] = [] | ||
for (const [ciName, ciSystem] of Object.entries(ciDict)) { | ||
@@ -62,2 +63,6 @@ const ci = createCi(ciName, ciSystem, envDict) | ||
} | ||
if (detected.length > 1) { | ||
console.error(`@cucumber/create-meta WARNING: Detected more than one CI: ${JSON.stringify(detected, null, 2)}`) | ||
console.error('Using the first one.') | ||
} | ||
return detected[0] | ||
@@ -74,8 +79,4 @@ } | ||
function createCi( | ||
ciName: string, | ||
ciSystem: CiSystem, | ||
envDict: EnvDict | ||
): messages.Meta.CI | undefined { | ||
const url = evaluate(ciSystem.url, envDict) | ||
function createCi(ciName: string, ciSystem: CiSystem, envDict: Env): messages.Ci | undefined { | ||
const url = evaluateVariableExpression(ciSystem.url, envDict) | ||
if (url === undefined) { | ||
@@ -87,56 +88,14 @@ // The url is what consumers will use as the primary key for a build | ||
return messages.Meta.CI.create({ | ||
let branch = evaluateVariableExpression(ciSystem.git.branch, envDict); | ||
return { | ||
url, | ||
name: ciName, | ||
git: { | ||
remote: removeUserInfoFromUrl(evaluate(ciSystem.git.remote, envDict)), | ||
revision: evaluate(ciSystem.git.revision, envDict), | ||
branch: evaluate(ciSystem.git.branch, envDict), | ||
tag: evaluate(ciSystem.git.tag, envDict), | ||
remote: removeUserInfoFromUrl(evaluateVariableExpression(ciSystem.git.remote, envDict)), | ||
revision: evaluateVariableExpression(ciSystem.git.revision, envDict), | ||
branch: branch, | ||
tag: evaluateVariableExpression(ciSystem.git.tag, envDict), | ||
}, | ||
}) | ||
} | ||
/** | ||
* Evaluates a simple template | ||
* | ||
* @param template - the template from the ciDict.json file | ||
* @param envDict - variables | ||
* @return the evaluated template, or undefined if a variable was undefined | ||
*/ | ||
function evaluate(template: string, envDict: EnvDict): string | undefined { | ||
if (template === undefined) { | ||
return undefined | ||
} | ||
try { | ||
return template.replace( | ||
/\${((refbranch|reftag)\s+)?([^\s}]+)(\s+\|\s+([^}]+))?}/g, | ||
(substring: string, ...args: any[]): string => { | ||
const func = args[1] | ||
const variable = args[2] | ||
const defaultValue = args[4] | ||
const value = envDict[variable] || defaultValue | ||
if (value === undefined) { | ||
throw new Error(`Undefined variable: ${variable}`) | ||
} | ||
switch (func) { | ||
case 'refbranch': | ||
return group1(value, /^refs\/heads\/(.*)/) | ||
case 'reftag': | ||
return group1(value, /^refs\/tags\/(.*)/) | ||
default: | ||
return value | ||
} | ||
} | ||
) | ||
} catch (err) { | ||
// There was an undefined variable | ||
return undefined | ||
} | ||
} | ||
function group1(value: string, regexp: RegExp): string { | ||
const match = value.match(regexp) | ||
if (match === null) throw new Error('No match') | ||
return match[1] | ||
} |
@@ -11,4 +11,4 @@ import { promises as fs } from 'fs' | ||
const ci = detectCI(ciDict, env) | ||
stdout.write(JSON.stringify(ci.toJSON(), null, 2) + '\n') | ||
stdout.write(JSON.stringify(ci, null, 2) + '\n') | ||
} | ||
main(process.argv[2], process.stdout).catch((err) => console.error(err.backtrace)) |
import createMeta from '../src/createMeta' | ||
import assert from 'assert' | ||
import ciDict from '../src/ciDict.json' | ||
import { messages } from '@cucumber/messages' | ||
import * as messages from '@cucumber/messages' | ||
@@ -24,15 +24,13 @@ describe('createMeta', () => { | ||
const meta = createMeta('someTool', '1.2.3', envDict, ciDict) | ||
assert.deepStrictEqual( | ||
meta.ci, | ||
messages.Meta.CI.create({ | ||
name: 'CircleCI', | ||
url: 'the-url', | ||
git: { | ||
remote: 'the-remote', | ||
branch: 'the-branch', | ||
revision: 'the-revision', | ||
tag: 'the-tag', | ||
}, | ||
}) | ||
) | ||
const ci: messages.Ci = { | ||
name: 'CircleCI', | ||
url: 'the-url', | ||
git: { | ||
remote: 'the-remote', | ||
branch: 'the-branch', | ||
revision: 'the-revision', | ||
tag: 'the-tag', | ||
}, | ||
} | ||
assert.deepStrictEqual(meta.ci, ci) | ||
}) | ||
@@ -50,15 +48,13 @@ | ||
const meta = createMeta('someTool', '1.2.3', envDict, ciDict) | ||
assert.deepStrictEqual( | ||
meta.ci, | ||
messages.Meta.CI.create({ | ||
name: 'GitHub Actions', | ||
url: 'https://github.com/cucumber/cucumber-ruby/actions/runs/140170388', | ||
git: { | ||
remote: 'https://github.com/cucumber/cucumber-ruby.git', | ||
branch: undefined, | ||
revision: 'the-revision', | ||
tag: 'the-tag', | ||
}, | ||
}) | ||
) | ||
const ci: messages.Ci = { | ||
name: 'GitHub Actions', | ||
url: 'https://github.com/cucumber/cucumber-ruby/actions/runs/140170388', | ||
git: { | ||
remote: 'https://github.com/cucumber/cucumber-ruby.git', | ||
branch: undefined, | ||
revision: 'the-revision', | ||
tag: 'the-tag', | ||
}, | ||
} | ||
assert.deepStrictEqual(meta.ci, ci) | ||
}) | ||
@@ -76,15 +72,13 @@ | ||
const meta = createMeta('someTool', '1.2.3', envDict, ciDict) | ||
assert.deepStrictEqual( | ||
meta.ci, | ||
messages.Meta.CI.create({ | ||
name: 'GitHub Actions', | ||
url: 'https://github.company.com/cucumber/cucumber-ruby/actions/runs/140170388', | ||
git: { | ||
remote: 'https://github.company.com/cucumber/cucumber-ruby.git', | ||
branch: 'the-branch', | ||
revision: 'the-revision', | ||
tag: undefined, | ||
}, | ||
}) | ||
) | ||
const ci: messages.Ci = { | ||
name: 'GitHub Actions', | ||
url: 'https://github.company.com/cucumber/cucumber-ruby/actions/runs/140170388', | ||
git: { | ||
remote: 'https://github.company.com/cucumber/cucumber-ruby.git', | ||
branch: 'the-branch', | ||
revision: 'the-revision', | ||
tag: undefined, | ||
}, | ||
} | ||
assert.deepStrictEqual(meta.ci, ci) | ||
}) | ||
@@ -101,15 +95,13 @@ | ||
const meta = createMeta('someTool', '1.2.3', envDict, ciDict) | ||
assert.deepStrictEqual( | ||
meta.ci, | ||
messages.Meta.CI.create({ | ||
name: 'Azure Pipelines', | ||
url: 'the-url', | ||
git: { | ||
remote: 'the-remote', | ||
branch: 'main', | ||
revision: 'the-revision', | ||
tag: undefined, | ||
}, | ||
}) | ||
) | ||
const ci: messages.Ci = { | ||
name: 'Azure Pipelines', | ||
url: 'the-url', | ||
git: { | ||
remote: 'the-remote', | ||
branch: 'main', | ||
revision: 'the-revision', | ||
tag: undefined, | ||
}, | ||
} | ||
assert.deepStrictEqual(meta.ci, ci) | ||
}) | ||
@@ -126,16 +118,14 @@ | ||
const meta = createMeta('someTool', '1.2.3', envDict, ciDict) | ||
assert.deepStrictEqual( | ||
meta.ci, | ||
messages.Meta.CI.create({ | ||
name: 'Azure Pipelines', | ||
url: 'the-url', | ||
git: { | ||
remote: 'the-remote', | ||
branch: undefined, | ||
revision: 'the-revision', | ||
tag: 'v1.2.3', | ||
}, | ||
}) | ||
) | ||
const ci: messages.Ci = { | ||
name: 'Azure Pipelines', | ||
url: 'the-url', | ||
git: { | ||
remote: 'the-remote', | ||
branch: undefined, | ||
revision: 'the-revision', | ||
tag: 'v1.2.3', | ||
}, | ||
} | ||
assert.deepStrictEqual(meta.ci, ci) | ||
}) | ||
}) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
263156
49
1020
+ Added@cucumber/messages@16.0.1(transitive)
+ Added@types/uuid@8.3.0(transitive)
+ Addedclass-transformer@0.4.0(transitive)
+ Addedreflect-metadata@0.1.13(transitive)
- Removed@cucumber/messages@15.0.0(transitive)
- Removed@protobufjs/aspromise@1.1.2(transitive)
- Removed@protobufjs/base64@1.1.2(transitive)
- Removed@protobufjs/codegen@2.0.4(transitive)
- Removed@protobufjs/eventemitter@1.1.0(transitive)
- Removed@protobufjs/fetch@1.1.0(transitive)
- Removed@protobufjs/float@1.0.2(transitive)
- Removed@protobufjs/inquire@1.1.0(transitive)
- Removed@protobufjs/path@1.1.2(transitive)
- Removed@protobufjs/pool@1.1.0(transitive)
- Removed@protobufjs/utf8@1.1.0(transitive)
- Removed@types/long@4.0.2(transitive)
- Removed@types/node@22.9.0(transitive)
- Removed@types/uuid@8.3.4(transitive)
- Removedlong@4.0.0(transitive)
- Removedprotobufjs@6.11.4(transitive)
- Removedundici-types@6.19.8(transitive)
Updated@cucumber/messages@^16.0.0