@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.js CHANGED
@@ -5086,9 +5086,10 @@ function generateSkinCssLoader(options) {
5086
5086
  }
5087
5087
  function buildSkinCssOptions(config) {
5088
5088
  if (!config.skin) return null;
5089
+ const cacheBuster = Date.now().toString(36) + Math.random().toString(36).slice(2, 6);
5089
5090
  return {
5090
- remoteUrl: `${config.remoteDomain}/skin/${config.skin}.css`,
5091
- localPath: `skin/${config.skin}.css`,
5091
+ remoteUrl: `${config.remoteDomain}/skin/${config.skin}/style.css?v=${cacheBuster}`,
5092
+ localPath: `skin/${config.skin}/style.css`,
5092
5093
  timeout: config.cssAfter.timeout
5093
5094
  // reuse cssAfter timeout
5094
5095
  };
@@ -5187,9 +5188,10 @@ function generateSkinJsLoader(options) {
5187
5188
  }
5188
5189
  function buildSkinJsOptions(config) {
5189
5190
  if (!config.skin) return null;
5191
+ const cacheBuster = Date.now().toString(36) + Math.random().toString(36).slice(2, 6);
5190
5192
  return {
5191
- remoteUrl: `${config.remoteDomain}/skin/${config.skin}.js`,
5192
- localPath: `skin/${config.skin}.js`,
5193
+ remoteUrl: `${config.remoteDomain}/skin/${config.skin}/script.js?v=${cacheBuster}`,
5194
+ localPath: `skin/${config.skin}/script.js`,
5193
5195
  timeout: config.jsAfter.timeout
5194
5196
  // reuse jsAfter timeout
5195
5197
  };
@@ -6154,13 +6156,13 @@ var Patcher = class {
6154
6156
  );
6155
6157
  }
6156
6158
  if (this.config.skin) {
6157
- const skinCssUrl = `${remoteDomain}/skin/${this.config.skin}.css`;
6159
+ const skinCssUrl = `${remoteDomain}/skin/${this.config.skin}/style.css`;
6158
6160
  fetchPromises.push(
6159
6161
  this.fetchFile(skinCssUrl).then((content) => {
6160
6162
  fetched.skinCss = content;
6161
6163
  })
6162
6164
  );
6163
- const skinJsUrl = `${remoteDomain}/skin/${this.config.skin}.js`;
6165
+ const skinJsUrl = `${remoteDomain}/skin/${this.config.skin}/script.js`;
6164
6166
  fetchPromises.push(
6165
6167
  this.fetchFile(skinJsUrl).then((content) => {
6166
6168
  fetched.skinJs = content;
@@ -6388,9 +6390,9 @@ var Patcher = class {
6388
6390
  buildManifestPaths(addedFiles) {
6389
6391
  const paths = {};
6390
6392
  for (const filePath of addedFiles) {
6391
- if (this.config.skin && filePath.endsWith(`skin/${this.config.skin}.css`)) {
6393
+ if (this.config.skin && filePath.endsWith(`skin/${this.config.skin}/style.css`)) {
6392
6394
  paths.skinCss = filePath;
6393
- } else if (this.config.skin && filePath.endsWith(`skin/${this.config.skin}.js`)) {
6395
+ } else if (this.config.skin && filePath.endsWith(`skin/${this.config.skin}/script.js`)) {
6394
6396
  paths.skinJs = filePath;
6395
6397
  } else if (filePath.endsWith(this.config.cssBefore.filename)) {
6396
6398
  paths.cssBefore = filePath;
@@ -6477,14 +6479,14 @@ var Patcher = class {
6477
6479
  if (fetched.jsAfter) console.log(`[Patcher] Using fetched content for ${path}`);
6478
6480
  }
6479
6481
  if (this.config.skin) {
6480
- const skinCssPath = `${basePath}skin/${this.config.skin}.css`;
6482
+ const skinCssPath = `${basePath}skin/${this.config.skin}/style.css`;
6481
6483
  const skinCssContent = fetched.skinCss ?? `/* PA-Patcher: Skin CSS (${this.config.skin}) */
6482
6484
  `;
6483
6485
  zip.addFile(skinCssPath, Buffer.from(skinCssContent, "utf-8"));
6484
6486
  added.push(skinCssPath);
6485
6487
  if (fetched.skinCss) console.log(`[Patcher] Using fetched skin CSS for ${skinCssPath}`);
6486
6488
  else console.log(`[Patcher] Added placeholder skin CSS: ${skinCssPath}`);
6487
- const skinJsPath = `${basePath}skin/${this.config.skin}.js`;
6489
+ const skinJsPath = `${basePath}skin/${this.config.skin}/script.js`;
6488
6490
  const skinJsContent = fetched.skinJs ?? `// PA-Patcher: Skin JS (${this.config.skin})
6489
6491
  `;
6490
6492
  zip.addFile(skinJsPath, Buffer.from(skinJsContent, "utf-8"));