@zubyjs/purgecss 1.0.79 → 1.0.80

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.
Files changed (3) hide show
  1. package/index.d.ts +2 -2
  2. package/index.js +3 -9
  3. package/package.json +42 -41
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { UserDefinedOptions } from 'purgecss';
2
- import { ZubyPlugin } from 'zuby/index.js';
1
+ import { type UserDefinedOptions } from 'purgecss';
2
+ import type { ZubyPlugin } from 'zuby/index.js';
3
3
  export interface PurgeCssPluginOptions extends Partial<UserDefinedOptions> {
4
4
  }
5
5
  /**
package/index.js CHANGED
@@ -21,18 +21,12 @@ export default (options = {}) => ({
21
21
  logger.info(`Analyzing '${outDir}' dir for unused CSS...`);
22
22
  const purged = await purgeCss.purge({
23
23
  css: [normalizePath(`${outDir}/**/*.css`)],
24
- defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || [],
24
+ defaultExtractor: (content) => content.match(/[\w-/:]+(?<!:)/g) || [],
25
25
  ...options,
26
- content: [
27
- normalizePath(`${outDir}/**/*.html`),
28
- normalizePath(`${outDir}/**/*.js`),
29
- ...(options.content || []),
30
- ],
26
+ content: [normalizePath(`${outDir}/**/*.html`), normalizePath(`${outDir}/**/*.js`), ...(options.content || [])],
31
27
  });
32
28
  purged.forEach(({ file }) => logger.info(`Purged: ${file}`));
33
- await Promise.all(purged
34
- .filter(({ file }) => file?.endsWith('.css'))
35
- .map(async ({ css, file }) => await writeFile(file, css)));
29
+ await Promise.all(purged.filter(({ file }) => file?.endsWith('.css')).map(async ({ css, file }) => await writeFile(file, css)));
36
30
  },
37
31
  },
38
32
  });
package/package.json CHANGED
@@ -1,43 +1,44 @@
1
1
  {
2
- "name": "@zubyjs/purgecss",
3
- "version": "1.0.79",
4
- "description": "Zuby.js purgecss plugin",
5
- "type": "module",
6
- "main": "index.js",
7
- "scripts": {
8
- "release": "cd ./dist && npm publish --access public && cd ..",
9
- "bump-version": "npm version patch",
10
- "build": "rm -rf dist/ stage/ && mkdir dist && tsc && cp -rf package.json README.md stage/purgecss/src/* dist/ && rm -rf stage/",
11
- "push-build": "npm run build && cd dist && yalc push --force && cd ..",
12
- "test": "exit 0"
13
- },
14
- "publishConfig": {
15
- "directory": "dist",
16
- "linkDirectory": true
17
- },
18
- "peerDependencies": {
19
- "zuby": "^1.0.0"
20
- },
21
- "dependencies": {
22
- "purgecss": "6.0.0"
23
- },
24
- "bugs": {
25
- "url": "https://gitlab.com/futrou/zuby.js/-/issues",
26
- "email": "zuby@futrou.com"
27
- },
28
- "license": "MIT",
29
- "repository": {
30
- "type": "git",
31
- "url": "git+https://gitlab.com/futrou/zuby.js.git"
32
- },
33
- "homepage": "https://zubyjs.com",
34
- "keywords": [
35
- "zuby-plugin",
36
- "zuby",
37
- "purgecss",
38
- "css"
39
- ],
40
- "engines": {
41
- "node": ">=18"
42
- }
2
+ "name": "@zubyjs/purgecss",
3
+ "version": "1.0.80",
4
+ "description": "Zuby.js purgecss plugin",
5
+ "type": "module",
6
+ "main": "index.js",
7
+ "scripts": {
8
+ "release": "cd ./dist && npm publish --access public && cd ..",
9
+ "bump-version": "npm version patch",
10
+ "build": "rm -rf dist/ stage/ && mkdir dist && tsc && cp -rf package.json README.md stage/purgecss/src/* dist/ && rm -rf stage/",
11
+ "push-build": "npm run build && cd dist && yalc push --force && cd ..",
12
+ "test": "vitest run",
13
+ "test:coverage": "vitest run --coverage"
14
+ },
15
+ "publishConfig": {
16
+ "directory": "dist",
17
+ "linkDirectory": true
18
+ },
19
+ "peerDependencies": {
20
+ "zuby": "^1.0.0"
21
+ },
22
+ "dependencies": {
23
+ "purgecss": "6.0.0"
24
+ },
25
+ "bugs": {
26
+ "url": "https://gitlab.com/futrou/zuby.js/-/issues",
27
+ "email": "zuby@futrou.com"
28
+ },
29
+ "license": "MIT",
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "git+https://gitlab.com/futrou/zuby.js.git"
33
+ },
34
+ "homepage": "https://zubyjs.com",
35
+ "keywords": [
36
+ "zuby-plugin",
37
+ "zuby",
38
+ "purgecss",
39
+ "css"
40
+ ],
41
+ "engines": {
42
+ "node": ">=18"
43
+ }
43
44
  }