postcss-modules 5.0.0 → 6.0.1
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/.idea/codeStyles/Project.xml +58 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/postcss-modules.iml +12 -0
- package/.idea/vcs.xml +6 -0
- package/CHANGELOG.md +91 -52
- package/README.md +77 -70
- package/build/FileSystemLoader.js +140 -0
- package/build/{css-loader-core/parser.js → Parser.js} +16 -12
- package/build/fs.js +24 -0
- package/build/index.js +8 -152
- package/build/localsConvention.js +47 -0
- package/build/pluginFactory.js +107 -0
- package/build/saveJSON.js +5 -2
- package/build/{behaviours.js → scoping.js} +34 -5
- package/build/{unquote/index.js → unquote.js} +1 -1
- package/index.d.ts +24 -36
- package/package.json +6 -6
- package/build/css-loader-core/loader.js +0 -131
- package/build/generateScopedName.js +0 -17
|
@@ -0,0 +1,58 @@
|
|
|
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>
|
|
@@ -0,0 +1,8 @@
|
|
|
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>
|
|
@@ -0,0 +1,12 @@
|
|
|
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
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -1,191 +1,230 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 6.0.1
|
|
4
|
+
|
|
5
|
+
- Updated dependencies by Bill Collins (@mrginglymus)
|
|
6
|
+
|
|
7
|
+
## 6.0.0
|
|
8
|
+
|
|
9
|
+
### Breaking
|
|
10
|
+
|
|
11
|
+
The `resolve` option has two parameters now and can return `null`. Thanks to Rene Haas (@KingSora)
|
|
12
|
+
https://github.com/madyankin/postcss-modules/commit/86d8135cb5014d0b2848ef395608ee74d82bd179
|
|
13
|
+
|
|
14
|
+
Parameters:
|
|
15
|
+
|
|
16
|
+
- `file` — a module we want to resolve
|
|
17
|
+
- `importer` — the file that imports the module we want to resolve
|
|
18
|
+
|
|
19
|
+
Return value: `string | null | Promise<string | null>`
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
postcss([
|
|
23
|
+
require("postcss-modules")({
|
|
24
|
+
resolve: function (file, importer) {
|
|
25
|
+
return path.resolve(
|
|
26
|
+
path.dirname(importer),
|
|
27
|
+
file.replace(/^@/, process.cwd()
|
|
28
|
+
);
|
|
29
|
+
},
|
|
30
|
+
}),
|
|
31
|
+
]);
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- #140 "'Failed to obtain root' error on Windows" fixed by Pierre LeMoine (@DrInfiniteExplorer) https://github.com/madyankin/postcss-modules/pull/144
|
|
37
|
+
|
|
38
|
+
### Improved
|
|
39
|
+
|
|
40
|
+
- `icss-replace-symbols` replaced with with `icss-utils` by Jason Quense (@jquense). The updated replacer works better and will replace values in selectors, which didn't work until now. https://github.com/madyankin/postcss-modules/pull/145
|
|
41
|
+
|
|
3
42
|
## 5.0.0
|
|
4
43
|
|
|
5
|
-
-
|
|
6
|
-
-
|
|
44
|
+
- Fixed `composes` on Windows by @sapphi-red https://github.com/madyankin/postcss-modules/pull/135
|
|
45
|
+
- Updated Babel to v7 by @sapphi-red. Minimal supported version of Node.js is 10 from now https://github.com/madyankin/postcss-modules/pull/134
|
|
7
46
|
|
|
8
47
|
## 4.3.1
|
|
9
48
|
|
|
10
|
-
-
|
|
49
|
+
- Fixed errors when using shorthand selectors by Felix Bruns (@fxb) https://github.com/madyankin/postcss-modules/pull/130
|
|
11
50
|
|
|
12
51
|
## 4.3.0
|
|
13
52
|
|
|
14
|
-
-
|
|
53
|
+
- Updated the `generic-names` dependency to reduce packages size by Bogdan Chadkin (@TrySound) https://github.com/madyankin/postcss-modules/pull/129
|
|
15
54
|
|
|
16
55
|
## 4.2.2
|
|
17
56
|
|
|
18
|
-
-
|
|
57
|
+
- Fix the build
|
|
19
58
|
|
|
20
59
|
## 4.2.1
|
|
21
60
|
|
|
22
|
-
-
|
|
61
|
+
- Fixed the `resolve` option behaviour by @kamilic https://github.com/madyankin/postcss-modules/pull/127
|
|
23
62
|
|
|
24
63
|
## 4.2.0
|
|
25
64
|
|
|
26
|
-
-
|
|
65
|
+
- Added the `resolve` option to configure lookup paths for composes/from by @kamilic https://github.com/madyankin/postcss-modules/pull/126
|
|
27
66
|
|
|
28
67
|
## 4.1.3
|
|
29
68
|
|
|
30
|
-
-
|
|
69
|
+
- Fixed package contents
|
|
31
70
|
|
|
32
71
|
## 4.1.1
|
|
33
72
|
|
|
34
|
-
-
|
|
73
|
+
- Fixed TypeScript typings by Shuman Lim (@origin-master) https://github.com/madyankin/postcss-modules/pull/124
|
|
35
74
|
|
|
36
75
|
## 4.1.0
|
|
37
76
|
|
|
38
|
-
-
|
|
77
|
+
- Added TypeScript typings by Shuman Lim (@origin-master) https://github.com/madyankin/postcss-modules/pull/123
|
|
39
78
|
|
|
40
79
|
## 4.0.0
|
|
41
80
|
|
|
42
|
-
-
|
|
81
|
+
- Upgraded to PostCSS 8 by Evan You (@yyx990803) https://github.com/css-modules/postcss-modules/pull/114
|
|
43
82
|
|
|
44
83
|
## 3.2.2
|
|
45
84
|
|
|
46
85
|
### Fixed
|
|
47
86
|
|
|
48
|
-
-
|
|
87
|
+
- Fixed user plugins order by Tom Jenkinson (@tjenkinson) https://github.com/css-modules/postcss-modules/pull/112
|
|
49
88
|
|
|
50
89
|
## 3.2.1
|
|
51
90
|
|
|
52
91
|
### Fixed
|
|
53
92
|
|
|
54
|
-
-
|
|
93
|
+
- Fixed an issue when some plugins were running multiple times by Tom Jenkinson (@tjenkinson) https://github.com/css-modules/postcss-modules/pull/111
|
|
55
94
|
|
|
56
95
|
## 3.2.0
|
|
57
96
|
|
|
58
97
|
### Changed
|
|
59
98
|
|
|
60
|
-
-
|
|
99
|
+
- [`localsConvention` option] now supports a custom function `(originalClassName: string, generatedClassName: string, inputFile: string) => className: string` by Gregory Waxman (@Akkuma) https://github.com/css-modules/postcss-modules/pull/109
|
|
61
100
|
|
|
62
101
|
## 3.1.0
|
|
63
102
|
|
|
64
103
|
### Added
|
|
65
104
|
|
|
66
|
-
-
|
|
105
|
+
- Added `exportGlobals` option
|
|
67
106
|
|
|
68
107
|
## 3.0.0
|
|
69
108
|
|
|
70
109
|
### Changed
|
|
71
110
|
|
|
72
|
-
-
|
|
73
|
-
-
|
|
111
|
+
- Dropped `css-modules-loader-core` dependency
|
|
112
|
+
- [Upgraded all the dependencies](https://github.com/css-modules/postcss-modules/pull/108)
|
|
74
113
|
|
|
75
114
|
### Breaking changes
|
|
76
115
|
|
|
77
|
-
-
|
|
116
|
+
- Dropped support for unsupported Node versions. Supported versions are 10, 12 and 14+ https://nodejs.org/en/about/releases/
|
|
78
117
|
|
|
79
118
|
## 2.0.0
|
|
80
119
|
|
|
81
120
|
### Added
|
|
82
121
|
|
|
83
|
-
-
|
|
122
|
+
- [`localsConvention` option](https://github.com/css-modules/postcss-modules#localsconvention) by Hamza Mihai Daniel (@allocenx) <https://github.com/css-modules/postcss-modules/pull/103>, <https://github.com/css-modules/postcss-modules/issues/93>
|
|
84
123
|
|
|
85
124
|
### Breaking changes
|
|
86
125
|
|
|
87
|
-
-
|
|
126
|
+
- `camelCase` camelCase removed, use the [`localsConvention` option](https://github.com/css-modules/postcss-modules#localsconvention) instead.
|
|
88
127
|
|
|
89
128
|
## 1.5.0
|
|
90
129
|
|
|
91
|
-
-
|
|
130
|
+
- Added `hashPrefix` option by Jesse Thomson (@jessethomson) <https://github.com/css-modules/postcss-modules/pull/98>
|
|
92
131
|
|
|
93
132
|
## 1.4.1
|
|
94
133
|
|
|
95
|
-
-
|
|
134
|
+
- Rebublished the previous release. Sorry :(
|
|
96
135
|
|
|
97
136
|
## 1.4.0
|
|
98
137
|
|
|
99
|
-
-
|
|
138
|
+
- Added export for other plugins by Evilebot Tnawi (@evilebottnawi) <https://github.com/css-modules/postcss-modules/pull/88>, <https://github.com/css-modules/postcss-modules/issues/29>
|
|
100
139
|
|
|
101
140
|
## 1.3.1
|
|
102
141
|
|
|
103
|
-
-
|
|
142
|
+
- Move dev tools to devDependecies by Anton Khlynovskiy (@ubzey) <https://github.com/css-modules/postcss-modules/pull/85>
|
|
104
143
|
|
|
105
144
|
## 1.3.0
|
|
106
145
|
|
|
107
|
-
-
|
|
108
|
-
-
|
|
146
|
+
- Updated dependecies
|
|
147
|
+
- Added prettier to format code
|
|
109
148
|
|
|
110
149
|
## 1.2.0
|
|
111
150
|
|
|
112
|
-
-
|
|
151
|
+
- Added option to transform classes to camelCase by Igor Ribeiro (@igor-ribeiro) <https://github.com/css-modules/postcss-modules/pull/82>
|
|
113
152
|
|
|
114
153
|
## 1.1.0
|
|
115
154
|
|
|
116
|
-
-
|
|
155
|
+
- Added ability to transmit outputFileName into getJSON by @lutien <https://github.com/css-modules/postcss-modules/pull/72>
|
|
117
156
|
|
|
118
157
|
## 1.0.0
|
|
119
158
|
|
|
120
|
-
-
|
|
121
|
-
-
|
|
159
|
+
- Dropped support for Node < 6
|
|
160
|
+
- Updated dependencies
|
|
122
161
|
|
|
123
162
|
## 0.8.0
|
|
124
163
|
|
|
125
|
-
-
|
|
164
|
+
- Updated PostCSS to 6 by Alexey Litvinov (@sullenor) <https://github.com/css-modules/postcss-modules/pull/65>
|
|
126
165
|
|
|
127
166
|
## 0.7.1
|
|
128
167
|
|
|
129
|
-
-
|
|
168
|
+
- Allowed empty string as opts.root by Sharon Rolel (@Mosho1) <https://github.com/css-modules/postcss-modules/pull/56>
|
|
130
169
|
|
|
131
170
|
## 0.7.0
|
|
132
171
|
|
|
133
|
-
-
|
|
172
|
+
- Allow async getJSON by Philipp A. (@flying-sheep) <https://github.com/css-modules/postcss-modules/pull/59>
|
|
134
173
|
|
|
135
174
|
## 0.6.4
|
|
136
175
|
|
|
137
|
-
-
|
|
176
|
+
- Added the `root` option to pass the root path by Sharon Rolel (@Mosho1) (<https://github.com/css-modules/postcss-modules/pull/55>)
|
|
138
177
|
|
|
139
178
|
## 0.6.3
|
|
140
179
|
|
|
141
|
-
-
|
|
180
|
+
- Fixed regression in `isValidBehaviour` function (<https://github.com/css-modules/postcss-modules/issues/53>)
|
|
142
181
|
|
|
143
182
|
## 0.6.2
|
|
144
183
|
|
|
145
|
-
-
|
|
184
|
+
- Refactored `getDefaultPluginsList` function
|
|
146
185
|
|
|
147
186
|
## 0.6.1
|
|
148
187
|
|
|
149
|
-
-
|
|
188
|
+
- Fixed `generateScopedName` bug with multiple postcss-modules instances (<https://github.com/css-modules/postcss-modules/issues/37>)
|
|
150
189
|
|
|
151
190
|
## 0.6.0
|
|
152
191
|
|
|
153
|
-
-
|
|
154
|
-
-
|
|
192
|
+
- Added `globalModulePaths` option (Thanks to @pospi).
|
|
193
|
+
- Refactored all the things.
|
|
155
194
|
|
|
156
195
|
## 0.5.2
|
|
157
196
|
|
|
158
|
-
-
|
|
197
|
+
- Updated dependencies
|
|
159
198
|
|
|
160
199
|
## 0.5.1
|
|
161
200
|
|
|
162
|
-
-
|
|
201
|
+
- Fixed sorting for composed dependencies by Josh Johnston (@joshwnj) (<https://github.com/css-modules/postcss-modules/issues/38>)
|
|
163
202
|
|
|
164
203
|
## 0.5.0
|
|
165
204
|
|
|
166
|
-
-
|
|
167
|
-
-
|
|
168
|
-
-
|
|
205
|
+
- Added `scopeBehaviour` option (<https://github.com/css-modules/postcss-modules/issues/22>)
|
|
206
|
+
- Added ability to pass a string to `generateScopedName` (<https://github.com/css-modules/postcss-modules/issues/21>)
|
|
207
|
+
- Updated dependencies
|
|
169
208
|
|
|
170
209
|
## 0.4.1
|
|
171
210
|
|
|
172
|
-
-
|
|
211
|
+
- Fixed processing errors capturing by Boris Serdiuk (@just-boris)
|
|
173
212
|
|
|
174
213
|
## 0.4.0
|
|
175
214
|
|
|
176
|
-
-
|
|
215
|
+
- Added support for custom loaders by Björn Brauer (@ZauberNerd)
|
|
177
216
|
|
|
178
217
|
## 0.3.0
|
|
179
218
|
|
|
180
|
-
-
|
|
181
|
-
-
|
|
219
|
+
- Fixed processing for imported CSS
|
|
220
|
+
- Added default callback for saving exported JSON
|
|
182
221
|
|
|
183
222
|
## 0.2.0
|
|
184
223
|
|
|
185
|
-
-
|
|
186
|
-
-
|
|
187
|
-
-
|
|
188
|
-
-
|
|
224
|
+
- Fixed JSON export with shallow imports (<https://github.com/outpunk/postcss-modules/issues/12>)
|
|
225
|
+
- Fixed lookup paths (<https://github.com/outpunk/postcss-modules/issues/13>)
|
|
226
|
+
- Fixed imports overriding (<https://github.com/outpunk/postcss-modules/issues/15>)
|
|
227
|
+
- Global refactoring under the hood
|
|
189
228
|
|
|
190
229
|
## 0.1.3
|
|
191
230
|
|