@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.cjs CHANGED
@@ -4763,9 +4763,10 @@ function generateSkinCssLoader(options) {
4763
4763
  }
4764
4764
  function buildSkinCssOptions(config) {
4765
4765
  if (!config.skin) return null;
4766
+ const cacheBuster = Date.now().toString(36) + Math.random().toString(36).slice(2, 6);
4766
4767
  return {
4767
- remoteUrl: `${config.remoteDomain}/skin/${config.skin}.css`,
4768
- localPath: `skin/${config.skin}.css`,
4768
+ remoteUrl: `${config.remoteDomain}/skin/${config.skin}/style.css?v=${cacheBuster}`,
4769
+ localPath: `skin/${config.skin}/style.css`,
4769
4770
  timeout: config.cssAfter.timeout
4770
4771
  // reuse cssAfter timeout
4771
4772
  };
@@ -4864,9 +4865,10 @@ function generateSkinJsLoader(options) {
4864
4865
  }
4865
4866
  function buildSkinJsOptions(config) {
4866
4867
  if (!config.skin) return null;
4868
+ const cacheBuster = Date.now().toString(36) + Math.random().toString(36).slice(2, 6);
4867
4869
  return {
4868
- remoteUrl: `${config.remoteDomain}/skin/${config.skin}.js`,
4869
- localPath: `skin/${config.skin}.js`,
4870
+ remoteUrl: `${config.remoteDomain}/skin/${config.skin}/script.js?v=${cacheBuster}`,
4871
+ localPath: `skin/${config.skin}/script.js`,
4870
4872
  timeout: config.jsAfter.timeout
4871
4873
  // reuse jsAfter timeout
4872
4874
  };
@@ -6141,13 +6143,13 @@ var Patcher = class {
6141
6143
  );
6142
6144
  }
6143
6145
  if (this.config.skin) {
6144
- const skinCssUrl = `${remoteDomain}/skin/${this.config.skin}.css`;
6146
+ const skinCssUrl = `${remoteDomain}/skin/${this.config.skin}/style.css`;
6145
6147
  fetchPromises.push(
6146
6148
  this.fetchFile(skinCssUrl).then((content) => {
6147
6149
  fetched.skinCss = content;
6148
6150
  })
6149
6151
  );
6150
- const skinJsUrl = `${remoteDomain}/skin/${this.config.skin}.js`;
6152
+ const skinJsUrl = `${remoteDomain}/skin/${this.config.skin}/script.js`;
6151
6153
  fetchPromises.push(
6152
6154
  this.fetchFile(skinJsUrl).then((content) => {
6153
6155
  fetched.skinJs = content;
@@ -6375,9 +6377,9 @@ var Patcher = class {
6375
6377
  buildManifestPaths(addedFiles) {
6376
6378
  const paths = {};
6377
6379
  for (const filePath of addedFiles) {
6378
- if (this.config.skin && filePath.endsWith(`skin/${this.config.skin}.css`)) {
6380
+ if (this.config.skin && filePath.endsWith(`skin/${this.config.skin}/style.css`)) {
6379
6381
  paths.skinCss = filePath;
6380
- } else if (this.config.skin && filePath.endsWith(`skin/${this.config.skin}.js`)) {
6382
+ } else if (this.config.skin && filePath.endsWith(`skin/${this.config.skin}/script.js`)) {
6381
6383
  paths.skinJs = filePath;
6382
6384
  } else if (filePath.endsWith(this.config.cssBefore.filename)) {
6383
6385
  paths.cssBefore = filePath;
@@ -6464,14 +6466,14 @@ var Patcher = class {
6464
6466
  if (fetched.jsAfter) console.log(`[Patcher] Using fetched content for ${path}`);
6465
6467
  }
6466
6468
  if (this.config.skin) {
6467
- const skinCssPath = `${basePath}skin/${this.config.skin}.css`;
6469
+ const skinCssPath = `${basePath}skin/${this.config.skin}/style.css`;
6468
6470
  const skinCssContent = fetched.skinCss ?? `/* PA-Patcher: Skin CSS (${this.config.skin}) */
6469
6471
  `;
6470
6472
  zip.addFile(skinCssPath, Buffer.from(skinCssContent, "utf-8"));
6471
6473
  added.push(skinCssPath);
6472
6474
  if (fetched.skinCss) console.log(`[Patcher] Using fetched skin CSS for ${skinCssPath}`);
6473
6475
  else console.log(`[Patcher] Added placeholder skin CSS: ${skinCssPath}`);
6474
- const skinJsPath = `${basePath}skin/${this.config.skin}.js`;
6476
+ const skinJsPath = `${basePath}skin/${this.config.skin}/script.js`;
6475
6477
  const skinJsContent = fetched.skinJs ?? `// PA-Patcher: Skin JS (${this.config.skin})
6476
6478
  `;
6477
6479
  zip.addFile(skinJsPath, Buffer.from(skinJsContent, "utf-8"));