@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/index.js CHANGED
@@ -4754,9 +4754,10 @@ function generateSkinCssLoader(options) {
4754
4754
  }
4755
4755
  function buildSkinCssOptions(config) {
4756
4756
  if (!config.skin) return null;
4757
+ const cacheBuster = Date.now().toString(36) + Math.random().toString(36).slice(2, 6);
4757
4758
  return {
4758
- remoteUrl: `${config.remoteDomain}/skin/${config.skin}.css`,
4759
- localPath: `skin/${config.skin}.css`,
4759
+ remoteUrl: `${config.remoteDomain}/skin/${config.skin}/style.css?v=${cacheBuster}`,
4760
+ localPath: `skin/${config.skin}/style.css`,
4760
4761
  timeout: config.cssAfter.timeout
4761
4762
  // reuse cssAfter timeout
4762
4763
  };
@@ -4855,9 +4856,10 @@ function generateSkinJsLoader(options) {
4855
4856
  }
4856
4857
  function buildSkinJsOptions(config) {
4857
4858
  if (!config.skin) return null;
4859
+ const cacheBuster = Date.now().toString(36) + Math.random().toString(36).slice(2, 6);
4858
4860
  return {
4859
- remoteUrl: `${config.remoteDomain}/skin/${config.skin}.js`,
4860
- localPath: `skin/${config.skin}.js`,
4861
+ remoteUrl: `${config.remoteDomain}/skin/${config.skin}/script.js?v=${cacheBuster}`,
4862
+ localPath: `skin/${config.skin}/script.js`,
4861
4863
  timeout: config.jsAfter.timeout
4862
4864
  // reuse jsAfter timeout
4863
4865
  };
@@ -6132,13 +6134,13 @@ var Patcher = class {
6132
6134
  );
6133
6135
  }
6134
6136
  if (this.config.skin) {
6135
- const skinCssUrl = `${remoteDomain}/skin/${this.config.skin}.css`;
6137
+ const skinCssUrl = `${remoteDomain}/skin/${this.config.skin}/style.css`;
6136
6138
  fetchPromises.push(
6137
6139
  this.fetchFile(skinCssUrl).then((content) => {
6138
6140
  fetched.skinCss = content;
6139
6141
  })
6140
6142
  );
6141
- const skinJsUrl = `${remoteDomain}/skin/${this.config.skin}.js`;
6143
+ const skinJsUrl = `${remoteDomain}/skin/${this.config.skin}/script.js`;
6142
6144
  fetchPromises.push(
6143
6145
  this.fetchFile(skinJsUrl).then((content) => {
6144
6146
  fetched.skinJs = content;
@@ -6366,9 +6368,9 @@ var Patcher = class {
6366
6368
  buildManifestPaths(addedFiles) {
6367
6369
  const paths = {};
6368
6370
  for (const filePath of addedFiles) {
6369
- if (this.config.skin && filePath.endsWith(`skin/${this.config.skin}.css`)) {
6371
+ if (this.config.skin && filePath.endsWith(`skin/${this.config.skin}/style.css`)) {
6370
6372
  paths.skinCss = filePath;
6371
- } else if (this.config.skin && filePath.endsWith(`skin/${this.config.skin}.js`)) {
6373
+ } else if (this.config.skin && filePath.endsWith(`skin/${this.config.skin}/script.js`)) {
6372
6374
  paths.skinJs = filePath;
6373
6375
  } else if (filePath.endsWith(this.config.cssBefore.filename)) {
6374
6376
  paths.cssBefore = filePath;
@@ -6455,14 +6457,14 @@ var Patcher = class {
6455
6457
  if (fetched.jsAfter) console.log(`[Patcher] Using fetched content for ${path}`);
6456
6458
  }
6457
6459
  if (this.config.skin) {
6458
- const skinCssPath = `${basePath}skin/${this.config.skin}.css`;
6460
+ const skinCssPath = `${basePath}skin/${this.config.skin}/style.css`;
6459
6461
  const skinCssContent = fetched.skinCss ?? `/* PA-Patcher: Skin CSS (${this.config.skin}) */
6460
6462
  `;
6461
6463
  zip.addFile(skinCssPath, Buffer.from(skinCssContent, "utf-8"));
6462
6464
  added.push(skinCssPath);
6463
6465
  if (fetched.skinCss) console.log(`[Patcher] Using fetched skin CSS for ${skinCssPath}`);
6464
6466
  else console.log(`[Patcher] Added placeholder skin CSS: ${skinCssPath}`);
6465
- const skinJsPath = `${basePath}skin/${this.config.skin}.js`;
6467
+ const skinJsPath = `${basePath}skin/${this.config.skin}/script.js`;
6466
6468
  const skinJsContent = fetched.skinJs ?? `// PA-Patcher: Skin JS (${this.config.skin})
6467
6469
  `;
6468
6470
  zip.addFile(skinJsPath, Buffer.from(skinJsContent, "utf-8"));