diff --git a/package.json b/package.json index 59f13f1..ae2ab48 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "trailingComma": "all" }, "dependencies": { + "css-selector-tokenizer": "^0.8.0", "dotenv": "^16.0.3", "icss-utils": "^5.1.0", "less": "^4.1.3", @@ -55,6 +56,8 @@ "postcss-icss-keyframes": "^0.2.1", "postcss-icss-selectors": "^2.0.3", "postcss-load-config": "^3.1.4", + "postcss-modules-scope": "^3.0.0", + "postcss-preset-env": "^7.8.3", "reserved-words": "^0.1.2", "sass": "^1.56.1", "source-map-js": "^1.0.2", @@ -62,11 +65,13 @@ "tsconfig-paths": "^4.1.1" }, "devDependencies": { + "@types/css-selector-tokenizer": "^0.7.1", "@types/icss-utils": "^5.1.0", "@types/jest": "^29.2.3", "@types/less": "^3.0.3", "@types/lodash.camelcase": "^4.3.7", "@types/node": "^18.11.10", + "@types/postcss-modules-scope": "^3.0.1", "@types/reserved-words": "^0.1.0", "@types/sass": "^1.43.1", "@types/stylus": "^0.48.38", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 263380e..65a5b5b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,17 +1,20 @@ lockfileVersion: 5.4 specifiers: + '@types/css-selector-tokenizer': ^0.7.1 '@types/icss-utils': ^5.1.0 '@types/jest': ^29.2.3 '@types/less': ^3.0.3 '@types/lodash.camelcase': ^4.3.7 '@types/node': ^18.11.10 + '@types/postcss-modules-scope': ^3.0.1 '@types/reserved-words': ^0.1.0 '@types/sass': ^1.43.1 '@types/stylus': ^0.48.38 '@typescript-eslint/eslint-plugin': ^5.45.0 '@typescript-eslint/parser': ^5.45.0 bootstrap: ^5.2.3 + css-selector-tokenizer: ^0.8.0 dotenv: ^16.0.3 eslint: ^8.29.0 eslint-config-prettier: ^8.5.0 @@ -28,7 +31,9 @@ specifiers: postcss-icss-selectors: ^2.0.3 postcss-import-sync2: ^1.2.0 postcss-load-config: ^3.1.4 + postcss-modules-scope: ^3.0.0 postcss-nested: ^4.2.3 + postcss-preset-env: ^7.8.3 prettier: ^2.8.0 reserved-words: ^0.1.2 sass: ^1.56.1 @@ -40,6 +45,7 @@ specifiers: typescript: ^4.9.3 dependencies: + css-selector-tokenizer: 0.8.0 dotenv: 16.0.3 icss-utils: 5.1.0_postcss@8.4.19 less: 4.1.3 @@ -49,6 +55,8 @@ dependencies: postcss-icss-keyframes: 0.2.1 postcss-icss-selectors: 2.0.3 postcss-load-config: 3.1.4_postcss@8.4.19 + postcss-modules-scope: 3.0.0_postcss@8.4.19 + postcss-preset-env: 7.8.3_postcss@8.4.19 reserved-words: 0.1.2 sass: 1.56.1 source-map-js: 1.0.2 @@ -56,11 +64,13 @@ dependencies: tsconfig-paths: 4.1.1 devDependencies: + '@types/css-selector-tokenizer': 0.7.1 '@types/icss-utils': 5.1.0 '@types/jest': 29.2.3 '@types/less': 3.0.3 '@types/lodash.camelcase': 4.3.7 '@types/node': 18.11.10 + '@types/postcss-modules-scope': 3.0.1 '@types/reserved-words': 0.1.0 '@types/sass': 1.43.1 '@types/stylus': 0.48.38 @@ -409,6 +419,161 @@ packages: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true + /@csstools/postcss-cascade-layers/1.1.1_postcss@8.4.19: + resolution: {integrity: sha512-+KdYrpKC5TgomQr2DlZF4lDEpHcoxnj5IGddYYfBWJAKfj1JtuHUIqMa+E1pJJ+z3kvDViWMqyqPlG4Ja7amQA==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + '@csstools/selector-specificity': 2.0.2_tbwh2mpcdwdeb2slx6bobindua + postcss: 8.4.19 + postcss-selector-parser: 6.0.11 + dev: false + + /@csstools/postcss-color-function/1.1.1_postcss@8.4.19: + resolution: {integrity: sha512-Bc0f62WmHdtRDjf5f3e2STwRAl89N2CLb+9iAwzrv4L2hncrbDwnQD9PCq0gtAt7pOI2leIV08HIBUd4jxD8cw==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + '@csstools/postcss-progressive-custom-properties': 1.3.0_postcss@8.4.19 + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + + /@csstools/postcss-font-format-keywords/1.0.1_postcss@8.4.19: + resolution: {integrity: sha512-ZgrlzuUAjXIOc2JueK0X5sZDjCtgimVp/O5CEqTcs5ShWBa6smhWYbS0x5cVc/+rycTDbjjzoP0KTDnUneZGOg==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + + /@csstools/postcss-hwb-function/1.0.2_postcss@8.4.19: + resolution: {integrity: sha512-YHdEru4o3Rsbjmu6vHy4UKOXZD+Rn2zmkAmLRfPet6+Jz4Ojw8cbWxe1n42VaXQhD3CQUXXTooIy8OkVbUcL+w==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + + /@csstools/postcss-ic-unit/1.0.1_postcss@8.4.19: + resolution: {integrity: sha512-Ot1rcwRAaRHNKC9tAqoqNZhjdYBzKk1POgWfhN4uCOE47ebGcLRqXjKkApVDpjifL6u2/55ekkpnFcp+s/OZUw==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + '@csstools/postcss-progressive-custom-properties': 1.3.0_postcss@8.4.19 + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + + /@csstools/postcss-is-pseudo-class/2.0.7_postcss@8.4.19: + resolution: {integrity: sha512-7JPeVVZHd+jxYdULl87lvjgvWldYu+Bc62s9vD/ED6/QTGjy0jy0US/f6BG53sVMTBJ1lzKZFpYmofBN9eaRiA==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + '@csstools/selector-specificity': 2.0.2_tbwh2mpcdwdeb2slx6bobindua + postcss: 8.4.19 + postcss-selector-parser: 6.0.11 + dev: false + + /@csstools/postcss-nested-calc/1.0.0_postcss@8.4.19: + resolution: {integrity: sha512-JCsQsw1wjYwv1bJmgjKSoZNvf7R6+wuHDAbi5f/7MbFhl2d/+v+TvBTU4BJH3G1X1H87dHl0mh6TfYogbT/dJQ==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + + /@csstools/postcss-normalize-display-values/1.0.1_postcss@8.4.19: + resolution: {integrity: sha512-jcOanIbv55OFKQ3sYeFD/T0Ti7AMXc9nM1hZWu8m/2722gOTxFg7xYu4RDLJLeZmPUVQlGzo4jhzvTUq3x4ZUw==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + + /@csstools/postcss-oklab-function/1.1.1_postcss@8.4.19: + resolution: {integrity: sha512-nJpJgsdA3dA9y5pgyb/UfEzE7W5Ka7u0CX0/HIMVBNWzWemdcTH3XwANECU6anWv/ao4vVNLTMxhiPNZsTK6iA==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + '@csstools/postcss-progressive-custom-properties': 1.3.0_postcss@8.4.19 + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + + /@csstools/postcss-progressive-custom-properties/1.3.0_postcss@8.4.19: + resolution: {integrity: sha512-ASA9W1aIy5ygskZYuWams4BzafD12ULvSypmaLJT2jvQ8G0M3I8PRQhC0h7mG0Z3LI05+agZjqSR9+K9yaQQjA==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.3 + dependencies: + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + + /@csstools/postcss-stepped-value-functions/1.0.1_postcss@8.4.19: + resolution: {integrity: sha512-dz0LNoo3ijpTOQqEJLY8nyaapl6umbmDcgj4AD0lgVQ572b2eqA1iGZYTTWhrcrHztWDDRAX2DGYyw2VBjvCvQ==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + + /@csstools/postcss-text-decoration-shorthand/1.0.0_postcss@8.4.19: + resolution: {integrity: sha512-c1XwKJ2eMIWrzQenN0XbcfzckOLLJiczqy+YvfGmzoVXd7pT9FfObiSEfzs84bpE/VqfpEuAZ9tCRbZkZxxbdw==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + + /@csstools/postcss-trigonometric-functions/1.0.2_postcss@8.4.19: + resolution: {integrity: sha512-woKaLO///4bb+zZC2s80l+7cm07M7268MsyG3M0ActXXEFi6SuhvriQYcb58iiKGbjwwIU7n45iRLEHypB47Og==} + engines: {node: ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + + /@csstools/postcss-unset-value/1.0.2_postcss@8.4.19: + resolution: {integrity: sha512-c8J4roPBILnelAsdLr4XOAR/GsTm0GJi4XpcfvoWk3U6KiTCqiFYc63KhRMQQX35jYMp4Ao8Ij9+IZRgMfJp1g==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.19 + dev: false + + /@csstools/selector-specificity/2.0.2_tbwh2mpcdwdeb2slx6bobindua: + resolution: {integrity: sha512-IkpVW/ehM1hWKln4fCA3NzJU8KwD+kIOvPZA4cqxoJHtE21CCzjyp+Kxbu0i5I4tBNOlXPL9mjwnWlL0VEG4Fg==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + postcss-selector-parser: ^6.0.10 + dependencies: + postcss: 8.4.19 + postcss-selector-parser: 6.0.11 + dev: false + /@eslint/eslintrc/1.3.3: resolution: {integrity: sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -801,6 +966,10 @@ packages: resolution: {integrity: sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==} dev: true + /@types/css-selector-tokenizer/0.7.1: + resolution: {integrity: sha512-DdGXO+tC5ZWFDIytbNOa55lUoEXXnRJqnEUJ3P5DE+TCEEoAcpKYq48klKRLGS9Uo22Dk1s0aTt9nAUDK7W8tg==} + dev: true + /@types/graceful-fs/4.1.5: resolution: {integrity: sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==} dependencies: @@ -858,6 +1027,12 @@ packages: resolution: {integrity: sha512-juG3RWMBOqcOuXC643OAdSA525V44cVgGV6dUDuiFtss+8Fk5x1hI93Rsld43VeJVIeqlP9I7Fn9/qaVqoEAuQ==} dev: true + /@types/postcss-modules-scope/3.0.1: + resolution: {integrity: sha512-LNkp3c4ML9EQj2dgslp4i80Jxj72YK3HjYzrTn6ftUVylW1zaKFGqrMlNIyqBmPWmIhZ/Y5r0Y4T49Hk1IuDUg==} + dependencies: + postcss: 8.4.19 + dev: true + /@types/prettier/2.2.3: resolution: {integrity: sha512-PijRCG/K3s3w1We6ynUKdxEc5AcuuH3NBmMDP8uvKVp6X43UY7NQlTzczakXP3DJR0F4dfNQIGjU2cUeRYs2AA==} dev: true @@ -1124,6 +1299,22 @@ packages: engines: {node: '>=8'} dev: true + /autoprefixer/10.4.13_postcss@8.4.19: + resolution: {integrity: sha512-49vKpMqcZYsJjwotvt4+h/BCjJVnhGwcLpDt5xkcaOG3eLrG/HUYLagrihYsQ+qrIBgIzX1Rw7a6L8I/ZA1Atg==} + engines: {node: ^10 || ^12 || >=14} + hasBin: true + peerDependencies: + postcss: ^8.1.0 + dependencies: + browserslist: 4.21.4 + caniuse-lite: 1.0.30001436 + fraction.js: 4.2.0 + normalize-range: 0.1.2 + picocolors: 1.0.0 + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + /babel-jest/29.3.1_@babel+core@7.14.3: resolution: {integrity: sha512-aard+xnMoxgjwV70t0L6wkW/3HQQtV+O0PEimxKgzNqCJnbYmroPojdP2tqKSOAt8QAKV/uSZU8851M7B5+fcA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -1241,6 +1432,17 @@ packages: node-releases: 1.1.72 dev: true + /browserslist/4.21.4: + resolution: {integrity: sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + dependencies: + caniuse-lite: 1.0.30001436 + electron-to-chromium: 1.4.284 + node-releases: 2.0.6 + update-browserslist-db: 1.0.10_browserslist@4.21.4 + dev: false + /bs-logger/0.2.6: resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} engines: {node: '>= 6'} @@ -1277,6 +1479,10 @@ packages: resolution: {integrity: sha512-5yBd5nWCBS+jWKTcHOzXwo5xzcj4ePE/yjtkZyUV1BTUmrBaA9MRGC+e7mxnqXSA90CmCA8L3eKLaSUkt099IQ==} dev: true + /caniuse-lite/1.0.30001436: + resolution: {integrity: sha512-ZmWkKsnC2ifEPoWUvSAIGyOYwT+keAaaWPHiQ9DfMqS1t6tfuyFYoWR78TeZtznkEQ64+vGXH9cZrElwR2Mrxg==} + dev: false + /chalk/2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} @@ -1427,6 +1633,38 @@ packages: which: 2.0.1 dev: true + /css-blank-pseudo/3.0.3_postcss@8.4.19: + resolution: {integrity: sha512-VS90XWtsHGqoM0t4KpH053c4ehxZ2E6HtGI7x68YFV0pTo/QmkV/YFA+NnlvK8guxZVNWGQhVNJGC39Q8XF4OQ==} + engines: {node: ^12 || ^14 || >=16} + hasBin: true + peerDependencies: + postcss: ^8.4 + dependencies: + postcss: 8.4.19 + postcss-selector-parser: 6.0.11 + dev: false + + /css-has-pseudo/3.0.4_postcss@8.4.19: + resolution: {integrity: sha512-Vse0xpR1K9MNlp2j5w1pgWIJtm1a8qS0JwS9goFYcImjlHEmywP9VUF05aGBXzGpDJF86QXk4L0ypBmwPhGArw==} + engines: {node: ^12 || ^14 || >=16} + hasBin: true + peerDependencies: + postcss: ^8.4 + dependencies: + postcss: 8.4.19 + postcss-selector-parser: 6.0.11 + dev: false + + /css-prefers-color-scheme/6.0.3_postcss@8.4.19: + resolution: {integrity: sha512-4BqMbZksRkJQx2zAjrokiGMd07RqOa2IxIrrN10lyBe9xhn9DEvjUK79J6jkeiv9D9hQFXKb6g1jwU62jziJZA==} + engines: {node: ^12 || ^14 || >=16} + hasBin: true + peerDependencies: + postcss: ^8.4 + dependencies: + postcss: 8.4.19 + dev: false + /css-selector-tokenizer/0.7.1: resolution: {integrity: sha512-xYL0AMZJ4gFzJQsHUKa5jiWWi2vH77WVNg7JYRyewwj6oPh4yb/y6Y9ZCw9dsj/9UauMhtuxR+ogQd//EdEVNA==} dependencies: @@ -1435,6 +1673,17 @@ packages: regexpu-core: 1.0.0 dev: false + /css-selector-tokenizer/0.8.0: + resolution: {integrity: sha512-Jd6Ig3/pe62/qe5SBPTN8h8LeUg/pT4lLgtavPf7updwwHpvFzxvOQBHYj2LZDMjUnBzgvIUSjRcf6oT5HzHFg==} + dependencies: + cssesc: 3.0.0 + fastparse: 1.1.2 + dev: false + + /cssdb/7.2.0: + resolution: {integrity: sha512-JYlIsE7eKHSi0UNuCyo96YuIDFqvhGgHw4Ck6lsN+DP0Tp8M64UTDT2trGbkMDqnCoEjks7CkS0XcjU0rkvBdg==} + dev: false + /cssesc/0.1.0: resolution: {integrity: sha512-72avb2vCIsNDBlSMYuxt2Cmg6Z4TTGqifblGs7IXGihhuEzghCb9Pu1Y6vzVPLC03OTXnAKsTm92ChZd4uzVBQ==} hasBin: true @@ -1444,7 +1693,6 @@ packages: resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} engines: {node: '>=4'} hasBin: true - dev: true /debug/3.2.7: resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} @@ -1524,6 +1772,10 @@ packages: resolution: {integrity: sha512-ihL14knI9FikJmH2XUIDdZFWJxvr14rPSdOhJ7PpS27xbz8qmaRwCwyg/bmFwjWKmWK9QyamiCZVCvXm5CH//Q==} dev: true + /electron-to-chromium/1.4.284: + resolution: {integrity: sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==} + dev: false + /emittery/0.13.1: resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} engines: {node: '>=12'} @@ -1560,7 +1812,6 @@ packages: /escalade/3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} - dev: true /escape-string-regexp/1.0.5: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} @@ -1854,6 +2105,10 @@ packages: resolution: {integrity: sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==} dev: true + /fraction.js/4.2.0: + resolution: {integrity: sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==} + dev: false + /fs.realpath/1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} @@ -2962,10 +3217,19 @@ packages: resolution: {integrity: sha512-LLUo+PpH3dU6XizX3iVoubUNheF/owjXCZZ5yACDxNnPtgFuludV1ZL3ayK1kVep42Rmm0+R9/Y60NQbZ2bifw==} dev: true + /node-releases/2.0.6: + resolution: {integrity: sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==} + dev: false + /normalize-path/3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} + /normalize-range/0.1.2: + resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==} + engines: {node: '>=0.10.0'} + dev: false + /npm-run-path/4.0.1: resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} engines: {node: '>=8'} @@ -3150,12 +3414,160 @@ packages: find-up: 4.1.0 dev: true + /postcss-attribute-case-insensitive/5.0.2_postcss@8.4.19: + resolution: {integrity: sha512-XIidXV8fDr0kKt28vqki84fRK8VW8eTuIa4PChv2MqKuT6C9UjmSKzen6KaWhWEoYvwxFCa7n/tC1SZ3tyq4SQ==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.19 + postcss-selector-parser: 6.0.11 + dev: false + + /postcss-clamp/4.1.0_postcss@8.4.19: + resolution: {integrity: sha512-ry4b1Llo/9zz+PKC+030KUnPITTJAHeOwjfAyyB60eT0AorGLdzp52s31OsPRHRf8NchkgFoG2y6fCfn1IV1Ow==} + engines: {node: '>=7.6.0'} + peerDependencies: + postcss: ^8.4.6 + dependencies: + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + + /postcss-color-functional-notation/4.2.4_postcss@8.4.19: + resolution: {integrity: sha512-2yrTAUZUab9s6CpxkxC4rVgFEVaR6/2Pipvi6qcgvnYiVqZcbDHEoBDhrXzyb7Efh2CCfHQNtcqWcIruDTIUeg==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + + /postcss-color-hex-alpha/8.0.4_postcss@8.4.19: + resolution: {integrity: sha512-nLo2DCRC9eE4w2JmuKgVA3fGL3d01kGq752pVALF68qpGLmx2Qrk91QTKkdUqqp45T1K1XV8IhQpcu1hoAQflQ==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.4 + dependencies: + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + + /postcss-color-rebeccapurple/7.1.1_postcss@8.4.19: + resolution: {integrity: sha512-pGxkuVEInwLHgkNxUc4sdg4g3py7zUeCQ9sMfwyHAT+Ezk8a4OaaVZ8lIY5+oNqA/BXXgLyXv0+5wHP68R79hg==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + + /postcss-custom-media/8.0.2_postcss@8.4.19: + resolution: {integrity: sha512-7yi25vDAoHAkbhAzX9dHx2yc6ntS4jQvejrNcC+csQJAXjj15e7VcWfMgLqBNAbOvqi5uIa9huOVwdHbf+sKqg==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.3 + dependencies: + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + + /postcss-custom-properties/12.1.11_postcss@8.4.19: + resolution: {integrity: sha512-0IDJYhgU8xDv1KY6+VgUwuQkVtmYzRwu+dMjnmdMafXYv86SWqfxkc7qdDvWS38vsjaEtv8e0vGOUQrAiMBLpQ==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + + /postcss-custom-selectors/6.0.3_postcss@8.4.19: + resolution: {integrity: sha512-fgVkmyiWDwmD3JbpCmB45SvvlCD6z9CG6Ie6Iere22W5aHea6oWa7EM2bpnv2Fj3I94L3VbtvX9KqwSi5aFzSg==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.3 + dependencies: + postcss: 8.4.19 + postcss-selector-parser: 6.0.11 + dev: false + + /postcss-dir-pseudo-class/6.0.5_postcss@8.4.19: + resolution: {integrity: sha512-eqn4m70P031PF7ZQIvSgy9RSJ5uI2171O/OO/zcRNYpJbvaeKFUlar1aJ7rmgiQtbm0FSPsRewjpdS0Oew7MPA==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.19 + postcss-selector-parser: 6.0.11 + dev: false + + /postcss-double-position-gradients/3.1.2_postcss@8.4.19: + resolution: {integrity: sha512-GX+FuE/uBR6eskOK+4vkXgT6pDkexLokPaz/AbJna9s5Kzp/yl488pKPjhy0obB475ovfT1Wv8ho7U/cHNaRgQ==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + '@csstools/postcss-progressive-custom-properties': 1.3.0_postcss@8.4.19 + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + + /postcss-env-function/4.0.6_postcss@8.4.19: + resolution: {integrity: sha512-kpA6FsLra+NqcFnL81TnsU+Z7orGtDTxcOhl6pwXeEq1yFPpRMkCDpHhrz8CFQDr/Wfm0jLiNQ1OsGGPjlqPwA==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.4 + dependencies: + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + /postcss-filter-plugins/3.0.1: resolution: {integrity: sha512-tRKbW4wWBEkSSFuJtamV2wkiV9rj6Yy7P3Y13+zaynlPEEZt8EgYKn3y/RBpMeIhNmHXFlSdzofml65hD5OafA==} dependencies: postcss: 6.0.23 dev: false + /postcss-focus-visible/6.0.4_postcss@8.4.19: + resolution: {integrity: sha512-QcKuUU/dgNsstIK6HELFRT5Y3lbrMLEOwG+A4s5cA+fx3A3y/JTq3X9LaOj3OC3ALH0XqyrgQIgey/MIZ8Wczw==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.4 + dependencies: + postcss: 8.4.19 + postcss-selector-parser: 6.0.11 + dev: false + + /postcss-focus-within/5.0.4_postcss@8.4.19: + resolution: {integrity: sha512-vvjDN++C0mu8jz4af5d52CB184ogg/sSxAFS+oUJQq2SuCe7T5U2iIsVJtsCp2d6R4j0jr5+q3rPkBVZkXD9fQ==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.4 + dependencies: + postcss: 8.4.19 + postcss-selector-parser: 6.0.11 + dev: false + + /postcss-font-variant/5.0.0_postcss@8.4.19: + resolution: {integrity: sha512-1fmkBaCALD72CK2a9i468mA/+tr9/1cBxRRMXOUaZqO43oWPR5imcyPjXwuv7PXbCid4ndlP5zWhidQVVa3hmA==} + peerDependencies: + postcss: ^8.1.0 + dependencies: + postcss: 8.4.19 + dev: false + + /postcss-gap-properties/3.0.5_postcss@8.4.19: + resolution: {integrity: sha512-IuE6gKSdoUNcvkGIqdtjtcMtZIFyXZhmFd5RUlg97iVEvp1BZKV5ngsAjCjrVy+14uhGBQl9tzmi1Qwq4kqVOg==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.19 + dev: false + /postcss-icss-keyframes/0.2.1: resolution: {integrity: sha512-4m+hLY5TVqoTM198KKnzdNudyu1OvtqwD+8kVZ9PNiEO4+IfHYoyVvEXsOHjV8nZ1k6xowf+nY4HlUfZhOFvvw==} dependencies: @@ -3174,6 +3586,16 @@ packages: postcss: 6.0.23 dev: false + /postcss-image-set-function/4.0.7_postcss@8.4.19: + resolution: {integrity: sha512-9T2r9rsvYzm5ndsBE8WgtrMlIT7VbtTfE7b3BQnudUqnBcBo7L758oc+o+pdj/dUV0l5wjwSdjeOH2DZtfv8qw==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + /postcss-import-sync2/1.2.0_postcss@8.4.19: resolution: {integrity: sha512-KgI0JlmSacM1MjO+4oN1P5SvIdt4dMe8hUY6w6Wm2qAJLRPfHxxV9XgDbaSLlFrkRKnwhy3+aNUIaBx60soLRA==} peerDependencies: @@ -3185,6 +3607,25 @@ packages: resolve: 1.20.0 dev: true + /postcss-initial/4.0.1_postcss@8.4.19: + resolution: {integrity: sha512-0ueD7rPqX8Pn1xJIjay0AZeIuDoF+V+VvMt/uOnn+4ezUKhZM/NokDeP6DwMNyIoYByuN/94IQnt5FEkaN59xQ==} + peerDependencies: + postcss: ^8.0.0 + dependencies: + postcss: 8.4.19 + dev: false + + /postcss-lab-function/4.2.1_postcss@8.4.19: + resolution: {integrity: sha512-xuXll4isR03CrQsmxyz92LJB2xX9n+pZJ5jE9JgcnmsCammLyKdlzrBin+25dy6wIjfhJpKBAN80gsTlCgRk2w==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + '@csstools/postcss-progressive-custom-properties': 1.3.0_postcss@8.4.19 + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + /postcss-load-config/3.1.4_postcss@8.4.19: resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==} engines: {node: '>= 10'} @@ -3202,6 +3643,34 @@ packages: yaml: 1.10.2 dev: false + /postcss-logical/5.0.4_postcss@8.4.19: + resolution: {integrity: sha512-RHXxplCeLh9VjinvMrZONq7im4wjWGlRJAqmAVLXyZaXwfDWP73/oq4NdIp+OZwhQUMj0zjqDfM5Fj7qby+B4g==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.4 + dependencies: + postcss: 8.4.19 + dev: false + + /postcss-media-minmax/5.0.0_postcss@8.4.19: + resolution: {integrity: sha512-yDUvFf9QdFZTuCUg0g0uNSHVlJ5X1lSzDZjPSFaiCWvjgsvu8vEVxtahPrLMinIDEEGnx6cBe6iqdx5YWz08wQ==} + engines: {node: '>=10.0.0'} + peerDependencies: + postcss: ^8.1.0 + dependencies: + postcss: 8.4.19 + dev: false + + /postcss-modules-scope/3.0.0_postcss@8.4.19: + resolution: {integrity: sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg==} + engines: {node: ^10 || ^12 || >= 14} + peerDependencies: + postcss: ^8.1.0 + dependencies: + postcss: 8.4.19 + postcss-selector-parser: 6.0.11 + dev: false + /postcss-nested/4.2.3: resolution: {integrity: sha512-rOv0W1HquRCamWy2kFl3QazJMMe1ku6rCFoAAH+9AcxdbpDeBr6k968MLWuLjvjMcGEip01ak09hKOEgpK9hvw==} dependencies: @@ -3209,6 +3678,144 @@ packages: postcss-selector-parser: 6.0.6 dev: true + /postcss-nesting/10.2.0_postcss@8.4.19: + resolution: {integrity: sha512-EwMkYchxiDiKUhlJGzWsD9b2zvq/r2SSubcRrgP+jujMXFzqvANLt16lJANC+5uZ6hjI7lpRmI6O8JIl+8l1KA==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + '@csstools/selector-specificity': 2.0.2_tbwh2mpcdwdeb2slx6bobindua + postcss: 8.4.19 + postcss-selector-parser: 6.0.11 + dev: false + + /postcss-opacity-percentage/1.1.2: + resolution: {integrity: sha512-lyUfF7miG+yewZ8EAk9XUBIlrHyUE6fijnesuz+Mj5zrIHIEw6KcIZSOk/elVMqzLvREmXB83Zi/5QpNRYd47w==} + engines: {node: ^12 || ^14 || >=16} + dev: false + + /postcss-overflow-shorthand/3.0.4_postcss@8.4.19: + resolution: {integrity: sha512-otYl/ylHK8Y9bcBnPLo3foYFLL6a6Ak+3EQBPOTR7luMYCOsiVTUk1iLvNf6tVPNGXcoL9Hoz37kpfriRIFb4A==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + + /postcss-page-break/3.0.4_postcss@8.4.19: + resolution: {integrity: sha512-1JGu8oCjVXLa9q9rFTo4MbeeA5FMe00/9C7lN4va606Rdb+HkxXtXsmEDrIraQ11fGz/WvKWa8gMuCKkrXpTsQ==} + peerDependencies: + postcss: ^8 + dependencies: + postcss: 8.4.19 + dev: false + + /postcss-place/7.0.5_postcss@8.4.19: + resolution: {integrity: sha512-wR8igaZROA6Z4pv0d+bvVrvGY4GVHihBCBQieXFY3kuSuMyOmEnnfFzHl/tQuqHZkfkIVBEbDvYcFfHmpSet9g==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.19 + postcss-value-parser: 4.2.0 + dev: false + + /postcss-preset-env/7.8.3_postcss@8.4.19: + resolution: {integrity: sha512-T1LgRm5uEVFSEF83vHZJV2z19lHg4yJuZ6gXZZkqVsqv63nlr6zabMH3l4Pc01FQCyfWVrh2GaUeCVy9Po+Aag==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + '@csstools/postcss-cascade-layers': 1.1.1_postcss@8.4.19 + '@csstools/postcss-color-function': 1.1.1_postcss@8.4.19 + '@csstools/postcss-font-format-keywords': 1.0.1_postcss@8.4.19 + '@csstools/postcss-hwb-function': 1.0.2_postcss@8.4.19 + '@csstools/postcss-ic-unit': 1.0.1_postcss@8.4.19 + '@csstools/postcss-is-pseudo-class': 2.0.7_postcss@8.4.19 + '@csstools/postcss-nested-calc': 1.0.0_postcss@8.4.19 + '@csstools/postcss-normalize-display-values': 1.0.1_postcss@8.4.19 + '@csstools/postcss-oklab-function': 1.1.1_postcss@8.4.19 + '@csstools/postcss-progressive-custom-properties': 1.3.0_postcss@8.4.19 + '@csstools/postcss-stepped-value-functions': 1.0.1_postcss@8.4.19 + '@csstools/postcss-text-decoration-shorthand': 1.0.0_postcss@8.4.19 + '@csstools/postcss-trigonometric-functions': 1.0.2_postcss@8.4.19 + '@csstools/postcss-unset-value': 1.0.2_postcss@8.4.19 + autoprefixer: 10.4.13_postcss@8.4.19 + browserslist: 4.21.4 + css-blank-pseudo: 3.0.3_postcss@8.4.19 + css-has-pseudo: 3.0.4_postcss@8.4.19 + css-prefers-color-scheme: 6.0.3_postcss@8.4.19 + cssdb: 7.2.0 + postcss: 8.4.19 + postcss-attribute-case-insensitive: 5.0.2_postcss@8.4.19 + postcss-clamp: 4.1.0_postcss@8.4.19 + postcss-color-functional-notation: 4.2.4_postcss@8.4.19 + postcss-color-hex-alpha: 8.0.4_postcss@8.4.19 + postcss-color-rebeccapurple: 7.1.1_postcss@8.4.19 + postcss-custom-media: 8.0.2_postcss@8.4.19 + postcss-custom-properties: 12.1.11_postcss@8.4.19 + postcss-custom-selectors: 6.0.3_postcss@8.4.19 + postcss-dir-pseudo-class: 6.0.5_postcss@8.4.19 + postcss-double-position-gradients: 3.1.2_postcss@8.4.19 + postcss-env-function: 4.0.6_postcss@8.4.19 + postcss-focus-visible: 6.0.4_postcss@8.4.19 + postcss-focus-within: 5.0.4_postcss@8.4.19 + postcss-font-variant: 5.0.0_postcss@8.4.19 + postcss-gap-properties: 3.0.5_postcss@8.4.19 + postcss-image-set-function: 4.0.7_postcss@8.4.19 + postcss-initial: 4.0.1_postcss@8.4.19 + postcss-lab-function: 4.2.1_postcss@8.4.19 + postcss-logical: 5.0.4_postcss@8.4.19 + postcss-media-minmax: 5.0.0_postcss@8.4.19 + postcss-nesting: 10.2.0_postcss@8.4.19 + postcss-opacity-percentage: 1.1.2 + postcss-overflow-shorthand: 3.0.4_postcss@8.4.19 + postcss-page-break: 3.0.4_postcss@8.4.19 + postcss-place: 7.0.5_postcss@8.4.19 + postcss-pseudo-class-any-link: 7.1.6_postcss@8.4.19 + postcss-replace-overflow-wrap: 4.0.0_postcss@8.4.19 + postcss-selector-not: 6.0.1_postcss@8.4.19 + postcss-value-parser: 4.2.0 + dev: false + + /postcss-pseudo-class-any-link/7.1.6_postcss@8.4.19: + resolution: {integrity: sha512-9sCtZkO6f/5ML9WcTLcIyV1yz9D1rf0tWc+ulKcvV30s0iZKS/ONyETvoWsr6vnrmW+X+KmuK3gV/w5EWnT37w==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.19 + postcss-selector-parser: 6.0.11 + dev: false + + /postcss-replace-overflow-wrap/4.0.0_postcss@8.4.19: + resolution: {integrity: sha512-KmF7SBPphT4gPPcKZc7aDkweHiKEEO8cla/GjcBK+ckKxiZslIu3C4GCRW3DNfL0o7yW7kMQu9xlZ1kXRXLXtw==} + peerDependencies: + postcss: ^8.0.3 + dependencies: + postcss: 8.4.19 + dev: false + + /postcss-selector-not/6.0.1_postcss@8.4.19: + resolution: {integrity: sha512-1i9affjAe9xu/y9uqWH+tD4r6/hDaXJruk8xn2x1vzxC2U3J3LKO3zJW4CyxlNhA56pADJ/djpEwpH1RClI2rQ==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.19 + postcss-selector-parser: 6.0.11 + dev: false + + /postcss-selector-parser/6.0.11: + resolution: {integrity: sha512-zbARubNdogI9j7WY4nQJBiNqQf3sLS3wCP4WfOidu+p28LofJqDH1tcXypGrcmMHhDk2t9wGhCsYe/+szLTy1g==} + engines: {node: '>=4'} + dependencies: + cssesc: 3.0.0 + util-deprecate: 1.0.2 + dev: false + /postcss-selector-parser/6.0.6: resolution: {integrity: sha512-9LXrvaaX3+mcv5xkg5kFwqSzSH1JIObIx51PrndZwlmznwXRfxMddDvo9gve3gVR8ZTKgoFDdWkbRFmEhT4PMg==} engines: {node: '>=4'} @@ -3223,7 +3830,6 @@ packages: /postcss-value-parser/4.2.0: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true /postcss/6.0.23: resolution: {integrity: sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==} @@ -3805,6 +4411,17 @@ packages: hasBin: true dev: true + /update-browserslist-db/1.0.10_browserslist@4.21.4: + resolution: {integrity: sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + dependencies: + browserslist: 4.21.4 + escalade: 3.1.1 + picocolors: 1.0.0 + dev: false + /uri-js/4.2.2: resolution: {integrity: sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==} dependencies: @@ -3813,7 +4430,6 @@ packages: /util-deprecate/1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - dev: true /v8-to-istanbul/9.0.1: resolution: {integrity: sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w==} diff --git a/src/helpers/__tests__/__snapshots__/getDtsSnapshot.test.ts.snap b/src/helpers/__tests__/__snapshots__/getDtsSnapshot.test.ts.snap index f4933c4..df1f1cc 100644 --- a/src/helpers/__tests__/__snapshots__/getDtsSnapshot.test.ts.snap +++ b/src/helpers/__tests__/__snapshots__/getDtsSnapshot.test.ts.snap @@ -1,26 +1,29 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`utils / cssSnapshots with a Bootstrap import should find external files 1`] = `"bootstrap-module__test---WRms9"`; +exports[`utils / cssSnapshots with a Bootstrap import should find external files 1`] = `undefined`; exports[`utils / cssSnapshots with a custom renderer should process a file and log 1`] = ` -{ - "exampleFileContents": "exampleFileContents__exampleFileContents---e3Nf2", - "exampleFileName": "exampleFileContents__exampleFileName---yg7Zl", -} +[ + "exampleFileContents", + "exampleFileName", +] `; exports[`utils / cssSnapshots with allowAdditionalClasses enabled should return a dts file that allows any string value 1`] = ` "declare let classes: { - 'localClassInsideGlobal': string; + 'appLogo': string; + 'appLogo': string; + 'childClass': string; + 'classWithMixin': string; + 'const': string; + 'default': string; + 'globalClass': string; 'localClass': string; - 'localClass2': string; + 'localClassInsideGlobal': string; 'localClassInsideLocal': string; - 'reservedWords': string; - 'default': string; - 'const': string; 'nestedClassParent': string; - 'childClass': string; 'nestedClassParentExtended': string; + 'reservedWords': string; 'section1': string; 'section2': string; 'section3': string; @@ -30,20 +33,20 @@ exports[`utils / cssSnapshots with allowAdditionalClasses enabled should return 'section7': string; 'section8': string; 'section9': string; - 'classWithMixin': string; - 'appLogo': string; - 'appLogo': string; [key: string]: string; }; export default classes; -export let localClassInsideGlobal: string; +export let appLogo: string; +export let appLogo: string; +export let childClass: string; +export let classWithMixin: string; +export let globalClass: string; export let localClass: string; -export let localClass2: string; +export let localClassInsideGlobal: string; export let localClassInsideLocal: string; -export let reservedWords: string; export let nestedClassParent: string; -export let childClass: string; export let nestedClassParentExtended: string; +export let reservedWords: string; export let section1: string; export let section2: string; export let section3: string; @@ -53,18 +56,15 @@ export let section6: string; export let section7: string; export let section8: string; export let section9: string; -export let classWithMixin: string; -export let appLogo: string; -export let appLogo: string; " `; exports[`utils / cssSnapshots with baseUrl and paths in compilerOptions sass should find the files 1`] = ` -{ - "big-font": "tsconfig-paths-module__big-font---3FOK9", - "class-with-mixin": "tsconfig-paths-module__class-with-mixin---Uo34z", - "public-module": "tsconfig-paths-module__public-module---2IHe1", -} +[ + "big-font", + "class-with-mixin", + "public-module", +] `; exports[`utils / cssSnapshots with file 'empty.module.less' createExports should create an exports file 1`] = ` @@ -75,7 +75,7 @@ export default classes; " `; -exports[`utils / cssSnapshots with file 'empty.module.less' getCssExports should return an object matching expected CSS 1`] = `{}`; +exports[`utils / cssSnapshots with file 'empty.module.less' getCssExports should return an object matching expected CSS 1`] = `[]`; exports[`utils / cssSnapshots with file 'empty.module.less' with a custom template should transform the generated dts 1`] = ` "/* eslint-disable */ @@ -96,7 +96,7 @@ export default classes; " `; -exports[`utils / cssSnapshots with file 'empty.module.sass' getCssExports should return an object matching expected CSS 1`] = `{}`; +exports[`utils / cssSnapshots with file 'empty.module.sass' getCssExports should return an object matching expected CSS 1`] = `[]`; exports[`utils / cssSnapshots with file 'empty.module.sass' with a custom template should transform the generated dts 1`] = ` "/* eslint-disable */ @@ -117,7 +117,7 @@ export default classes; " `; -exports[`utils / cssSnapshots with file 'empty.module.scss' getCssExports should return an object matching expected CSS 1`] = `{}`; +exports[`utils / cssSnapshots with file 'empty.module.scss' getCssExports should return an object matching expected CSS 1`] = `[]`; exports[`utils / cssSnapshots with file 'empty.module.scss' with a custom template should transform the generated dts 1`] = ` "/* eslint-disable */ @@ -138,7 +138,7 @@ export default classes; " `; -exports[`utils / cssSnapshots with file 'empty.module.styl' getCssExports should return an object matching expected CSS 1`] = `{}`; +exports[`utils / cssSnapshots with file 'empty.module.styl' getCssExports should return an object matching expected CSS 1`] = `[]`; exports[`utils / cssSnapshots with file 'empty.module.styl' with a custom template should transform the generated dts 1`] = ` "/* eslint-disable */ @@ -153,308 +153,278 @@ export type AllClassNames = '';" exports[`utils / cssSnapshots with file 'import.module.css' createExports should create an exports file 1`] = ` "declare let classes: { - 'fadeIn': string; - 'classA': string; 'ClassB': string; - 'class-c': string; - 'class_d': string; - 'parent': string; 'childA': string; 'childB': string; + 'class-c': string; + 'classA': string; + 'classB': string; + 'class_d': string; 'nestedChild': string; + 'parent': string; }; export default classes; -export let fadeIn: string; -export let classA: string; export let ClassB: string; -export let class_d: string; -export let parent: string; export let childA: string; export let childB: string; +export let classA: string; +export let classB: string; +export let class_d: string; export let nestedChild: string; +export let parent: string; " `; exports[`utils / cssSnapshots with file 'import.module.css' getCssExports should return an object matching expected CSS 1`] = ` -{ - "ClassB": "import-module__ClassB---2LsIz", - "childA": "import-module__childA---2AUKk", - "childB": "import-module__childB---1z-Zh", - "class-c": "import-module__class-c---2JDAJ", - "classA": "import-module__classA---2fO5r", - "class_d": "import-module__class_d---2Dims", - "fadeIn": "__import_module_css__fadeIn", - "nestedChild": "import-module__nestedChild---1ZDxw", - "parent": "import-module__parent---2kdvO", -} +[ + "ClassB", + "childA", + "childB", + "class-c", + "classA", + "classB", + "class_d", + "nestedChild", + "parent", +] `; exports[`utils / cssSnapshots with file 'import.module.css' with a custom template should transform the generated dts 1`] = ` "/* eslint-disable */ declare let classes: { - 'fadeIn': string; - 'classA': string; 'ClassB': string; - 'class-c': string; - 'class_d': string; - 'parent': string; 'childA': string; 'childB': string; + 'class-c': string; + 'classA': string; + 'classB': string; + 'class_d': string; 'nestedChild': string; + 'parent': string; }; export default classes; -export let fadeIn: string; -export let classA: string; export let ClassB: string; -export let class_d: string; -export let parent: string; export let childA: string; export let childB: string; +export let classA: string; +export let classB: string; +export let class_d: string; export let nestedChild: string; +export let parent: string; export const __cssModule: true; -export type AllClassNames = 'fadeIn' | 'classA' | 'ClassB' | 'class-c' | 'class_d' | 'parent' | 'childA' | 'childB' | 'nestedChild';" +export type AllClassNames = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8';" `; exports[`utils / cssSnapshots with file 'import.module.less' createExports should create an exports file 1`] = ` "declare let classes: { - 'nested-class-parent': string; 'child-class': string; - 'selector-blue': string; - 'selector-green': string; - 'selector-red': string; + 'color-set': string; 'column-1': string; 'column-2': string; 'column-3': string; 'column-4': string; - 'color-set': string; + 'nested-class-parent': string; + 'selector-blue': string; + 'selector-green': string; + 'selector-red': string; }; export default classes; " `; exports[`utils / cssSnapshots with file 'import.module.less' getCssExports should return an object matching expected CSS 1`] = ` -{ - "child-class": "import-module__child-class---2XACw", - "color-set": "import-module__color-set---9xoPb", - "column-1": "import-module__column-1---3R-BM", - "column-2": "import-module__column-2---J0ZdX", - "column-3": "import-module__column-3---3_589", - "column-4": "import-module__column-4---SlPDz", - "nested-class-parent": "import-module__nested-class-parent---14g9m", - "selector-blue": "import-module__selector-blue---2JSaB", - "selector-green": "import-module__selector-green---1cLL8", - "selector-red": "import-module__selector-red---2T6zy", -} +[ + "child-class", + "color-set", + "column-1", + "column-2", + "column-3", + "column-4", + "nested-class-parent", + "selector-blue", + "selector-green", + "selector-red", +] `; exports[`utils / cssSnapshots with file 'import.module.less' with a custom template should transform the generated dts 1`] = ` "/* eslint-disable */ declare let classes: { - 'nested-class-parent': string; 'child-class': string; - 'selector-blue': string; - 'selector-green': string; - 'selector-red': string; + 'color-set': string; 'column-1': string; 'column-2': string; 'column-3': string; 'column-4': string; - 'color-set': string; + 'nested-class-parent': string; + 'selector-blue': string; + 'selector-green': string; + 'selector-red': string; }; export default classes; export const __cssModule: true; -export type AllClassNames = 'nested-class-parent' | 'child-class' | 'selector-blue' | 'selector-green' | 'selector-red' | 'column-1' | 'column-2' | 'column-3' | 'column-4' | 'color-set';" +export type AllClassNames = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';" `; exports[`utils / cssSnapshots with file 'import.module.styl' createExports should create an exports file 1`] = ` "declare let classes: { 'foo': string; - 'bar': string; - 'baz': string; - 'col-1': string; - 'col-2': string; - 'col-3': string; - 'local-class-1': string; - 'inside-local': string; - 'inside-1-name-2': string; - 'inside-2-name-1': string; }; export default classes; export let foo: string; -export let bar: string; -export let baz: string; " `; exports[`utils / cssSnapshots with file 'import.module.styl' getCssExports should return an object matching expected CSS 1`] = ` -{ - "bar": "import-module__bar---2N4cR", - "baz": "import-module__baz---6mQbB", - "col-1": "import-module__col-1---2QW7j", - "col-2": "import-module__col-2---2CRRS", - "col-3": "import-module__col-3---17Luq", - "foo": "import-module__foo---FJflO", - "inside-1-name-2": "import-module__inside-1-name-2---wLnoq", - "inside-2-name-1": "import-module__inside-2-name-1---1GRhn", - "inside-local": "import-module__inside-local---1JuOc", - "local-class-1": "import-module__local-class-1---3QupT", -} +[ + "foo", +] `; exports[`utils / cssSnapshots with file 'import.module.styl' with a custom template should transform the generated dts 1`] = ` "/* eslint-disable */ declare let classes: { 'foo': string; - 'bar': string; - 'baz': string; - 'col-1': string; - 'col-2': string; - 'col-3': string; - 'local-class-1': string; - 'inside-local': string; - 'inside-1-name-2': string; - 'inside-2-name-1': string; }; export default classes; export let foo: string; -export let bar: string; -export let baz: string; export const __cssModule: true; -export type AllClassNames = 'foo' | 'bar' | 'baz' | 'col-1' | 'col-2' | 'col-3' | 'local-class-1' | 'inside-local' | 'inside-1-name-2' | 'inside-2-name-1';" +export type AllClassNames = '0';" `; exports[`utils / cssSnapshots with file 'test.module.css' createExports should create an exports file 1`] = ` "declare let classes: { - 'fadeIn': string; - 'classA': string; 'ClassB': string; - 'class-c': string; - 'class_d': string; - 'parent': string; 'childA': string; 'childB': string; + 'class-c': string; + 'classA': string; + 'classB': string; + 'class_d': string; 'nestedChild': string; + 'parent': string; }; export default classes; -export let fadeIn: string; -export let classA: string; export let ClassB: string; -export let class_d: string; -export let parent: string; export let childA: string; export let childB: string; +export let classA: string; +export let classB: string; +export let class_d: string; export let nestedChild: string; +export let parent: string; " `; exports[`utils / cssSnapshots with file 'test.module.css' getCssExports should return an object matching expected CSS 1`] = ` -{ - "ClassB": "test-module__ClassB---G7fhY", - "childA": "test-module__childA---26dwC", - "childB": "test-module__childB---13lLy", - "class-c": "test-module__class-c---3Ouzp", - "classA": "test-module__classA---KAOw8", - "class_d": "test-module__class_d---3pjDe", - "fadeIn": "__test_module_css__fadeIn", - "nestedChild": "test-module__nestedChild---v7rOR", - "parent": "test-module__parent---2tsUX", -} +[ + "ClassB", + "childA", + "childB", + "class-c", + "classA", + "classB", + "class_d", + "nestedChild", + "parent", +] `; exports[`utils / cssSnapshots with file 'test.module.css' with a custom template should transform the generated dts 1`] = ` "/* eslint-disable */ declare let classes: { - 'fadeIn': string; - 'classA': string; 'ClassB': string; - 'class-c': string; - 'class_d': string; - 'parent': string; 'childA': string; 'childB': string; + 'class-c': string; + 'classA': string; + 'classB': string; + 'class_d': string; 'nestedChild': string; + 'parent': string; }; export default classes; -export let fadeIn: string; -export let classA: string; export let ClassB: string; -export let class_d: string; -export let parent: string; export let childA: string; export let childB: string; +export let classA: string; +export let classB: string; +export let class_d: string; export let nestedChild: string; +export let parent: string; export const __cssModule: true; -export type AllClassNames = 'fadeIn' | 'classA' | 'ClassB' | 'class-c' | 'class_d' | 'parent' | 'childA' | 'childB' | 'nestedChild';" +export type AllClassNames = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8';" `; exports[`utils / cssSnapshots with file 'test.module.less' createExports should create an exports file 1`] = ` "declare let classes: { - 'nested-class-parent': string; 'child-class': string; - 'selector-blue': string; - 'selector-green': string; - 'selector-red': string; + 'color-set': string; 'column-1': string; 'column-2': string; 'column-3': string; 'column-4': string; - 'color-set': string; + 'nested-class-parent': string; + 'selector-blue': string; + 'selector-green': string; + 'selector-red': string; }; export default classes; " `; exports[`utils / cssSnapshots with file 'test.module.less' getCssExports should return an object matching expected CSS 1`] = ` -{ - "child-class": "test-module__child-class---1au0d", - "color-set": "test-module__color-set---bEXmh", - "column-1": "test-module__column-1---5hXb3", - "column-2": "test-module__column-2---2ykNv", - "column-3": "test-module__column-3---2JnAp", - "column-4": "test-module__column-4---SG3xj", - "nested-class-parent": "test-module__nested-class-parent---2jIpC", - "selector-blue": "test-module__selector-blue---2kUKa", - "selector-green": "test-module__selector-green---hMr6S", - "selector-red": "test-module__selector-red---2hf4j", -} +[ + "child-class", + "color-set", + "column-1", + "column-2", + "column-3", + "column-4", + "nested-class-parent", + "selector-blue", + "selector-green", + "selector-red", +] `; exports[`utils / cssSnapshots with file 'test.module.less' with a custom template should transform the generated dts 1`] = ` "/* eslint-disable */ declare let classes: { - 'nested-class-parent': string; 'child-class': string; - 'selector-blue': string; - 'selector-green': string; - 'selector-red': string; + 'color-set': string; 'column-1': string; 'column-2': string; 'column-3': string; 'column-4': string; - 'color-set': string; + 'nested-class-parent': string; + 'selector-blue': string; + 'selector-green': string; + 'selector-red': string; }; export default classes; export const __cssModule: true; -export type AllClassNames = 'nested-class-parent' | 'child-class' | 'selector-blue' | 'selector-green' | 'selector-red' | 'column-1' | 'column-2' | 'column-3' | 'column-4' | 'color-set';" +export type AllClassNames = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';" `; exports[`utils / cssSnapshots with file 'test.module.sass' createExports should create an exports file 1`] = ` "declare let classes: { - 'local-class-inside-global': string; + 'child-class': string; + 'class-with-mixin': string; + 'const': string; + 'default': string; + 'global-class': string; 'local-class': string; - 'local-class-2': string; + 'local-class-inside-global': string; 'local-class-inside-local': string; - 'reserved-words': string; - 'default': string; - 'const': string; 'nested-class-parent': string; - 'child-class': string; 'nested-class-parent--extended': string; + 'reserved-words': string; 'section-1': string; 'section-2': string; 'section-3': string; @@ -464,50 +434,50 @@ exports[`utils / cssSnapshots with file 'test.module.sass' createExports should 'section-7': string; 'section-8': string; 'section-9': string; - 'class-with-mixin': string; }; export default classes; " `; exports[`utils / cssSnapshots with file 'test.module.sass' getCssExports should return an object matching expected CSS 1`] = ` -{ - "child-class": "test-module__child-class---2vfhc", - "class-with-mixin": "test-module__class-with-mixin---3zUq-", - "const": "test-module__const---39o_j", - "default": "test-module__default---h-tcC", - "local-class": "test-module__local-class---1yStp", - "local-class-2": "test-module__local-class-2---3xCgt", - "local-class-inside-global": "test-module__local-class-inside-global---Mznd5", - "local-class-inside-local": "test-module__local-class-inside-local---1z2Qf", - "nested-class-parent": "test-module__nested-class-parent---3oyeq", - "nested-class-parent--extended": "test-module__nested-class-parent--extended---cjRbg", - "reserved-words": "test-module__reserved-words---3hGie", - "section-1": "test-module__section-1---2QkaE", - "section-2": "test-module__section-2---23KHs", - "section-3": "test-module__section-3---2BttW", - "section-4": "test-module__section-4---1TrSo", - "section-5": "test-module__section-5---1PIYZ", - "section-6": "test-module__section-6---tbEch", - "section-7": "test-module__section-7---i7uWX", - "section-8": "test-module__section-8---1jfNT", - "section-9": "test-module__section-9---1akFT", -} +[ + "child-class", + "class-with-mixin", + "const", + "default", + "global-class", + "local-class", + "local-class-inside-global", + "local-class-inside-local", + "nested-class-parent", + "nested-class-parent--extended", + "reserved-words", + "section-1", + "section-2", + "section-3", + "section-4", + "section-5", + "section-6", + "section-7", + "section-8", + "section-9", +] `; exports[`utils / cssSnapshots with file 'test.module.sass' with a custom template should transform the generated dts 1`] = ` "/* eslint-disable */ declare let classes: { - 'local-class-inside-global': string; + 'child-class': string; + 'class-with-mixin': string; + 'const': string; + 'default': string; + 'global-class': string; 'local-class': string; - 'local-class-2': string; + 'local-class-inside-global': string; 'local-class-inside-local': string; - 'reserved-words': string; - 'default': string; - 'const': string; 'nested-class-parent': string; - 'child-class': string; 'nested-class-parent--extended': string; + 'reserved-words': string; 'section-1': string; 'section-2': string; 'section-3': string; @@ -517,26 +487,28 @@ declare let classes: { 'section-7': string; 'section-8': string; 'section-9': string; - 'class-with-mixin': string; }; export default classes; export const __cssModule: true; -export type AllClassNames = 'local-class-inside-global' | 'local-class' | 'local-class-2' | 'local-class-inside-local' | 'reserved-words' | 'default' | 'const' | 'nested-class-parent' | 'child-class' | 'nested-class-parent--extended' | 'section-1' | 'section-2' | 'section-3' | 'section-4' | 'section-5' | 'section-6' | 'section-7' | 'section-8' | 'section-9' | 'class-with-mixin';" +export type AllClassNames = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | '13' | '14' | '15' | '16' | '17' | '18' | '19';" `; exports[`utils / cssSnapshots with file 'test.module.scss' createExports should create an exports file 1`] = ` "declare let classes: { - 'local-class-inside-global': string; + 'App-logo': string; + 'App_logo': string; + 'child-class': string; + 'class-with-mixin': string; + 'const': string; + 'default': string; + 'global-class': string; 'local-class': string; - 'local-class-2': string; + 'local-class-inside-global': string; 'local-class-inside-local': string; - 'reserved-words': string; - 'default': string; - 'const': string; 'nested-class-parent': string; - 'child-class': string; 'nested-class-parent--extended': string; + 'reserved-words': string; 'section-1': string; 'section-2': string; 'section-3': string; @@ -546,9 +518,6 @@ exports[`utils / cssSnapshots with file 'test.module.scss' createExports should 'section-7': string; 'section-8': string; 'section-9': string; - 'class-with-mixin': string; - 'App_logo': string; - 'App-logo': string; }; export default classes; export let App_logo: string; @@ -556,45 +525,48 @@ export let App_logo: string; `; exports[`utils / cssSnapshots with file 'test.module.scss' getCssExports should return an object matching expected CSS 1`] = ` -{ - "App-logo": "test-module__App-logo---3S1C4", - "App_logo": "test-module__App_logo---1llXs", - "child-class": "test-module__child-class---s-_Mc", - "class-with-mixin": "test-module__class-with-mixin---1JqB_", - "const": "test-module__const---28kKv", - "default": "test-module__default---8gLb1", - "local-class": "test-module__local-class---1Ju3l", - "local-class-2": "test-module__local-class-2---3aSgy", - "local-class-inside-global": "test-module__local-class-inside-global---IVh9J", - "local-class-inside-local": "test-module__local-class-inside-local---1LKIi", - "nested-class-parent": "test-module__nested-class-parent---2LnTV", - "nested-class-parent--extended": "test-module__nested-class-parent--extended---1j85b", - "reserved-words": "test-module__reserved-words---1mM1m", - "section-1": "test-module__section-1---11Ic3", - "section-2": "test-module__section-2---1Uiwc", - "section-3": "test-module__section-3---2eZeM", - "section-4": "test-module__section-4---3m8sf", - "section-5": "test-module__section-5---1MTwN", - "section-6": "test-module__section-6---szUAt", - "section-7": "test-module__section-7---2DOBJ", - "section-8": "test-module__section-8---3qav2", - "section-9": "test-module__section-9---2EMR_", -} +[ + "App-logo", + "App_logo", + "child-class", + "class-with-mixin", + "const", + "default", + "global-class", + "local-class", + "local-class-inside-global", + "local-class-inside-local", + "nested-class-parent", + "nested-class-parent--extended", + "reserved-words", + "section-1", + "section-2", + "section-3", + "section-4", + "section-5", + "section-6", + "section-7", + "section-8", + "section-9", +] `; exports[`utils / cssSnapshots with file 'test.module.scss' with a custom template should transform the generated dts 1`] = ` "/* eslint-disable */ declare let classes: { - 'local-class-inside-global': string; + 'App-logo': string; + 'App_logo': string; + 'child-class': string; + 'class-with-mixin': string; + 'const': string; + 'default': string; + 'global-class': string; 'local-class': string; - 'local-class-2': string; + 'local-class-inside-global': string; 'local-class-inside-local': string; - 'reserved-words': string; - 'default': string; - 'const': string; 'nested-class-parent': string; - 'child-class': string; 'nested-class-parent--extended': string; + 'reserved-words': string; 'section-1': string; 'section-2': string; 'section-3': string; @@ -604,92 +576,58 @@ declare let classes: { 'section-7': string; 'section-8': string; 'section-9': string; - 'class-with-mixin': string; - 'App_logo': string; - 'App-logo': string; }; export default classes; export let App_logo: string; export const __cssModule: true; -export type AllClassNames = 'local-class-inside-global' | 'local-class' | 'local-class-2' | 'local-class-inside-local' | 'reserved-words' | 'default' | 'const' | 'nested-class-parent' | 'child-class' | 'nested-class-parent--extended' | 'section-1' | 'section-2' | 'section-3' | 'section-4' | 'section-5' | 'section-6' | 'section-7' | 'section-8' | 'section-9' | 'class-with-mixin' | 'App_logo' | 'App-logo';" +export type AllClassNames = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | '13' | '14' | '15' | '16' | '17' | '18' | '19' | '20' | '21';" `; exports[`utils / cssSnapshots with file 'test.module.styl' createExports should create an exports file 1`] = ` "declare let classes: { 'foo': string; - 'bar': string; - 'baz': string; - 'col-1': string; - 'col-2': string; - 'col-3': string; - 'local-class-1': string; - 'inside-local': string; - 'inside-1-name-2': string; - 'inside-2-name-1': string; }; export default classes; export let foo: string; -export let bar: string; -export let baz: string; " `; exports[`utils / cssSnapshots with file 'test.module.styl' getCssExports should return an object matching expected CSS 1`] = ` -{ - "bar": "test-module__bar---2WWom", - "baz": "test-module__baz---1Rs9U", - "col-1": "test-module__col-1---1XP3K", - "col-2": "test-module__col-2---2nPwS", - "col-3": "test-module__col-3---3CSSb", - "foo": "test-module__foo---2pGaO", - "inside-1-name-2": "test-module__inside-1-name-2---3Zdgw", - "inside-2-name-1": "test-module__inside-2-name-1---3PYHl", - "inside-local": "test-module__inside-local---2KzUE", - "local-class-1": "test-module__local-class-1---3piX9", -} +[ + "foo", +] `; exports[`utils / cssSnapshots with file 'test.module.styl' with a custom template should transform the generated dts 1`] = ` "/* eslint-disable */ declare let classes: { 'foo': string; - 'bar': string; - 'baz': string; - 'col-1': string; - 'col-2': string; - 'col-3': string; - 'local-class-1': string; - 'inside-local': string; - 'inside-1-name-2': string; - 'inside-2-name-1': string; }; export default classes; export let foo: string; -export let bar: string; -export let baz: string; export const __cssModule: true; -export type AllClassNames = 'foo' | 'bar' | 'baz' | 'col-1' | 'col-2' | 'col-3' | 'local-class-1' | 'inside-local' | 'inside-1-name-2' | 'inside-2-name-1';" +export type AllClassNames = '0';" `; exports[`utils / cssSnapshots with goToDefinition enabled should return a line-accurate dts file 1`] = ` -" +"export let globalClass: string; -export let localClassInsideGlobal: string; +export let localClass: string;export let localClassInsideGlobal: string; + -export let localClass: string; -export let localClass2: string;export let localClassInsideLocal: string; +export let localClassInsideLocal: string; @@ -704,7 +642,7 @@ export let reservedWords: string; -export let nestedClassParent: string;export let childClass: string; +export let childClass: string;export let nestedClassParent: string; export let nestedClassParentExtended: string; @@ -758,6 +696,8 @@ export let appLogo: string; + + @@ -766,109 +706,111 @@ export let appLogo: string; exports[`utils / cssSnapshots with goToDefinition enabled should return an object with classes, css, and a source map 1`] = ` { - "classes": { - "App-logo": "test-module__App-logo---3S1C4", - "App_logo": "test-module__App_logo---1llXs", - "child-class": "test-module__child-class---s-_Mc", - "class-with-mixin": "test-module__class-with-mixin---1JqB_", - "const": "test-module__const---28kKv", - "default": "test-module__default---8gLb1", - "local-class": "test-module__local-class---1Ju3l", - "local-class-2": "test-module__local-class-2---3aSgy", - "local-class-inside-global": "test-module__local-class-inside-global---IVh9J", - "local-class-inside-local": "test-module__local-class-inside-local---1LKIi", - "nested-class-parent": "test-module__nested-class-parent---2LnTV", - "nested-class-parent--extended": "test-module__nested-class-parent--extended---1j85b", - "reserved-words": "test-module__reserved-words---1mM1m", - "section-1": "test-module__section-1---11Ic3", - "section-2": "test-module__section-2---1Uiwc", - "section-3": "test-module__section-3---2eZeM", - "section-4": "test-module__section-4---3m8sf", - "section-5": "test-module__section-5---1MTwN", - "section-6": "test-module__section-6---szUAt", - "section-7": "test-module__section-7---2DOBJ", - "section-8": "test-module__section-8---3qav2", - "section-9": "test-module__section-9---2EMR_", - }, - "css": ".global-class { + "classes": [ + "App-logo", + "App_logo", + "child-class", + "class-with-mixin", + "const", + "default", + "global-class", + "local-class", + "local-class-inside-global", + "local-class-inside-local", + "nested-class-parent", + "nested-class-parent--extended", + "reserved-words", + "section-1", + "section-2", + "section-3", + "section-4", + "section-5", + "section-6", + "section-7", + "section-8", + "section-9", + ], + "css": " + +:global .global-class { color: rebeccapurple; } -.global-class-2 .test-module__local-class-inside-global---IVh9J { +:global(.global-class-2) .local-class-inside-global { color: rebeccapurple; } -.test-module__local-class---1Ju3l { +:local .local-class { color: rebeccapurple; } -.test-module__local-class-2---3aSgy .test-module__local-class-inside-local---1LKIi { +:local(.local-class-2) .local-class-inside-local { color: rebeccapurple; } -.test-module__reserved-words---1mM1m .test-module__default---8gLb1 { +.reserved-words .default { color: rebeccapurple; } -.test-module__reserved-words---1mM1m .test-module__const---28kKv { +.reserved-words .const { color: rebeccapurple; } -.test-module__nested-class-parent---2LnTV .test-module__child-class---s-_Mc { +.nested-class-parent .child-class { color: rebeccapurple; } -.test-module__nested-class-parent--extended---1j85b { +.nested-class-parent--extended { color: rebeccapurple; } -.test-module__section-1---11Ic3 { +.section-1 { color: rebeccapurple; } -.test-module__section-2---1Uiwc { +.section-2 { color: rebeccapurple; } -.test-module__section-3---2eZeM { +.section-3 { color: rebeccapurple; } -.test-module__section-4---3m8sf { +.section-4 { color: rebeccapurple; } -.test-module__section-5---1MTwN { +.section-5 { color: rebeccapurple; } -.test-module__section-6---szUAt { +.section-6 { color: rebeccapurple; } -.test-module__section-7---2DOBJ { +.section-7 { color: rebeccapurple; } -.test-module__section-8---3qav2 { +.section-8 { color: rebeccapurple; } -.test-module__section-9---2EMR_ { +.section-9 { color: rebeccapurple; } -.test-module__class-with-mixin---1JqB_ { +.class-with-mixin { margin: 0; } -.test-module__App_logo---1llXs { +.App_logo { height: 40vmin; pointer-events: none; } @media (prefers-reduced-motion: no-preference) { - .test-module__App-logo---3S1C4 { + .App-logo { animation: my-animation infinite 20s linear; } } @@ -880,7 +822,7 @@ exports[`utils / cssSnapshots with goToDefinition enabled should return an objec */", "sourceMap": { "file": "src/helpers/__tests__/fixtures/test.module.scss", - "mappings": "AAAA;EACE,oBAAA;ACCF;;ADGE;EACE,oBAAA;ACAJ;;ADIA;EACE,oBAAA;ACDF;;ADKE;EACE,oBAAA;ACFJ;;ADOE;EACE,oBAAA;ACJJ;;ADME;EACE,oBAAA;ACJJ;;ADSE;EACE,oBAAA;ACNJ;;ADQE;EACE,oBAAA;ACNJ;;ADaE;EACE,oBAJI;ACNR;;ADSE;EACE,oBAJI;ACFR;;ADKE;EACE,oBAJI;ACER;;ADCE;EACE,oBAJI;ACMR;;ADHE;EACE,oBAJI;ACUR;;ADPE;EACE,oBAJI;ACcR;;ADXE;EACE,oBAJI;ACkBR;;ADfE;EACE,oBAJI;ACsBR;;ADnBE;EACE,oBAJI;AC0BR;;ADhBA;EE/CE,SFgDoB;ACmBtB;;ADhBA;EACE,cAAA;EACA,oBAAA;ACmBF;;ADhBA;EACE;IACE,2CAAA;ECmBF;AACF;;ADZA;;;;CAAA", + "mappings": ";;AAAA;EACE,oBAAA;ACCF;;ADGE;EACE,oBAAA;ACAJ;;ADIA;EACE,oBAAA;ACDF;;ADKE;EACE,oBAAA;ACFJ;;ADOE;EACE,oBAAA;ACJJ;;ADME;EACE,oBAAA;ACJJ;;ADSE;EACE,oBAAA;ACNJ;;ADQE;EACE,oBAAA;ACNJ;;ADaE;EACE,oBAJI;ACNR;;ADSE;EACE,oBAJI;ACFR;;ADKE;EACE,oBAJI;ACER;;ADCE;EACE,oBAJI;ACMR;;ADHE;EACE,oBAJI;ACUR;;ADPE;EACE,oBAJI;ACcR;;ADXE;EACE,oBAJI;ACkBR;;ADfE;EACE,oBAJI;ACsBR;;ADnBE;EACE,oBAJI;AC0BR;;ADhBA;EE/CE,SFgDoB;ACmBtB;;ADhBA;EACE,cAAA;EACA,oBAAA;ACmBF;;ADhBA;EACE;IACE,2CAAA;ECmBF;AACF;;ADZA;;;;CAAA", "names": [], "sources": [ "file://[cwd]/src/helpers/__tests__/fixtures/test.module.scss", @@ -892,6 +834,7 @@ exports[`utils / cssSnapshots with goToDefinition enabled should return an objec } `; +<<<<<<< Updated upstream exports[`utils / cssSnapshots with loadPaths in sass options should find external file from loadPaths 1`] = ` { "big-font": "include-path-module__big-font---Td7hY", @@ -904,20 +847,37 @@ exports[`utils / cssSnapshots with loadPaths in stylus options should find exter "external-class": "include-path-module__external-class---ecH0A", "include-path": "include-path-module__include-path---2f2uR", } +======= +exports[`utils / cssSnapshots with includePaths in sass options should find external file from includePaths 1`] = ` +[ + "big-font", + "class-with-mixin", +] +`; + +exports[`utils / cssSnapshots with includePaths in stylus options should find external file from includePaths 1`] = ` +[ + "external-class", + "include-path", +] +>>>>>>> Stashed changes `; exports[`utils / cssSnapshots with noUncheckedIndexedAccess enabled should return a dts file with only possibly undefined strings 1`] = ` "declare let classes: { - 'localClassInsideGlobal'?: string; + 'appLogo'?: string; + 'appLogo'?: string; + 'childClass'?: string; + 'classWithMixin'?: string; + 'const'?: string; + 'default'?: string; + 'globalClass'?: string; 'localClass'?: string; - 'localClass2'?: string; + 'localClassInsideGlobal'?: string; 'localClassInsideLocal'?: string; - 'reservedWords'?: string; - 'default'?: string; - 'const'?: string; 'nestedClassParent'?: string; - 'childClass'?: string; 'nestedClassParentExtended'?: string; + 'reservedWords'?: string; 'section1'?: string; 'section2'?: string; 'section3'?: string; @@ -927,19 +887,19 @@ exports[`utils / cssSnapshots with noUncheckedIndexedAccess enabled should retur 'section7'?: string; 'section8'?: string; 'section9'?: string; - 'classWithMixin'?: string; - 'appLogo'?: string; - 'appLogo'?: string; }; export default classes; -export let localClassInsideGlobal?: string; +export let appLogo?: string; +export let appLogo?: string; +export let childClass?: string; +export let classWithMixin?: string; +export let globalClass?: string; export let localClass?: string; -export let localClass2?: string; +export let localClassInsideGlobal?: string; export let localClassInsideLocal?: string; -export let reservedWords?: string; export let nestedClassParent?: string; -export let childClass?: string; export let nestedClassParentExtended?: string; +export let reservedWords?: string; export let section1?: string; export let section2?: string; export let section3?: string; @@ -949,8 +909,5 @@ export let section6?: string; export let section7?: string; export let section8?: string; export let section9?: string; -export let classWithMixin?: string; -export let appLogo?: string; -export let appLogo?: string; " `; diff --git a/src/helpers/__tests__/fixtures/test.module.css b/src/helpers/__tests__/fixtures/test.module.css index 8aa5bb0..79bf91c 100644 --- a/src/helpers/__tests__/fixtures/test.module.css +++ b/src/helpers/__tests__/fixtures/test.module.css @@ -34,3 +34,7 @@ opacity: 1; } } + +@nest .classB & { + color: rebeccapurple; +} diff --git a/src/helpers/__tests__/getDtsSnapshot.test.ts b/src/helpers/__tests__/getDtsSnapshot.test.ts index 24b4dba..32ec352 100644 --- a/src/helpers/__tests__/getDtsSnapshot.test.ts +++ b/src/helpers/__tests__/getDtsSnapshot.test.ts @@ -117,7 +117,7 @@ describe('utils / cssSnapshots', () => { directory: __dirname, }); - expect(cssExports.classes.test).toMatchSnapshot(); + expect(cssExports.classes[0]).toMatchSnapshot(); }); }); diff --git a/src/helpers/createDtsExports.ts b/src/helpers/createDtsExports.ts index 9a071af..2dbad98 100644 --- a/src/helpers/createDtsExports.ts +++ b/src/helpers/createDtsExports.ts @@ -33,7 +33,7 @@ export const createDtsExports = ({ const classNameToNamedExport = (className: string) => `export let ${className}${possiblyUndefined ? '?' : ''}: string;`; - const processedClasses = Object.keys(classes) + const processedClasses = classes .map(transformClasses(options.classnameTransform)) .reduce(flattenClassNames, []); const filteredClasses = processedClasses @@ -64,28 +64,28 @@ export default classes; const dtsLines = Array.from(Array(cssLines.length), () => ''); // Create a list of filtered classnames and hashed classnames. - const filteredClasses = Object.entries(cssExports.classes) - .map(([className, hashedClassName]) => [ + const filteredClasses = cssExports.classes + .map((className) => [ + className, // TODO: Improve this. It may return multiple valid classnames and we // want to handle all of those. transformClasses(options.classnameTransform)(className)[0], - hashedClassName, ]) - .filter(([className]) => isValidVariable(className)); + .filter(([, className]) => isValidVariable(className)); - filteredClasses.forEach(([className, hashedClassName]) => { + filteredClasses.forEach(([className, transformedClassName]) => { const matchedLine = cssLines.findIndex((line) => - line.includes(hashedClassName), + line.includes(className), ); const matchedColumn = - matchedLine && cssLines[matchedLine].indexOf(hashedClassName); + matchedLine && cssLines[matchedLine].indexOf(className); const { line: lineNumber } = smc.originalPositionFor({ // Lines start at 1, not 0. line: matchedLine >= 0 ? matchedLine + 1 : 1, column: matchedColumn >= 0 ? matchedColumn : 0, }); dtsLines[lineNumber ? lineNumber - 1 : 0] += - classNameToNamedExport(className); + classNameToNamedExport(transformedClassName); }); dts = dtsLines.join('\n'); diff --git a/src/helpers/getCssExports.ts b/src/helpers/getCssExports.ts index 80ed93a..c93f5ec 100644 --- a/src/helpers/getCssExports.ts +++ b/src/helpers/getCssExports.ts @@ -3,7 +3,7 @@ import Processor from 'postcss/lib/processor'; import less from 'less'; import sass from 'sass'; import stylus from 'stylus'; -import { CSSExports, extractICSS } from 'icss-utils'; +import { parse } from 'css-selector-tokenizer'; import { RawSourceMap } from 'source-map-js'; import tsModule from 'typescript/lib/tsserverlibrary'; import { createMatchPath } from 'tsconfig-paths'; @@ -30,7 +30,7 @@ export const getFileType = (fileName: string): FileType => { const getFilePath = (fileName: string) => path.dirname(fileName); export interface CSSExportsWithSourceMap { - classes: CSSExports; + classes: string[]; css?: string; sourceMap?: RawSourceMap; } @@ -145,14 +145,20 @@ export const getCssExports = ({ }, }); + const tokens = parse(processedCss.css).nodes[0].nodes; + console.log(tokens); + const classes = tokens + .filter((token) => token.type === 'class') + .map((token) => token.name ?? ''); + return { - classes: extractICSS(processedCss.root).icssExports, + classes: Array.from(new Set(classes)).sort(), css: processedCss.css, sourceMap: processedCss.map.toJSON(), }; } catch (e) { console.error(e); logger.error(e); - return { classes: {} }; + return { classes: [] }; } }; diff --git a/src/helpers/getProcessor.ts b/src/helpers/getProcessor.ts index 3088919..d55aed2 100644 --- a/src/helpers/getProcessor.ts +++ b/src/helpers/getProcessor.ts @@ -1,15 +1,7 @@ import postcss, { AcceptedPlugin } from 'postcss'; import Processor from 'postcss/lib/processor'; import postcssIcssKeyframes from 'postcss-icss-keyframes'; -import postcssIcssSelectors from 'postcss-icss-selectors'; export const getProcessor = ( additionalPlugins: AcceptedPlugin[] = [], -): Processor => - postcss([ - ...additionalPlugins, - postcssIcssKeyframes(), - postcssIcssSelectors({ - mode: 'local', - }), - ]); +): Processor => postcss([...additionalPlugins, postcssIcssKeyframes()]); diff --git a/src/options.ts b/src/options.ts index 324f084..a969612 100644 --- a/src/options.ts +++ b/src/options.ts @@ -1,7 +1,6 @@ import { Options as SassOptions } from 'sass'; import tsModule from 'typescript/lib/tsserverlibrary'; import { DotenvConfigOptions } from 'dotenv'; -import { CSSExports } from 'icss-utils'; import stylus from 'stylus'; import { Logger } from './helpers/logger'; @@ -54,7 +53,7 @@ export type CustomRenderer = ( ) => string; export interface CustomTemplateOptions { - classes: CSSExports; + classes: string[]; fileName: string; logger: Logger; }