Skip to content

Commit dfba596

Browse files
committed
revert and fix downloads count
1 parent d250c54 commit dfba596

1,180 files changed

Lines changed: 62704 additions & 33828 deletions

File tree

Some content is hidden

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

cmd/tasks/npm-data/fetch-detailed-plugin-data.mjs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ async function fetchDetailedDataForOnePlugin(plugin, forced, index, total) {
1919
const detailedData = await fetchPlugin(plugin.package.name);
2020
const downloadsData = await fetchDownloadCount(plugin.package.name);
2121

22-
if (existingData._downloads && existingData._downloads > 50 && downloadsData.downloads < 50) {
23-
// Some plugins might oscillate around 50.
24-
// If a plugin drops from above 50 to under 50 we set it to exactly 50.
25-
detailedData._downloads = 50;
22+
if (existingData._downloads) {
23+
if (Array.isArray(existingData._downloads)) {
24+
detailedData._downloads = [...existingData._downloads, downloadsData.downloads].slice(-20);
25+
} else {
26+
detailedData._downloads = [existingData._downloads, downloadsData.downloads];
27+
}
2628
} else {
27-
detailedData._downloads = downloadsData.downloads;
29+
detailedData._downloads = [downloadsData.downloads];
2830
}
2931

3032
await fs.mkdir(path.dirname(pluginFilePath), { recursive: true });

cmd/tasks/npm-data/list-maintained-plugins.mjs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,18 @@ export async function listMaintainedPlugins() {
6363

6464
const pluginFilePath = path.join('npm-data', 'plugins', plugin.package.name) + '.json';
6565
const pluginData = await readJSONFromFileOrEmptyObject(pluginFilePath);
66-
if ('_downloads' in pluginData && pluginData._downloads < 50) {
66+
67+
if ('_downloads' in pluginData) {
6768
// Plugin must at least be downloaded a 50 times a month.
6869
// Anything less than that could be a single user or bot traffic.
69-
continue;
70+
71+
if (Array.isArray(pluginData._downloads) && Math.max.apply(null, pluginData._downloads) < 50) {
72+
continue;
73+
}
74+
75+
if (!Array.isArray(pluginData._downloads) && pluginData._downloads < 50) {
76+
continue;
77+
}
7078
}
7179

7280
const versions = Object.keys(Object(pluginData.versions)).filter(filterVersions(pluginData));

cmd/tasks/util/fetch-download-count.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ export async function fetchDownloadCount(name) {
22
await new Promise((resolve) => setTimeout(resolve, 100));
33
const response = await fetch(`https://api.npmjs.org/downloads/point/last-month/${name}`);
44
if (response.status !== 200) {
5-
return {
6-
downloads: 0
7-
};
5+
throw new Error(`Fetching downloads count : ${response.statusText}`);
86
}
97

108
return await response.json();
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"name": "@csstools/postcss-color-function-display-p3-linear",
3+
"description": "Use the display-p3-linear color space on the color() function in CSS",
4+
"version": "1.0.1",
5+
"contributors": [
6+
{
7+
"name": "Romain Menke",
8+
"email": "[email protected]"
9+
}
10+
],
11+
"license": "MIT-0",
12+
"funding": [
13+
{
14+
"type": "github",
15+
"url": "https://github.com/sponsors/csstools"
16+
},
17+
{
18+
"type": "opencollective",
19+
"url": "https://opencollective.com/csstools"
20+
}
21+
],
22+
"engines": {
23+
"node": ">=18"
24+
},
25+
"type": "module",
26+
"main": "dist/index.cjs",
27+
"module": "dist/index.mjs",
28+
"exports": {
29+
".": {
30+
"import": {
31+
"types": "./dist/index.d.ts",
32+
"default": "./dist/index.mjs"
33+
},
34+
"require": {
35+
"default": "./dist/index.cjs"
36+
}
37+
}
38+
},
39+
"dependencies": {
40+
"@csstools/css-color-parser": "^3.1.0",
41+
"@csstools/css-parser-algorithms": "^3.0.5",
42+
"@csstools/css-tokenizer": "^3.0.4",
43+
"@csstools/postcss-progressive-custom-properties": "^4.2.1",
44+
"@csstools/utilities": "^2.0.0"
45+
},
46+
"peerDependencies": {
47+
"postcss": "^8.4"
48+
},
49+
"scripts": {},
50+
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-function-display-p3-linear#readme",
51+
"repository": {
52+
"type": "git",
53+
"url": "git+https://github.com/csstools/postcss-plugins.git",
54+
"directory": "plugins/postcss-color-function-display-p3-linear"
55+
},
56+
"bugs": {
57+
"url": "https://github.com/csstools/postcss-plugins/issues"
58+
},
59+
"keywords": [
60+
"color",
61+
"css",
62+
"display-p3-linear",
63+
"postcss",
64+
"postcss-plugin",
65+
"syntax"
66+
],
67+
"_id": "@csstools/[email protected]",
68+
"gitHead": "eef0d4f04b0406e1018dc270cd955dd3453ccb02",
69+
"types": "./dist/index.d.ts",
70+
"_nodeVersion": "24.4.0",
71+
"_npmVersion": "11.4.2",
72+
"dist": {
73+
"integrity": "sha512-E5qusdzhlmO1TztYzDIi8XPdPoYOjoTY6HBYBCYSj+Gn4gQRBlvjgPQXzfzuPQqt8EhkC/SzPKObg4Mbn8/xMg==",
74+
"shasum": "3017ff5e1f65307d6083e58e93d76724fb1ebf9f",
75+
"tarball": "https://registry.npmjs.org/@csstools/postcss-color-function-display-p3-linear/-/postcss-color-function-display-p3-linear-1.0.1.tgz",
76+
"fileCount": 7,
77+
"unpackedSize": 9828,
78+
"signatures": [
79+
{
80+
"keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U",
81+
"sig": "MEUCIDBlB+yn9zj/4iFBVg9b32ME1I9MPS66K/TL3G2OaFR1AiEAvJ1zMvH1YuNbgaTV1KtMLMMKCWNNNm4dUTvYiPe3VAI="
82+
}
83+
]
84+
},
85+
"_npmUser": {
86+
"name": "romainmenke",
87+
"email": "[email protected]"
88+
},
89+
"directories": {},
90+
"maintainers": [
91+
{
92+
"name": "jonathantneal",
93+
"email": "[email protected]"
94+
},
95+
{
96+
"name": "alaguna",
97+
"email": "[email protected]"
98+
},
99+
{
100+
"name": "romainmenke",
101+
"email": "[email protected]"
102+
}
103+
],
104+
"_npmOperationalInternal": {
105+
"host": "s3://npm-registry-packages-npm-production",
106+
"tmp": "tmp/postcss-color-function-display-p3-linear_1.0.1_1758465402187_0.6121163821687148"
107+
},
108+
"_hasShrinkwrap": false,
109+
"_time": "2025-09-21T14:36:42.382Z"
110+
}
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
{
2+
"name": "@csstools/postcss-color-function",
3+
"description": "Use the color() function in CSS",
4+
"version": "4.0.12",
5+
"author": {
6+
"name": "Jonathan Neal",
7+
"email": "[email protected]"
8+
},
9+
"license": "MIT-0",
10+
"funding": [
11+
{
12+
"type": "github",
13+
"url": "https://github.com/sponsors/csstools"
14+
},
15+
{
16+
"type": "opencollective",
17+
"url": "https://opencollective.com/csstools"
18+
}
19+
],
20+
"engines": {
21+
"node": ">=18"
22+
},
23+
"type": "module",
24+
"main": "dist/index.cjs",
25+
"module": "dist/index.mjs",
26+
"exports": {
27+
".": {
28+
"import": {
29+
"types": "./dist/index.d.ts",
30+
"default": "./dist/index.mjs"
31+
},
32+
"require": {
33+
"default": "./dist/index.cjs"
34+
}
35+
}
36+
},
37+
"dependencies": {
38+
"@csstools/css-color-parser": "^3.1.0",
39+
"@csstools/css-parser-algorithms": "^3.0.5",
40+
"@csstools/css-tokenizer": "^3.0.4",
41+
"@csstools/postcss-progressive-custom-properties": "^4.2.1",
42+
"@csstools/utilities": "^2.0.0"
43+
},
44+
"peerDependencies": {
45+
"postcss": "^8.4"
46+
},
47+
"scripts": {},
48+
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-function#readme",
49+
"repository": {
50+
"type": "git",
51+
"url": "git+https://github.com/csstools/postcss-plugins.git",
52+
"directory": "plugins/postcss-color-function"
53+
},
54+
"bugs": {
55+
"url": "https://github.com/csstools/postcss-plugins/issues"
56+
},
57+
"keywords": [
58+
"color",
59+
"css",
60+
"design",
61+
"display-p3",
62+
"postcss",
63+
"postcss-plugin",
64+
"prophoto-rgb",
65+
"rec2020",
66+
"rgb",
67+
"rgba",
68+
"srgb-linear",
69+
"syntax",
70+
"xyz"
71+
],
72+
"_id": "@csstools/[email protected]",
73+
"gitHead": "3562ce2f395a9d172a52b0b1fa2623a0ffa341a6",
74+
"types": "./dist/index.d.ts",
75+
"_nodeVersion": "24.4.0",
76+
"_npmVersion": "11.4.2",
77+
"dist": {
78+
"integrity": "sha512-yx3cljQKRaSBc2hfh8rMZFZzChaFgwmO2JfFgFr1vMcF3C/uyy5I4RFIBOIWGq1D+XbKCG789CGkG6zzkLpagA==",
79+
"shasum": "a7c85a98c77b522a194a1bbb00dd207f40c7a771",
80+
"tarball": "https://registry.npmjs.org/@csstools/postcss-color-function/-/postcss-color-function-4.0.12.tgz",
81+
"fileCount": 7,
82+
"unpackedSize": 9515,
83+
"signatures": [
84+
{
85+
"keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U",
86+
"sig": "MEUCIDjYWrg3BQzg+j98WxoT6QKfBMiP++n4UobrljxDh6WUAiEA9PILYj/ey0wZZbfn6UTGxGc6GBHJrd3z1fvRPUWCfjY="
87+
}
88+
]
89+
},
90+
"_npmUser": {
91+
"name": "romainmenke",
92+
"email": "[email protected]"
93+
},
94+
"directories": {},
95+
"maintainers": [
96+
{
97+
"name": "jonathantneal",
98+
"email": "[email protected]"
99+
},
100+
{
101+
"name": "alaguna",
102+
"email": "[email protected]"
103+
},
104+
{
105+
"name": "romainmenke",
106+
"email": "[email protected]"
107+
}
108+
],
109+
"_npmOperationalInternal": {
110+
"host": "s3://npm-registry-packages-npm-production",
111+
"tmp": "tmp/postcss-color-function_4.0.12_1758465394531_0.6271317252532334"
112+
},
113+
"_hasShrinkwrap": false,
114+
"_time": "2025-09-21T14:36:34.710Z"
115+
}

0 commit comments

Comments
 (0)