@patch-adams/core 1.4.14 → 1.4.15
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/dist/cli.cjs +2 -58
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +2 -58
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +2 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -10
- package/dist/index.d.ts +0 -10
- package/dist/index.js +2 -58
- package/dist/index.js.map +1 -1
- package/package.json +1 -2
package/dist/cli.js
CHANGED
|
@@ -9,7 +9,6 @@ import archiver from 'archiver';
|
|
|
9
9
|
import { PassThrough } from 'stream';
|
|
10
10
|
import { pathToFileURL } from 'url';
|
|
11
11
|
import { z } from 'zod';
|
|
12
|
-
import { XMLParser, XMLBuilder } from 'fast-xml-parser';
|
|
13
12
|
|
|
14
13
|
var __defProp = Object.defineProperty;
|
|
15
14
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -5038,26 +5037,12 @@ ${loader}`);
|
|
|
5038
5037
|
</body>`);
|
|
5039
5038
|
}
|
|
5040
5039
|
};
|
|
5040
|
+
|
|
5041
|
+
// src/patcher/manifest-updater.ts
|
|
5041
5042
|
var ManifestUpdater = class {
|
|
5042
5043
|
config;
|
|
5043
|
-
parser;
|
|
5044
|
-
builder;
|
|
5045
5044
|
constructor(config) {
|
|
5046
5045
|
this.config = config;
|
|
5047
|
-
this.parser = new XMLParser({
|
|
5048
|
-
ignoreAttributes: false,
|
|
5049
|
-
attributeNamePrefix: "@_",
|
|
5050
|
-
preserveOrder: false,
|
|
5051
|
-
parseAttributeValue: false,
|
|
5052
|
-
trimValues: true
|
|
5053
|
-
});
|
|
5054
|
-
this.builder = new XMLBuilder({
|
|
5055
|
-
ignoreAttributes: false,
|
|
5056
|
-
attributeNamePrefix: "@_",
|
|
5057
|
-
format: true,
|
|
5058
|
-
indentBy: " ",
|
|
5059
|
-
suppressEmptyNode: true
|
|
5060
|
-
});
|
|
5061
5046
|
}
|
|
5062
5047
|
/**
|
|
5063
5048
|
* Update manifest files based on package format
|
|
@@ -5124,47 +5109,6 @@ $1</resource>`
|
|
|
5124
5109
|
return [];
|
|
5125
5110
|
}
|
|
5126
5111
|
}
|
|
5127
|
-
/**
|
|
5128
|
-
* Extract XML declaration from original content
|
|
5129
|
-
*/
|
|
5130
|
-
extractXmlDeclaration(xml) {
|
|
5131
|
-
const match = xml.match(/<\?xml[^?]*\?>/);
|
|
5132
|
-
return match ? match[0] + "\n" : '<?xml version="1.0" encoding="UTF-8"?>\n';
|
|
5133
|
-
}
|
|
5134
|
-
/**
|
|
5135
|
-
* Add file entries to the manifest
|
|
5136
|
-
*/
|
|
5137
|
-
addFilesToManifest(parsed, paths) {
|
|
5138
|
-
const manifest = parsed.manifest;
|
|
5139
|
-
if (!manifest) return;
|
|
5140
|
-
const resources = manifest.resources;
|
|
5141
|
-
if (!resources) return;
|
|
5142
|
-
let resource = resources.resource;
|
|
5143
|
-
if (!resource) return;
|
|
5144
|
-
if (Array.isArray(resource)) {
|
|
5145
|
-
resource = resource[0];
|
|
5146
|
-
}
|
|
5147
|
-
if (!resource.file) {
|
|
5148
|
-
resource.file = [];
|
|
5149
|
-
}
|
|
5150
|
-
let files = resource.file;
|
|
5151
|
-
if (!Array.isArray(files)) {
|
|
5152
|
-
files = [files];
|
|
5153
|
-
resource.file = files;
|
|
5154
|
-
}
|
|
5155
|
-
const filesToAdd = [
|
|
5156
|
-
paths.cssBefore,
|
|
5157
|
-
paths.cssAfter,
|
|
5158
|
-
paths.jsBefore,
|
|
5159
|
-
paths.jsAfter
|
|
5160
|
-
].filter(Boolean);
|
|
5161
|
-
for (const filePath of filesToAdd) {
|
|
5162
|
-
const exists = files.some((f) => f["@_href"] === filePath);
|
|
5163
|
-
if (!exists) {
|
|
5164
|
-
files.push({ "@_href": filePath });
|
|
5165
|
-
}
|
|
5166
|
-
}
|
|
5167
|
-
}
|
|
5168
5112
|
/**
|
|
5169
5113
|
* Get the file paths that will be added to the package
|
|
5170
5114
|
*/
|