postcss-modules 7.0.0 → 8.3.0

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/build/unquote.js CHANGED
@@ -1,21 +1,24 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return unquote;
9
+ }
5
10
  });
6
- exports.default = unquote;
7
11
  // copied from https://github.com/lakenen/node-unquote
8
-
9
12
  const reg = /['"]/;
10
13
  function unquote(str) {
11
- if (!str) {
12
- return "";
13
- }
14
- if (reg.test(str.charAt(0))) {
15
- str = str.substr(1);
16
- }
17
- if (reg.test(str.charAt(str.length - 1))) {
18
- str = str.substr(0, str.length - 1);
19
- }
20
- return str;
21
- }
14
+ if (!str) {
15
+ return "";
16
+ }
17
+ if (reg.test(str.charAt(0))) {
18
+ str = str.substr(1);
19
+ }
20
+ if (reg.test(str.charAt(str.length - 1))) {
21
+ str = str.substr(0, str.length - 1);
22
+ }
23
+ return str;
24
+ }
@@ -0,0 +1,26 @@
1
+ import js from "@eslint/js";
2
+ import jest from "eslint-plugin-jest";
3
+ import globals from "globals";
4
+
5
+ export default [
6
+ js.configs.recommended,
7
+ {
8
+ languageOptions: {
9
+ ecmaVersion: 2022,
10
+ sourceType: "module",
11
+ globals: {
12
+ ...globals.node,
13
+ ...globals.es2021,
14
+ },
15
+ },
16
+ plugins: { jest },
17
+ },
18
+ {
19
+ files: ["test/**/*.js"],
20
+ languageOptions: {
21
+ globals: {
22
+ ...jest.environments.globals.globals,
23
+ },
24
+ },
25
+ },
26
+ ];
package/index.d.ts CHANGED
@@ -6,7 +6,7 @@ declare type LocalsConventionFunction = (
6
6
  originalClassName: string,
7
7
  generatedClassName: string,
8
8
  inputFile: string
9
- ) => string;
9
+ ) => string | string[];
10
10
 
11
11
  declare class Loader {
12
12
  constructor(root: string, plugins: Plugin[]);
@@ -24,6 +24,8 @@ declare interface Options {
24
24
  | "camelCaseOnly"
25
25
  | "dashes"
26
26
  | "dashesOnly"
27
+ | "all"
28
+ | "none"
27
29
  | LocalsConventionFunction;
28
30
 
29
31
  scopeBehaviour?: "global" | "local";
package/jest.config.js ADDED
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ transform: {
3
+ "^.+\\.js$": ["@swc/jest"],
4
+ },
5
+ };
package/package.json CHANGED
@@ -1,69 +1,70 @@
1
1
  {
2
- "name": "postcss-modules",
3
- "version": "7.0.0",
4
- "description": "PostCSS plugin to use CSS Modules everywhere",
5
- "main": "build/index.js",
6
- "types": "index.d.ts",
7
- "keywords": [
8
- "postcss",
9
- "css",
10
- "postcss-plugin",
11
- "modules",
12
- "css modules",
13
- "components"
14
- ],
15
- "author": "Alexander Madyankin <alexander@madyankin.name>",
16
- "license": "MIT",
17
- "repository": {
18
- "type": "git",
19
- "url": "https://github.com/css-modules/postcss-modules.git"
20
- },
21
- "dependencies": {
22
- "generic-names": "^4.0.0",
23
- "icss-utils": "^5.1.0",
24
- "lodash.camelcase": "^4.3.0",
25
- "postcss-modules-extract-imports": "^3.1.0",
26
- "postcss-modules-local-by-default": "^4.0.5",
27
- "postcss-modules-scope": "^3.2.0",
28
- "postcss-modules-values": "^4.0.0",
29
- "string-hash": "^1.1.3"
30
- },
31
- "peerDependencies": {
32
- "postcss": "^8.0.0"
33
- },
34
- "devDependencies": {
35
- "@babel/cli": "^7.17.10",
36
- "@babel/core": "^7.18.0",
37
- "@babel/eslint-parser": "^7.17.0",
38
- "@babel/preset-env": "^7.18.0",
39
- "@babel/register": "^7.17.7",
40
- "autoprefixer": "^10.0.2",
41
- "eslint": "^7.3.1",
42
- "eslint-plugin-import": "^2.21.2",
43
- "eslint-plugin-jest": "^23.17.0",
44
- "husky": "^4.2.5",
45
- "jest": "^30.4.2",
46
- "lint-staged": "^10.2.11",
47
- "postcss": "^8.1.9",
48
- "prettier": "^2.0.5"
49
- },
50
- "scripts": {
51
- "test": "make test",
52
- "precommit": "lint-staged"
53
- },
54
- "overrides": {
55
- "glob": "^12.0.0"
56
- },
57
- "lint-staged": {
58
- "*.{json,md}": [
59
- "prettier --write",
60
- "git add"
61
- ],
62
- "*.js": [
63
- "prettier --write",
64
- "eslint --fix",
65
- "git add"
66
- ]
67
- },
68
- "require": "@babel/register"
2
+ "name": "postcss-modules",
3
+ "version": "8.3.0",
4
+ "description": "PostCSS plugin to use CSS Modules everywhere",
5
+ "main": "build/index.js",
6
+ "types": "index.d.ts",
7
+ "keywords": [
8
+ "postcss",
9
+ "css",
10
+ "postcss-plugin",
11
+ "modules",
12
+ "css modules",
13
+ "components"
14
+ ],
15
+ "author": "Alexander Madyankin <alexander@madyankin.name>",
16
+ "license": "MIT",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/css-modules/postcss-modules.git"
20
+ },
21
+ "dependencies": {
22
+ "generic-names": "^4.0.0",
23
+ "icss-utils": "^5.1.0",
24
+ "lodash.camelcase": "^4.3.0",
25
+ "postcss-modules-extract-imports": "^3.1.0",
26
+ "postcss-modules-local-by-default": "^4.2.0",
27
+ "postcss-modules-scope": "^3.2.1",
28
+ "postcss-modules-values": "^4.0.0",
29
+ "string-hash": "^1.1.3"
30
+ },
31
+ "peerDependencies": {
32
+ "postcss": "^8.0.0"
33
+ },
34
+ "devDependencies": {
35
+ "@eslint/js": "^9.39.4",
36
+ "@swc/cli": "^0.8.1",
37
+ "@swc/core": "^1.15.43",
38
+ "@swc/jest": "^0.2.39",
39
+ "autoprefixer": "^10.5.2",
40
+ "eslint": "^9.39.0",
41
+ "eslint-plugin-import": "^2.32.0",
42
+ "eslint-plugin-jest": "^29.15.4",
43
+ "globals": "^17.7.0",
44
+ "husky": "^9.1.7",
45
+ "jest": "^30.4.2",
46
+ "lint-staged": "^17.0.8",
47
+ "postcss": "^8.5.16",
48
+ "prettier": "^3.9.4"
49
+ },
50
+ "engines": {
51
+ "node": ">=20"
52
+ },
53
+ "scripts": {
54
+ "test": "make test",
55
+ "prepare": "husky || true"
56
+ },
57
+ "overrides": {
58
+ "glob": "^12.0.0",
59
+ "file-type": "^22.0.0"
60
+ },
61
+ "lint-staged": {
62
+ "*.{json,md}": [
63
+ "prettier --write"
64
+ ],
65
+ "*.js": [
66
+ "prettier --write",
67
+ "eslint --fix"
68
+ ]
69
+ }
69
70
  }
@@ -1 +0,0 @@
1
- {"sessionId":"90487c0d-02d1-4853-8d09-cfc07c0fcb62","pid":81146,"procStart":"Tue Jun 30 11:29:58 2026","acquiredAt":1782820063000}
package/.eslintrc.js DELETED
@@ -1,19 +0,0 @@
1
- module.exports = {
2
- extends: "eslint:recommended",
3
- parserOptions: {
4
- sourceType: "module",
5
- babelOptions: {
6
- cwd: __dirname
7
- }
8
- },
9
- env: {
10
- node: true,
11
- es6: true,
12
- "jest/globals": true,
13
- },
14
- parser: "@babel/eslint-parser",
15
- plugins: ["jest"],
16
- rules: {
17
- "import/no-extraneous-dependencies": 0,
18
- },
19
- };
@@ -1,58 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <code_scheme name="Project" version="173">
3
- <HTMLCodeStyleSettings>
4
- <option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
5
- <option name="HTML_ENFORCE_QUOTES" value="true" />
6
- </HTMLCodeStyleSettings>
7
- <JSCodeStyleSettings version="0">
8
- <option name="FORCE_SEMICOLON_STYLE" value="true" />
9
- <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
10
- <option name="FORCE_QUOTE_STYlE" value="true" />
11
- <option name="ENFORCE_TRAILING_COMMA" value="Remove" />
12
- <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
13
- <option name="SPACES_WITHIN_IMPORTS" value="true" />
14
- </JSCodeStyleSettings>
15
- <TypeScriptCodeStyleSettings version="0">
16
- <option name="FORCE_SEMICOLON_STYLE" value="true" />
17
- <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
18
- <option name="FORCE_QUOTE_STYlE" value="true" />
19
- <option name="ENFORCE_TRAILING_COMMA" value="Remove" />
20
- <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
21
- <option name="SPACES_WITHIN_IMPORTS" value="true" />
22
- </TypeScriptCodeStyleSettings>
23
- <VueCodeStyleSettings>
24
- <option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
25
- <option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
26
- </VueCodeStyleSettings>
27
- <codeStyleSettings language="HTML">
28
- <option name="SOFT_MARGINS" value="80" />
29
- <indentOptions>
30
- <option name="INDENT_SIZE" value="2" />
31
- <option name="CONTINUATION_INDENT_SIZE" value="2" />
32
- <option name="TAB_SIZE" value="2" />
33
- </indentOptions>
34
- </codeStyleSettings>
35
- <codeStyleSettings language="JavaScript">
36
- <option name="SOFT_MARGINS" value="80" />
37
- <indentOptions>
38
- <option name="INDENT_SIZE" value="2" />
39
- <option name="CONTINUATION_INDENT_SIZE" value="2" />
40
- <option name="TAB_SIZE" value="2" />
41
- </indentOptions>
42
- </codeStyleSettings>
43
- <codeStyleSettings language="TypeScript">
44
- <option name="SOFT_MARGINS" value="80" />
45
- <indentOptions>
46
- <option name="INDENT_SIZE" value="2" />
47
- <option name="CONTINUATION_INDENT_SIZE" value="2" />
48
- <option name="TAB_SIZE" value="2" />
49
- </indentOptions>
50
- </codeStyleSettings>
51
- <codeStyleSettings language="Vue">
52
- <option name="SOFT_MARGINS" value="80" />
53
- <indentOptions>
54
- <option name="CONTINUATION_INDENT_SIZE" value="2" />
55
- </indentOptions>
56
- </codeStyleSettings>
57
- </code_scheme>
58
- </component>
@@ -1,5 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <state>
3
- <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
- </state>
5
- </component>
@@ -1,6 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0">
3
- <option name="myName" value="Project Default" />
4
- <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
- </profile>
6
- </component>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/postcss-modules.iml" filepath="$PROJECT_DIR$/.idea/postcss-modules.iml" />
6
- </modules>
7
- </component>
8
- </project>
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="WEB_MODULE" version="4">
3
- <component name="NewModuleRootManager">
4
- <content url="file://$MODULE_DIR$">
5
- <excludeFolder url="file://$MODULE_DIR$/temp" />
6
- <excludeFolder url="file://$MODULE_DIR$/.tmp" />
7
- <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
- </content>
9
- <orderEntry type="inheritedJdk" />
10
- <orderEntry type="sourceFolder" forTests="false" />
11
- </component>
12
- </module>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>