Skip to content

Commit d48d539

Browse files
authored
markdown alerts : parallel builds notice (#1214)
1 parent dc68aaa commit d48d539

File tree

62 files changed

+86
-11
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+86
-11
lines changed

.github/bin/generate-docs/install.mjs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import fs from 'fs';
22
import path from 'path';
33
import { fileURLToPath } from 'url';
4+
import { parallelBuildsNotice } from './parallel-builds-notice.mjs';
45

56
const template = fs.readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), './install-template.md'), 'utf8');
67
const packageJSONInfo = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
@@ -12,7 +13,7 @@ installDoc = installDoc.replaceAll('<packageName>', packageJSONInfo.name);
1213
installDoc = installDoc.replaceAll('<packagePath>', path.join(path.basename(path.dirname(process.cwd())), path.basename(process.cwd())));
1314

1415
if (packageJSONInfo?.csstools?.assumesToProcessBundledCSS) {
15-
installDoc = installDoc.replaceAll('<parallelBuildsNotice>', `⚠️ [${packageJSONInfo.csstools.humanReadableName}] assumes to process your complete CSS bundle.<br>If your build tool processes files individually or in parallel the output will be incorrect.<br>Using [\`@csstools/postcss-bundler\`](https://github.com/csstools/postcss-plugins/tree/main/plugin-packs/postcss-bundler) and \`@import\` statements is one way to make sure your CSS is bundled before it is processed by this plugin.\n`);
16+
installDoc = installDoc.replaceAll('<parallelBuildsNotice>', parallelBuildsNotice(packageJSONInfo.csstools.humanReadableName));
1617
installDoc = installDoc.replaceAll('<otherPluginsInWebpack>', `["@csstools/postcss-bundler"]`);
1718
// <parallelBuildsNotice>
1819
} else {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function parallelBuildsNotice(label) {
2+
return `> [!IMPORTANT]\n> [${label}] assumes to process your complete CSS bundle.<br>If your build tool processes files individually or processes files in parallel the output will be incorrect.<br>Using [\`@csstools/postcss-bundler\`](https://github.com/csstools/postcss-plugins/tree/main/plugin-packs/postcss-bundler) and \`@import\` statements is one way to make sure your CSS is bundled before it is processed by this plugin.\n`;
3+
}

.github/bin/generate-docs/readme.mjs

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import fs from 'fs';
22
import path from 'path';
33
import { fileURLToPath } from 'url';
4+
import { parallelBuildsNotice } from './parallel-builds-notice.mjs';
45

56
const template = fs.readFileSync(path.join('docs', './README.md'), 'utf8');
67
const corsTemplate = fs.readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), './cors-template.md'), 'utf8');
@@ -33,6 +34,7 @@ readmeDoc = readmeDoc.replace(`<!-- Available Variables: -->
3334
<!-- <envSupport> -->
3435
<!-- <corsWarning> -->
3536
<!-- <linkList> -->
37+
<!-- <parallelBuildsNotice> -->
3638
<!-- to generate : npm run docs -->
3739
3840
`, '');
@@ -110,6 +112,12 @@ readmeDoc = readmeDoc.replaceAll('<packageVersion>', packageJSONInfo.version);
110112
readmeDoc = readmeDoc.replaceAll('<packagePath>', path.join(path.basename(path.dirname(process.cwd())), path.basename(process.cwd())));
111113
readmeDoc = readmeDoc.replaceAll('<specUrl>', packageJSONInfo.csstools.specUrl);
112114

115+
if (packageJSONInfo?.csstools?.assumesToProcessBundledCSS) {
116+
readmeDoc = readmeDoc.replaceAll('<parallelBuildsNotice>', parallelBuildsNotice(packageJSONInfo.csstools.humanReadableName));
117+
} else {
118+
readmeDoc = readmeDoc.replaceAll('<parallelBuildsNotice>', ``);
119+
}
120+
113121
for (const exampleFilePath of exampleFilePaths) {
114122
readmeDoc = readmeDoc.replaceAll(
115123
`<${path.relative(path.join('test', 'examples'), exampleFilePath)}>`,

experimental/postcss-gradient-stop-increments/docs/README.md

+1

plugin-packs/postcss-bundler/docs/README.md

+1

plugins/css-blank-pseudo/docs/README.md

+1

plugins/css-has-pseudo/docs/README.md

+1

plugins/css-prefers-color-scheme/docs/README.md

+1

plugins/postcss-attribute-case-insensitive/docs/README.md

+1

plugins/postcss-base-plugin/docs/README.md

+1

plugins/postcss-cascade-layers/INSTALL.md

+2-1

plugins/postcss-cascade-layers/README.md

+3-2

plugins/postcss-cascade-layers/docs/README.md

+2-2

plugins/postcss-color-function/docs/README.md

+1

plugins/postcss-color-hex-alpha/docs/README.md

+1

plugins/postcss-color-mix-function/docs/README.md

+1

plugins/postcss-color-rebeccapurple/docs/README.md

+1

plugins/postcss-conditional-values/INSTALL.md

+2-1

plugins/postcss-conditional-values/README.md

+4

plugins/postcss-conditional-values/docs/README.md

+3

plugins/postcss-custom-media/INSTALL.md

+2-1

plugins/postcss-custom-media/docs/README.md

+1

plugins/postcss-custom-properties/INSTALL.md

+2-1

plugins/postcss-custom-properties/docs/README.md

+1

plugins/postcss-custom-selectors/INSTALL.md

+2-1

plugins/postcss-custom-selectors/docs/README.md

+1

plugins/postcss-debug-logger/docs/README.md

+1

plugins/postcss-design-tokens/INSTALL.md

+2-1

plugins/postcss-design-tokens/docs/README.md

+1

plugins/postcss-dir-pseudo-class/docs/README.md

+1

plugins/postcss-exponential-functions/docs/README.md

+1

plugins/postcss-extract/docs/README.md

+1

plugins/postcss-focus-visible/docs/README.md

+1

plugins/postcss-focus-within/docs/README.md

+1

plugins/postcss-gamut-mapping/docs/README.md

+1

plugins/postcss-gap-properties/docs/README.md

+1

plugins/postcss-global-data/docs/README.md

+1

plugins/postcss-gradients-interpolation-method/docs/README.md

+1

plugins/postcss-initial/docs/README.md

+1

plugins/postcss-logical-float-and-clear/docs/README.md

+1

plugins/postcss-logical-overflow/docs/README.md

+1

plugins/postcss-logical-overscroll-behavior/docs/README.md

+1

0 commit comments

Comments
 (0)