ember-scoped-css 1.1.0 → 2.0.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.
Files changed (83) hide show
  1. package/README.md +203 -47
  2. package/dist/cjs/all-Du43cBa9.cjs +1308 -0
  3. package/dist/cjs/all.cjs +3 -0
  4. package/dist/cjs/babel.cjs +9 -0
  5. package/dist/cjs/rollup.cjs +8 -0
  6. package/dist/cjs/vite.cjs +8 -0
  7. package/dist/runtime/index.d.ts +11 -0
  8. package/dist/runtime/index.d.ts.map +1 -0
  9. package/dist/runtime/index.js +12 -8
  10. package/dist/runtime/index.js.map +1 -7
  11. package/{declarations → dist}/runtime/test-support.d.ts +5 -2
  12. package/dist/runtime/test-support.d.ts.map +1 -0
  13. package/dist/runtime/test-support.js +357 -182
  14. package/dist/runtime/test-support.js.map +1 -7
  15. package/package.json +21 -24
  16. package/src/build/babel-plugin.js +4 -1
  17. package/src/build/public-exports/all.js +10 -0
  18. package/src/build/public-exports/babel.js +5 -0
  19. package/src/build/public-exports/rollup.js +3 -0
  20. package/src/build/public-exports/vite.js +3 -0
  21. package/src/build/scoped-css-unplugin.js +10 -33
  22. package/src/build/template-plugin.js +9 -19
  23. package/src/build/template-plugin.test.ts +108 -19
  24. package/src/build/unplugin-colocated.js +103 -0
  25. package/src/build/unplugin-inline.js +71 -0
  26. package/src/lib/css/rewrite.js +8 -8
  27. package/src/lib/css/rewrite.test.ts +69 -128
  28. package/src/lib/path/const.js +19 -0
  29. package/src/lib/path/hash-from-absolute-path.js +3 -2
  30. package/src/lib/path/template-transform-paths.js +3 -2
  31. package/src/lib/path/utils.appPath.test.ts +2 -2
  32. package/src/lib/path/utils.hashFrom.test.ts +2 -2
  33. package/src/lib/path/utils.js +63 -20
  34. package/src/lib/request.js +58 -33
  35. package/src/runtime/index.ts +1 -1
  36. package/declarations/build/template-plugin.d.ts +0 -7
  37. package/declarations/build/template-plugin.d.ts.map +0 -1
  38. package/declarations/build/template-plugin.test.d.ts +0 -2
  39. package/declarations/build/template-plugin.test.d.ts.map +0 -1
  40. package/declarations/lib/css/rewrite.d.ts +0 -2
  41. package/declarations/lib/css/rewrite.d.ts.map +0 -1
  42. package/declarations/lib/css/rewrite.test.d.ts +0 -2
  43. package/declarations/lib/css/rewrite.test.d.ts.map +0 -1
  44. package/declarations/lib/css/utils.d.ts +0 -29
  45. package/declarations/lib/css/utils.d.ts.map +0 -1
  46. package/declarations/lib/path/hash-from-absolute-path.d.ts +0 -3
  47. package/declarations/lib/path/hash-from-absolute-path.d.ts.map +0 -1
  48. package/declarations/lib/path/hash-from-absolute-path.test.d.ts +0 -2
  49. package/declarations/lib/path/hash-from-absolute-path.test.d.ts.map +0 -1
  50. package/declarations/lib/path/hash-from-module-path.d.ts +0 -31
  51. package/declarations/lib/path/hash-from-module-path.d.ts.map +0 -1
  52. package/declarations/lib/path/md5.d.ts +0 -12
  53. package/declarations/lib/path/md5.d.ts.map +0 -1
  54. package/declarations/lib/path/template-transform-paths.d.ts +0 -11
  55. package/declarations/lib/path/template-transform-paths.d.ts.map +0 -1
  56. package/declarations/lib/path/template-transform-paths.test.d.ts +0 -2
  57. package/declarations/lib/path/template-transform-paths.test.d.ts.map +0 -1
  58. package/declarations/lib/path/utils.appPath.test.d.ts +0 -2
  59. package/declarations/lib/path/utils.appPath.test.d.ts.map +0 -1
  60. package/declarations/lib/path/utils.d.ts +0 -94
  61. package/declarations/lib/path/utils.d.ts.map +0 -1
  62. package/declarations/lib/path/utils.findWorkspacePath.test.d.ts +0 -2
  63. package/declarations/lib/path/utils.findWorkspacePath.test.d.ts.map +0 -1
  64. package/declarations/lib/path/utils.hashFrom.test.d.ts +0 -2
  65. package/declarations/lib/path/utils.hashFrom.test.d.ts.map +0 -1
  66. package/declarations/lib/path/utils.isRelevantFile.test.d.ts +0 -2
  67. package/declarations/lib/path/utils.isRelevantFile.test.d.ts.map +0 -1
  68. package/declarations/lib/path/utils.paths.test.d.ts +0 -5
  69. package/declarations/lib/path/utils.paths.test.d.ts.map +0 -1
  70. package/declarations/lib/renameClass.d.ts +0 -9
  71. package/declarations/lib/renameClass.d.ts.map +0 -1
  72. package/declarations/lib/request.d.ts +0 -8
  73. package/declarations/lib/request.d.ts.map +0 -1
  74. package/declarations/lib/rewriteHbs.d.ts +0 -17
  75. package/declarations/lib/rewriteHbs.d.ts.map +0 -1
  76. package/declarations/runtime/index.d.ts +0 -8
  77. package/declarations/runtime/index.d.ts.map +0 -1
  78. package/declarations/runtime/test-support.d.ts.map +0 -1
  79. package/dist/cjs/babel-plugin.cjs +0 -176
  80. package/dist/cjs/index.cjs +0 -968
  81. package/dist/cjs/template-plugin.cjs +0 -856
  82. package/src/build/index.js +0 -7
  83. package/src/build/vite.js +0 -3
@@ -0,0 +1,3 @@
1
+ const require_all = require('./all-Du43cBa9.cjs');
2
+
3
+ exports.scopedCSS = require_all.scopedCSS;
@@ -0,0 +1,9 @@
1
+ const require_all = require('./all-Du43cBa9.cjs');
2
+
3
+ //#region src/build/public-exports/babel.js
4
+ const scopedCSS = require_all.scopedCSS.babel;
5
+ scopedCSS.template = require_all.scopedCSS.template;
6
+
7
+ //#endregion
8
+ exports.scopedCSS = scopedCSS;
9
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFiZWwuY2pzIiwibmFtZXMiOlsiYWxsIl0sInNvdXJjZXMiOlsiLi4vLi4vc3JjL2J1aWxkL3B1YmxpYy1leHBvcnRzL2JhYmVsLmpzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHNjb3BlZENTUyBhcyBhbGwgfSBmcm9tICcuL2FsbC5qcyc7XG5cbmV4cG9ydCBjb25zdCBzY29wZWRDU1MgPSBhbGwuYmFiZWw7XG5cbnNjb3BlZENTUy50ZW1wbGF0ZSA9IGFsbC50ZW1wbGF0ZTtcbiJdLCJtYXBwaW5ncyI6Ijs7O0FBRUEsTUFBYSxZQUFZQSxzQkFBSTtBQUU3QixVQUFVLFdBQVdBLHNCQUFJIn0=
@@ -0,0 +1,8 @@
1
+ const require_all = require('./all-Du43cBa9.cjs');
2
+
3
+ //#region src/build/public-exports/rollup.js
4
+ const scopedCSS = require_all.scopedCSS.rollup;
5
+
6
+ //#endregion
7
+ exports.scopedCSS = scopedCSS;
8
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm9sbHVwLmNqcyIsIm5hbWVzIjpbImFsbCJdLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9idWlsZC9wdWJsaWMtZXhwb3J0cy9yb2xsdXAuanMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgc2NvcGVkQ1NTIGFzIGFsbCB9IGZyb20gJy4vYWxsLmpzJztcblxuZXhwb3J0IGNvbnN0IHNjb3BlZENTUyA9IGFsbC5yb2xsdXA7XG4iXSwibWFwcGluZ3MiOiI7OztBQUVBLE1BQWEsWUFBWUEsc0JBQUkifQ==
@@ -0,0 +1,8 @@
1
+ const require_all = require('./all-Du43cBa9.cjs');
2
+
3
+ //#region src/build/public-exports/vite.js
4
+ const scopedCSS = require_all.scopedCSS.vite;
5
+
6
+ //#endregion
7
+ exports.scopedCSS = scopedCSS;
8
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidml0ZS5janMiLCJuYW1lcyI6WyJhbGwiXSwic291cmNlcyI6WyIuLi8uLi9zcmMvYnVpbGQvcHVibGljLWV4cG9ydHMvdml0ZS5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBzY29wZWRDU1MgYXMgYWxsIH0gZnJvbSAnLi9hbGwuanMnO1xuXG5leHBvcnQgY29uc3Qgc2NvcGVkQ1NTID0gYWxsLnZpdGU7XG4iXSwibWFwcGluZ3MiOiI7OztBQUVBLE1BQWEsWUFBWUEsc0JBQUkifQ==
@@ -0,0 +1,11 @@
1
+ //#region src/runtime/index.d.ts
2
+ /**
3
+ * Appends a suffix to a class name during build time.
4
+ * This function is not available at runtime and is removed.
5
+ *
6
+ * @param className the class, defined within the co-located CSS to have a suffix appended to it during build time.
7
+ */
8
+ declare function scopedClass(className: string): string;
9
+ //#endregion
10
+ export { scopedClass };
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/runtime/index.ts"],"sourcesContent":[],"mappings":";;AAMA;;;;;iBAAgB,WAAA"}
@@ -1,10 +1,14 @@
1
- // src/runtime/index.ts
1
+ //#region src/runtime/index.ts
2
+ /**
3
+ * Appends a suffix to a class name during build time.
4
+ * This function is not available at runtime and is removed.
5
+ *
6
+ * @param className the class, defined within the co-located CSS to have a suffix appended to it during build time.
7
+ */
2
8
  function scopedClass(className) {
3
- throw new Error(
4
- `scopedClass is not available at runtime. Cannot do anything with ${className}. If you see this message, there could be two reasons: 1) No CSS file associated with this component, or 2) The build transforms are not installed.`
5
- );
9
+ throw new Error(`scopedClass is not available at runtime. Cannot do anything with ${className}. If you see this message, there could be two reasons: 1) No CSS file associated with this component, or 2) The build transforms are not installed.`);
6
10
  }
7
- export {
8
- scopedClass
9
- };
10
- //# sourceMappingURL=index.js.map
11
+
12
+ //#endregion
13
+ export { scopedClass };
14
+ //# sourceMappingURL=index.js.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/runtime/index.ts"],
4
- "sourcesContent": ["/**\n * Appends a suffix to a class name during build time.\n * This function is not available at runtime and is removed.\n *\n * @param {string} className the class, defined within the co-located CSS to have a suffix appended to it during build time.\n */\nexport function scopedClass(className: string): string {\n throw new Error(\n `scopedClass is not available at runtime. Cannot do anything with ${className}. If you see this message, there could be two reasons: 1) No CSS file associated with this component, or 2) The build transforms are not installed.`,\n );\n}\n"],
5
- "mappings": ";AAMO,SAAS,YAAY,WAA2B;AACrD,QAAM,IAAI;AAAA,IACR,oEAAoE,SAAS;AAAA,EAC/E;AACF;",
6
- "names": []
7
- }
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/runtime/index.ts"],"sourcesContent":["/**\n * Appends a suffix to a class name during build time.\n * This function is not available at runtime and is removed.\n *\n * @param className the class, defined within the co-located CSS to have a suffix appended to it during build time.\n */\nexport function scopedClass(className: string): string {\n throw new Error(\n `scopedClass is not available at runtime. Cannot do anything with ${className}. If you see this message, there could be two reasons: 1) No CSS file associated with this component, or 2) The build transforms are not installed.`,\n );\n}\n"],"mappings":";;;;;;;AAMA,SAAgB,YAAY,WAA2B;AACrD,OAAM,IAAI,MACR,oEAAoE,UAAU,qJAC/E"}
@@ -1,3 +1,4 @@
1
+ //#region src/runtime/test-support.d.ts
1
2
  /**
2
3
  * On element selectors where there are no classes,
3
4
  * you may pass only the modulePath and get the hash for the element.
@@ -25,7 +26,7 @@
25
26
  * and the path passed to `scopedClass` should be `<podModulePrefix>/bar`
26
27
  *
27
28
  */
28
- export declare function scopedClass(modulePath: string): string;
29
+ declare function scopedClass(modulePath: string): string;
29
30
  /**
30
31
  * Retrieve the built hash for a class.
31
32
  *
@@ -52,5 +53,7 @@ export declare function scopedClass(modulePath: string): string;
52
53
  * and the path passed to `scopedClass` should be `<podModulePrefix>/bar`
53
54
  *
54
55
  */
55
- export declare function scopedClass(className: string, modulePath: string): string;
56
+ declare function scopedClass(className: string, modulePath: string): string;
57
+ //#endregion
58
+ export { scopedClass };
56
59
  //# sourceMappingURL=test-support.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-support.d.ts","names":[],"sources":["../../src/runtime/test-support.ts"],"sourcesContent":[],"mappings":";;AA8BA;AA4BA;;;;;;;;;;;;;;;;;;;;;;;;;iBA5BgB,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4BA,WAAA"}