@patch-adams/core 1.5.0 → 1.5.2
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 +12 -10
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +12 -10
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +12 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -5096,9 +5096,10 @@ function generateSkinCssLoader(options) {
|
|
|
5096
5096
|
}
|
|
5097
5097
|
function buildSkinCssOptions(config) {
|
|
5098
5098
|
if (!config.skin) return null;
|
|
5099
|
+
const cacheBuster = Date.now().toString(36) + Math.random().toString(36).slice(2, 6);
|
|
5099
5100
|
return {
|
|
5100
|
-
remoteUrl: `${config.remoteDomain}/skin/${config.skin}.css`,
|
|
5101
|
-
localPath: `skin/${config.skin}.css`,
|
|
5101
|
+
remoteUrl: `${config.remoteDomain}/skin/${config.skin}/style.css?v=${cacheBuster}`,
|
|
5102
|
+
localPath: `skin/${config.skin}/style.css`,
|
|
5102
5103
|
timeout: config.cssAfter.timeout
|
|
5103
5104
|
// reuse cssAfter timeout
|
|
5104
5105
|
};
|
|
@@ -5197,9 +5198,10 @@ function generateSkinJsLoader(options) {
|
|
|
5197
5198
|
}
|
|
5198
5199
|
function buildSkinJsOptions(config) {
|
|
5199
5200
|
if (!config.skin) return null;
|
|
5201
|
+
const cacheBuster = Date.now().toString(36) + Math.random().toString(36).slice(2, 6);
|
|
5200
5202
|
return {
|
|
5201
|
-
remoteUrl: `${config.remoteDomain}/skin/${config.skin}.js`,
|
|
5202
|
-
localPath: `skin/${config.skin}.js`,
|
|
5203
|
+
remoteUrl: `${config.remoteDomain}/skin/${config.skin}/script.js?v=${cacheBuster}`,
|
|
5204
|
+
localPath: `skin/${config.skin}/script.js`,
|
|
5203
5205
|
timeout: config.jsAfter.timeout
|
|
5204
5206
|
// reuse jsAfter timeout
|
|
5205
5207
|
};
|
|
@@ -6164,13 +6166,13 @@ var Patcher = class {
|
|
|
6164
6166
|
);
|
|
6165
6167
|
}
|
|
6166
6168
|
if (this.config.skin) {
|
|
6167
|
-
const skinCssUrl = `${remoteDomain}/skin/${this.config.skin}.css`;
|
|
6169
|
+
const skinCssUrl = `${remoteDomain}/skin/${this.config.skin}/style.css`;
|
|
6168
6170
|
fetchPromises.push(
|
|
6169
6171
|
this.fetchFile(skinCssUrl).then((content) => {
|
|
6170
6172
|
fetched.skinCss = content;
|
|
6171
6173
|
})
|
|
6172
6174
|
);
|
|
6173
|
-
const skinJsUrl = `${remoteDomain}/skin/${this.config.skin}.js`;
|
|
6175
|
+
const skinJsUrl = `${remoteDomain}/skin/${this.config.skin}/script.js`;
|
|
6174
6176
|
fetchPromises.push(
|
|
6175
6177
|
this.fetchFile(skinJsUrl).then((content) => {
|
|
6176
6178
|
fetched.skinJs = content;
|
|
@@ -6398,9 +6400,9 @@ var Patcher = class {
|
|
|
6398
6400
|
buildManifestPaths(addedFiles) {
|
|
6399
6401
|
const paths = {};
|
|
6400
6402
|
for (const filePath of addedFiles) {
|
|
6401
|
-
if (this.config.skin && filePath.endsWith(`skin/${this.config.skin}.css`)) {
|
|
6403
|
+
if (this.config.skin && filePath.endsWith(`skin/${this.config.skin}/style.css`)) {
|
|
6402
6404
|
paths.skinCss = filePath;
|
|
6403
|
-
} else if (this.config.skin && filePath.endsWith(`skin/${this.config.skin}.js`)) {
|
|
6405
|
+
} else if (this.config.skin && filePath.endsWith(`skin/${this.config.skin}/script.js`)) {
|
|
6404
6406
|
paths.skinJs = filePath;
|
|
6405
6407
|
} else if (filePath.endsWith(this.config.cssBefore.filename)) {
|
|
6406
6408
|
paths.cssBefore = filePath;
|
|
@@ -6487,14 +6489,14 @@ var Patcher = class {
|
|
|
6487
6489
|
if (fetched.jsAfter) console.log(`[Patcher] Using fetched content for ${path}`);
|
|
6488
6490
|
}
|
|
6489
6491
|
if (this.config.skin) {
|
|
6490
|
-
const skinCssPath = `${basePath}skin/${this.config.skin}.css`;
|
|
6492
|
+
const skinCssPath = `${basePath}skin/${this.config.skin}/style.css`;
|
|
6491
6493
|
const skinCssContent = fetched.skinCss ?? `/* PA-Patcher: Skin CSS (${this.config.skin}) */
|
|
6492
6494
|
`;
|
|
6493
6495
|
zip.addFile(skinCssPath, Buffer.from(skinCssContent, "utf-8"));
|
|
6494
6496
|
added.push(skinCssPath);
|
|
6495
6497
|
if (fetched.skinCss) console.log(`[Patcher] Using fetched skin CSS for ${skinCssPath}`);
|
|
6496
6498
|
else console.log(`[Patcher] Added placeholder skin CSS: ${skinCssPath}`);
|
|
6497
|
-
const skinJsPath = `${basePath}skin/${this.config.skin}.js`;
|
|
6499
|
+
const skinJsPath = `${basePath}skin/${this.config.skin}/script.js`;
|
|
6498
6500
|
const skinJsContent = fetched.skinJs ?? `// PA-Patcher: Skin JS (${this.config.skin})
|
|
6499
6501
|
`;
|
|
6500
6502
|
zip.addFile(skinJsPath, Buffer.from(skinJsContent, "utf-8"));
|