mcdev 10.1.1 → 10.2.0
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/@types/lib/metadataTypes/AttributeGroup.d.ts +69 -24
- package/@types/lib/metadataTypes/AttributeGroup.d.ts.map +1 -1
- package/@types/lib/metadataTypes/AttributeSet.d.ts +521 -301
- package/@types/lib/metadataTypes/AttributeSet.d.ts.map +1 -1
- package/@types/lib/metadataTypes/Folder.d.ts.map +1 -1
- package/@types/lib/metadataTypes/Journey.d.ts +43 -12
- package/@types/lib/metadataTypes/Journey.d.ts.map +1 -1
- package/@types/lib/metadataTypes/MetadataType.d.ts.map +1 -1
- package/@types/lib/metadataTypes/MobileMessage.d.ts +7 -0
- package/@types/lib/metadataTypes/MobileMessage.d.ts.map +1 -1
- package/@types/lib/metadataTypes/MobilePush.d.ts +8 -0
- package/@types/lib/metadataTypes/MobilePush.d.ts.map +1 -1
- package/@types/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts +25 -20
- package/@types/lib/metadataTypes/definitions/AttributeSet.definition.d.ts +327 -296
- package/lib/metadataTypes/AttributeGroup.js +173 -1
- package/lib/metadataTypes/AttributeSet.js +847 -14
- package/lib/metadataTypes/Folder.js +20 -0
- package/lib/metadataTypes/Journey.js +265 -21
- package/lib/metadataTypes/MetadataType.js +21 -13
- package/lib/metadataTypes/MobileMessage.js +32 -3
- package/lib/metadataTypes/MobilePush.js +37 -3
- package/lib/metadataTypes/definitions/AttributeGroup.definition.js +55 -48
- package/lib/metadataTypes/definitions/AttributeSet.definition.js +345 -316
- package/package.json +16 -14
- package/scripts/verify-own-dependencies-latest.mjs +117 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcdev",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.2.0",
|
|
4
4
|
"description": "Accenture Salesforce Marketing Cloud DevTools",
|
|
5
5
|
"author": "Accenture: joern.berkefeld, douglas.midgley, robert.zimmermann, maciej.barnas",
|
|
6
6
|
"license": "MIT",
|
|
@@ -59,6 +59,8 @@
|
|
|
59
59
|
"prepare": "husky || true",
|
|
60
60
|
"lint-and-test": "run-s lint test",
|
|
61
61
|
"test": "node test/run.js",
|
|
62
|
+
"verify:own-dependencies-latest": "node scripts/verify-own-dependencies-latest.mjs",
|
|
63
|
+
"preversion": "npm run verify:own-dependencies-latest",
|
|
62
64
|
"coverage": "c8 npm run test",
|
|
63
65
|
"prepare-release:audit-fix": "npm audit fix",
|
|
64
66
|
"prepare-release:git": "node prepare-release.js",
|
|
@@ -68,14 +70,14 @@
|
|
|
68
70
|
"version:patch": "npm version --no-commit-hooks patch"
|
|
69
71
|
},
|
|
70
72
|
"dependencies": {
|
|
71
|
-
"@inquirer/prompts": "8.
|
|
72
|
-
"fast-xml-parser": "5.
|
|
73
|
+
"@inquirer/prompts": "8.8.0",
|
|
74
|
+
"fast-xml-parser": "5.12.1",
|
|
73
75
|
"fs-extra": "11.4.1",
|
|
74
76
|
"mustache": "4.2.0",
|
|
75
77
|
"p-limit": "7.3.3",
|
|
76
|
-
"prettier": "3.
|
|
77
|
-
"prettier-plugin-sfmc": "2.
|
|
78
|
-
"semver": "7.8.
|
|
78
|
+
"prettier": "3.10.1",
|
|
79
|
+
"prettier-plugin-sfmc": "2.2.1",
|
|
80
|
+
"semver": "7.8.6",
|
|
79
81
|
"sfmc-sdk": "4.0.2",
|
|
80
82
|
"winston": "3.19.0",
|
|
81
83
|
"yargs": "18.2.0"
|
|
@@ -87,27 +89,27 @@
|
|
|
87
89
|
"@types/fs-extra": "11.0.4",
|
|
88
90
|
"@types/mocha": "10.0.10",
|
|
89
91
|
"@types/mock-fs": "4.13.4",
|
|
90
|
-
"@types/node": "26.6.
|
|
92
|
+
"@types/node": "26.6.6",
|
|
91
93
|
"@types/yargs": "17.0.35",
|
|
92
94
|
"assert": "2.1.0",
|
|
93
95
|
"axios-mock-adapter": "2.1.0",
|
|
94
96
|
"c8": "12.0.0",
|
|
95
97
|
"chai": "6.3.0",
|
|
96
98
|
"chai-files": "1.4.0",
|
|
97
|
-
"eslint": "10.
|
|
99
|
+
"eslint": "10.15.0",
|
|
98
100
|
"eslint-config-prettier": "10.1.8",
|
|
99
|
-
"eslint-plugin-jsdoc": "65.4.
|
|
101
|
+
"eslint-plugin-jsdoc": "65.4.9",
|
|
100
102
|
"eslint-plugin-mocha": "12.0.2",
|
|
101
103
|
"eslint-plugin-prettier": "5.5.7",
|
|
102
|
-
"eslint-plugin-sfmc": "5.
|
|
104
|
+
"eslint-plugin-sfmc": "5.3.0",
|
|
103
105
|
"eslint-plugin-unicorn": "76.0.0",
|
|
104
|
-
"globals": "17.
|
|
106
|
+
"globals": "17.14.0",
|
|
105
107
|
"husky": "9.1.7",
|
|
106
|
-
"lint-staged": "17.6.
|
|
107
|
-
"mocha": "
|
|
108
|
+
"lint-staged": "17.6.1",
|
|
109
|
+
"mocha": "12.0.3",
|
|
108
110
|
"mock-fs": "5.5.0",
|
|
109
111
|
"npm-run-all": "4.1.5",
|
|
110
|
-
"prettier-eslint": "17.1.
|
|
112
|
+
"prettier-eslint": "17.1.3",
|
|
111
113
|
"typescript": "5.9.3"
|
|
112
114
|
},
|
|
113
115
|
"lint-staged": {
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated copy - source of truth: repo-root scripts/verify-own-dependencies-latest.mjs
|
|
3
|
+
* Do not hand-edit; update the canonical script, run `node scripts/sync-own-deps-check.mjs`
|
|
4
|
+
* at the workspace root, then `npm run lint:fix` here.
|
|
5
|
+
*
|
|
6
|
+
* Release-time check: every one of our own packages in package-lock.json (top-level or nested
|
|
7
|
+
* below another package) must be the newest version published on npm. A package fixed upstream
|
|
8
|
+
* but stale here would otherwise ship stale (bundled extensions) or never reach users because a
|
|
9
|
+
* pinned or narrow range excludes it (npm packages).
|
|
10
|
+
*
|
|
11
|
+
* `npm ci` already requires package-lock.json to satisfy package.json, so "locked == latest" also
|
|
12
|
+
* proves the declared range admits the newest version.
|
|
13
|
+
*
|
|
14
|
+
* Run from the package root: npm run verify:own-dependencies-latest (asks the npm registry)
|
|
15
|
+
*/
|
|
16
|
+
import assert from 'node:assert/strict';
|
|
17
|
+
import { readFileSync } from 'node:fs';
|
|
18
|
+
import path from 'node:path';
|
|
19
|
+
import process from 'node:process';
|
|
20
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Packages maintained in this workspace (or contributed to and released alongside it).
|
|
24
|
+
*/
|
|
25
|
+
export const OWNED_PACKAGES = [
|
|
26
|
+
'@joern.berkefeld/csv-parser',
|
|
27
|
+
'ampscript-data',
|
|
28
|
+
'ampscript-parser',
|
|
29
|
+
'eslint-plugin-mcdev',
|
|
30
|
+
'eslint-plugin-mso-email',
|
|
31
|
+
'eslint-plugin-sfmc',
|
|
32
|
+
'handlebars-data',
|
|
33
|
+
'mcdev',
|
|
34
|
+
'mso-conditional-parser',
|
|
35
|
+
'prettier-plugin-sfmc',
|
|
36
|
+
'sf-plugin-cms',
|
|
37
|
+
'sfmc-dataloader',
|
|
38
|
+
'sfmc-handlebars-parser',
|
|
39
|
+
'sfmc-language-lsp',
|
|
40
|
+
'sfmc-sdk',
|
|
41
|
+
'ssjs-data',
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Lists every installed copy of an owned package in a lockfile, including nested copies.
|
|
46
|
+
*
|
|
47
|
+
* @param {object} lock - parsed package-lock.json
|
|
48
|
+
* @returns {{name: string, version: string, location: string}[]} installed copies
|
|
49
|
+
*/
|
|
50
|
+
export function lockedVersions(lock) {
|
|
51
|
+
const found = [];
|
|
52
|
+
const installed = Object.entries(lock.packages ?? {});
|
|
53
|
+
for (const [location, entry] of installed) {
|
|
54
|
+
if (entry.link) {
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
const name = OWNED_PACKAGES.find(
|
|
58
|
+
(owned) =>
|
|
59
|
+
location === `node_modules/${owned}` || location.endsWith(`/node_modules/${owned}`)
|
|
60
|
+
);
|
|
61
|
+
if (name) {
|
|
62
|
+
found.push({ name, version: entry.version, location });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return found;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Compares the locked owned packages with the newest published versions.
|
|
70
|
+
*
|
|
71
|
+
* @param {object} lock - parsed package-lock.json
|
|
72
|
+
* @param {Record<string, string>} latestByName - newest published version by package name
|
|
73
|
+
* @returns {string[]} one message per stale copy
|
|
74
|
+
*/
|
|
75
|
+
export function findOutdated(lock, latestByName) {
|
|
76
|
+
const outdated = [];
|
|
77
|
+
const copies = lockedVersions(lock);
|
|
78
|
+
for (const { name, version, location } of copies) {
|
|
79
|
+
const latest = latestByName[name];
|
|
80
|
+
assert.ok(latest, `No published version known for ${name}`);
|
|
81
|
+
if (version !== latest) {
|
|
82
|
+
outdated.push(`${location}: ${name} is locked at ${version}, npm has ${latest}`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return outdated;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Asks the public npm registry for the newest version of a package.
|
|
90
|
+
*
|
|
91
|
+
* @param {string} name - package name
|
|
92
|
+
* @returns {Promise.<string>} version
|
|
93
|
+
*/
|
|
94
|
+
async function latestVersion(name) {
|
|
95
|
+
const response = await fetch(
|
|
96
|
+
`https://registry.npmjs.org/${name.replaceAll('/', '%2F')}/latest`
|
|
97
|
+
);
|
|
98
|
+
assert.ok(response.ok, `npm registry answered ${response.status} for ${name}`);
|
|
99
|
+
const { version } = await response.json();
|
|
100
|
+
assert.equal(typeof version, 'string', `npm registry returned no version for ${name}`);
|
|
101
|
+
return version;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(path.resolve(process.argv[1])).href) {
|
|
105
|
+
const root = fileURLToPath(new URL('..', import.meta.url));
|
|
106
|
+
const lock = JSON.parse(readFileSync(path.join(root, 'package-lock.json'), 'utf8'));
|
|
107
|
+
const names = [...new Set(lockedVersions(lock).map((entry) => entry.name))];
|
|
108
|
+
const latestByName = Object.fromEntries(
|
|
109
|
+
await Promise.all(names.map(async (name) => [name, await latestVersion(name)]))
|
|
110
|
+
);
|
|
111
|
+
assert.deepEqual(
|
|
112
|
+
findOutdated(lock, latestByName),
|
|
113
|
+
[],
|
|
114
|
+
'Own packages are behind npm. Update them (and package-lock.json) before releasing.'
|
|
115
|
+
);
|
|
116
|
+
process.stdout.write(`Own packages are current: ${JSON.stringify(latestByName)}\n`);
|
|
117
|
+
}
|