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
@@ -3,11 +3,40 @@ import fsSync, { existsSync } from 'node:fs';
3
3
  import { createRequire } from 'node:module';
4
4
  import path from 'node:path';
5
5
 
6
+ import { barePath, leadingSlashPath } from './const.js';
6
7
  import { hashFromAbsolutePath } from './hash-from-absolute-path.js';
7
- import { hashFromModulePath } from './hash-from-module-path.js';
8
+ import { hashFromModulePath as hashPosixModulePath } from './hash-from-module-path.js';
8
9
 
9
10
  export { hashFromAbsolutePath } from './hash-from-absolute-path.js';
10
- export { hashFromModulePath } from './hash-from-module-path.js';
11
+
12
+ /**
13
+ *
14
+ * @param {string} filePath
15
+ * @returns {string}
16
+ */
17
+ export function hashFromModulePath(filePath) {
18
+ let posixPath = forcePosix(filePath);
19
+
20
+ return hashPosixModulePath(posixPath);
21
+ }
22
+
23
+ /**
24
+ * @param {string} filePath
25
+ */
26
+ export function forcePosix(filePath) {
27
+ const parsed = path.parse(filePath);
28
+
29
+ if (parsed.root === '') {
30
+ return filePath.replaceAll(path.win32.sep, path.posix.sep);
31
+ }
32
+
33
+ let rootless = filePath.replace(
34
+ new RegExp(`^${RegExp.escape(parsed.root)}`),
35
+ path.posix.sep,
36
+ );
37
+
38
+ return rootless.replaceAll(path.win32.sep, path.posix.sep);
39
+ }
11
40
 
12
41
  const COMPONENT_EXTENSIONS = ['.gts', '.gjs', '.ts', '.js', '.hbs'];
13
42
 
@@ -21,7 +50,7 @@ if (!ourRequire) {
21
50
  ourRequire = require;
22
51
  }
23
52
 
24
- const IRRELEVANT_PATHS = ['node_modules/.pnpm', '__vite-'];
53
+ const IRRELEVANT_PATHS = [barePath.pnpmDir, '__vite-'];
25
54
  const UNSUPPORTED_DIRECTORIES = new Set(['tests']);
26
55
 
27
56
  const CWD = process.cwd();
@@ -34,7 +63,7 @@ const CWD = process.cwd();
34
63
  * @returns
35
64
  */
36
65
  export function hashFrom(filePath) {
37
- if (filePath.startsWith('/')) {
66
+ if (path.isAbsolute(filePath)) {
38
67
  return hashFromAbsolutePath(filePath);
39
68
  }
40
69
 
@@ -133,7 +162,7 @@ export function cssPathFor(fileName) {
133
162
  * @param {string} filePath
134
163
  */
135
164
  export function isPodTemplate(filePath) {
136
- if (filePath.includes('/components/')) {
165
+ if (filePath.includes(leadingSlashPath.componentsDir)) {
137
166
  return false;
138
167
  }
139
168
 
@@ -152,7 +181,7 @@ export function isPodTemplate(filePath) {
152
181
  * @param {string} filePath
153
182
  */
154
183
  export function isPod(filePath) {
155
- if (filePath.includes('/components/')) {
184
+ if (filePath.includes(leadingSlashPath.componentsDir)) {
156
185
  return false;
157
186
  }
158
187
 
@@ -186,13 +215,17 @@ export function withoutExtension(filePath) {
186
215
  */
187
216
  export function isRelevantFile(fileName, { additionalRoots, cwd }) {
188
217
  // Fake file handled by testem server when it runs
189
- if (fileName.startsWith('/testem')) return false;
218
+ if (fileName.startsWith(leadingSlashPath.testem)) return false;
190
219
  // Private Virtual Modules
191
220
  if (fileName.startsWith('\0')) return false;
221
+
192
222
  // These are not valid userland names (or are from libraries)
193
- if (fileName.match(/^[a-zA-Z]/)) return false;
223
+ if (path.isAbsolute(fileName) === false) {
224
+ if (fileName.match(/^[a-zA-Z]/)) return false;
225
+ }
226
+
194
227
  // External to us
195
- if (fileName.startsWith('/@embroider')) return false;
228
+ if (fileName.startsWith(leadingSlashPath.atEmbroider)) return false;
196
229
  if (IRRELEVANT_PATHS.some((i) => fileName.includes(i))) return false;
197
230
 
198
231
  let workspace = findWorkspacePath(fileName);
@@ -206,7 +239,7 @@ export function isRelevantFile(fileName, { additionalRoots, cwd }) {
206
239
  }
207
240
 
208
241
  let local = fileName.replace(workspace, '');
209
- let [, ...parts] = local.split('/').filter(Boolean);
242
+ let [, ...parts] = local.split(path.sep).filter(Boolean);
210
243
 
211
244
  if (UNSUPPORTED_DIRECTORIES.has(parts[0])) {
212
245
  return false;
@@ -216,7 +249,11 @@ export function isRelevantFile(fileName, { additionalRoots, cwd }) {
216
249
  * Mostly pods support.
217
250
  * folks need to opt in to pods (routes), because every pods app can be configured differently
218
251
  */
219
- let roots = ['/components/', '/templates/', ...(additionalRoots || [])];
252
+ let roots = [
253
+ leadingSlashPath.componentsDir,
254
+ leadingSlashPath.templatesDir,
255
+ ...(additionalRoots || []),
256
+ ];
220
257
 
221
258
  if (!roots.some((root) => fileName.includes(root))) {
222
259
  return;
@@ -239,7 +276,10 @@ export function packageScopedPathToModulePath(packageScopedPath) {
239
276
  * If we need further customizations, we'll want to match on `exports` in the
240
277
  * corresponding package.json
241
278
  */
242
- let packageRelative = packageScopedPath.replace(/^\/src\//, '/');
279
+ let packageRelative = packageScopedPath.replace(
280
+ new RegExp(`^${RegExp.escape(leadingSlashPath.src)}`),
281
+ path.sep,
282
+ );
243
283
 
244
284
  let parsed = path.parse(packageRelative);
245
285
 
@@ -286,10 +326,10 @@ export function appPath(sourcePath) {
286
326
  /**
287
327
  * But we also don't want 'app' -- which is present in the v1 addon pipeline
288
328
  */
289
- packageRelative = packageRelative.replace(`/app/`, `/`);
329
+ packageRelative = packageRelative.replace(leadingSlashPath.app, path.sep);
290
330
 
291
331
  // Any of the above relpacements could accidentally give us an extra / (depending on our build environment)
292
- packageRelative = packageRelative.replace('//', '/');
332
+ packageRelative = path.normalize(packageRelative);
293
333
 
294
334
  let localPackagerStylePath = packageScopedPathToModulePath(packageRelative);
295
335
 
@@ -307,10 +347,10 @@ const SEEN = new Set();
307
347
  function getSeen(sourcePath) {
308
348
  if (SEEN.has(sourcePath)) return sourcePath;
309
349
 
310
- let parts = sourcePath.split('/');
350
+ let parts = sourcePath.split(path.sep);
311
351
 
312
352
  for (let i = parts.length - 1; i > 1; i--) {
313
- let toCheck = parts.slice(0, i).join('/');
353
+ let toCheck = parts.slice(0, i).join(path.sep);
314
354
 
315
355
  let seen = SEEN.has(toCheck);
316
356
 
@@ -323,8 +363,11 @@ function getSeen(sourcePath) {
323
363
  export function findWorkspacePath(sourcePath, options) {
324
364
  let cwd = options?.cwd ?? CWD;
325
365
 
326
- if (sourcePath.endsWith('/')) {
327
- sourcePath = sourcePath.replace(/\/$/, '');
366
+ if (sourcePath.endsWith(path.sep)) {
367
+ sourcePath = sourcePath.replace(
368
+ new RegExp(`${RegExp.escape(path.sep)}$`),
369
+ '',
370
+ );
328
371
  }
329
372
 
330
373
  let seen = getSeen(sourcePath);
@@ -356,10 +399,10 @@ export function findWorkspacePath(sourcePath, options) {
356
399
 
357
400
  function findPackageJsonUp(startPath, options) {
358
401
  let cwd = options?.cwd ?? CWD;
359
- let parts = startPath.split('/');
402
+ let parts = startPath.split(path.sep);
360
403
 
361
404
  for (let i = parts.length - 1; i > 1; i--) {
362
- let toCheck = parts.slice(0, i).join('/');
405
+ let toCheck = parts.slice(0, i).join(path.sep);
363
406
 
364
407
  let packageJson = path.join(toCheck, 'package.json');
365
408
  let exists = fsSync.existsSync(packageJson);
@@ -1,40 +1,65 @@
1
- const key = 'styles.ember-scoped.css';
2
- const separator = '____';
1
+ import path from 'node:path';
3
2
 
4
- function parse(request) {
5
- let [left, qps] = request.split('?');
6
- let [relativePostfix, cssId] = left.split(separator);
7
- let postfix = relativePostfix.slice(2);
3
+ const KEY = 'ember-scoped.css';
4
+ const SEP = '___';
8
5
 
9
- let search = new URLSearchParams(qps);
6
+ export const request = {
7
+ is: {
8
+ inline(request) {
9
+ return request.includes(KEY);
10
+ },
11
+ colocated(request) {
12
+ return request.includes('.css?scoped=');
13
+ },
14
+ },
15
+ inline: {
16
+ /**
17
+ * Makes request URL for embedding `<style>` as `<link>` into the `<head>`
18
+ *
19
+ * @param {string} cssHash the hash of the CSS contents
20
+ * @param {string} postfix the hash of the file that _includes_ the linked file
21
+ * @param {string} cssContents the contents of the CSS file
22
+ */
23
+ create(cssHash, postfix, cssContents) {
24
+ return `./${postfix}${SEP}${cssHash}.${KEY}?css=${encodeURIComponent(cssContents)}`;
25
+ },
26
+ decode(request) {
27
+ let [left, qps] = request.split('?');
10
28
 
11
- return {
12
- from: postfix,
13
- css: search.get('css'),
14
- cssId,
15
- };
16
- }
29
+ left = left.slice(2).replace(`.${KEY}`, '');
17
30
 
18
- export function isScopedCSSRequest(request) {
19
- let [, , stuff] = request.split(separator);
31
+ let [postfix, hash] = left.split(SEP);
20
32
 
21
- if (!stuff) return false;
33
+ let search = new URLSearchParams(qps);
22
34
 
23
- let [k] = stuff.split('?');
35
+ return {
36
+ hash,
37
+ postfix,
38
+ css: search.get('css'),
39
+ from: search.get('from'),
40
+ };
41
+ },
42
+ },
43
+ colocated: {
44
+ /**
45
+ * Makes request URL for embedding separate CSS File as `<link>` into the `<head>`
46
+ *
47
+ * @param {string} cssHash the hash of the CSS contents
48
+ * @param {string} postfix the hash of the file that _includes_ the linked file
49
+ * @param {string} filePath path to the separate CSS File
50
+ */
51
+ create(cssHash, postfix, filePath) {
52
+ return `./${path.basename(filePath)}?scoped=${postfix}&cssHash=${cssHash}`;
53
+ },
54
+ decode(request) {
55
+ const [fileName, qs] = request.split('?');
56
+ const search = new URLSearchParams(qs);
24
57
 
25
- return k === key;
26
- }
27
-
28
- export function decodeScopedCSSRequest(request) {
29
- let params = parse(request);
30
-
31
- return {
32
- postfix: params.from,
33
- css: params.css,
34
- cssId: params.cssId,
35
- };
36
- }
37
-
38
- export function makeRequest(postfix, cssId, cssContent) {
39
- return `./${postfix}${separator}${cssId}${separator}${key}?css=${encodeURIComponent(cssContent)}`;
40
- }
58
+ return {
59
+ fileName,
60
+ cssHash: search.get('cssHash'),
61
+ postfix: search.get('scoped'),
62
+ };
63
+ },
64
+ },
65
+ };
@@ -2,7 +2,7 @@
2
2
  * Appends a suffix to a class name during build time.
3
3
  * This function is not available at runtime and is removed.
4
4
  *
5
- * @param {string} className the class, defined within the co-located CSS to have a suffix appended to it during build time.
5
+ * @param className the class, defined within the co-located CSS to have a suffix appended to it during build time.
6
6
  */
7
7
  export function scopedClass(className: string): string {
8
8
  throw new Error(
@@ -1,7 +0,0 @@
1
- /**
2
- * @returns {ASTPlugin}
3
- */
4
- export function createPlugin(config: any): ASTPlugin;
5
- export type ASTPlugin = any;
6
- export type ASTPluginEnvironment = any;
7
- //# sourceMappingURL=template-plugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"template-plugin.d.ts","sourceRoot":"","sources":["../../src/build/template-plugin.js"],"names":[],"mappings":"AAuBA;;GAEG;AACH,2CAFa,SAAS,CAmLrB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=template-plugin.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"template-plugin.test.d.ts","sourceRoot":"","sources":["../../src/build/template-plugin.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export function rewriteCss(css: any, postfix: any, fileName: any, layerName: any): string;
2
- //# sourceMappingURL=rewrite.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rewrite.d.ts","sourceRoot":"","sources":["../../../src/lib/css/rewrite.js"],"names":[],"mappings":"AAsFA,0FA8GC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=rewrite.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rewrite.test.d.ts","sourceRoot":"","sources":["../../../src/lib/css/rewrite.test.ts"],"names":[],"mappings":""}
@@ -1,29 +0,0 @@
1
- /**
2
- * @param {string} css
3
- * @return {string} hashed down version of the CSS for disambiguating
4
- */
5
- export function hash(css: string): string;
6
- export function isInsideGlobal(node: any, func: any): boolean;
7
- /**
8
- * @param {string} cssPath path to a CSS file
9
- */
10
- export function getCSSInfo(cssPath: string): {
11
- classes: Set<string>;
12
- tags: Set<string>;
13
- css: string;
14
- id: string;
15
- } | null;
16
- /**
17
- * We use this function to check each class used in the template
18
- * to see if we need to leave it alone or transform it
19
- *
20
- * @param {string} css the CSS's contents
21
- * @return {{ classes: Set<string>, tags: Set<string>, css: string, id: string }}
22
- */
23
- export function getCSSContentInfo(css: string): {
24
- classes: Set<string>;
25
- tags: Set<string>;
26
- css: string;
27
- id: string;
28
- };
29
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/css/utils.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH,0BAHW,MAAM,GACL,MAAM,CAIjB;AAED,8DAOC;AAED;;GAEG;AACH,oCAFW,MAAM;aAiBM,GAAG,CAAC,MAAM,CAAC;UAAQ,GAAG,CAAC,MAAM,CAAC;SAAO,MAAM;QAAM,MAAM;SAP7E;AAED;;;;;;GAMG;AACH,uCAHW,MAAM,GACL;IAAE,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAiB/E"}
@@ -1,3 +0,0 @@
1
- export function hashFromAbsolutePath(absolutePath: any): string;
2
- export { hash } from "./hash-from-module-path.js";
3
- //# sourceMappingURL=hash-from-absolute-path.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hash-from-absolute-path.d.ts","sourceRoot":"","sources":["../../../src/lib/path/hash-from-absolute-path.js"],"names":[],"mappings":"AAKA,gEAUC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=hash-from-absolute-path.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hash-from-absolute-path.test.d.ts","sourceRoot":"","sources":["../../../src/lib/path/hash-from-absolute-path.test.ts"],"names":[],"mappings":""}
@@ -1,31 +0,0 @@
1
- /**
2
- * The intent of this function is to generate the suffix/postfix for the
3
- * css classes, based on the module-scoped path name.
4
- *
5
- * for example,
6
- * hash('my-app/components/foo')
7
- * instead of
8
- * hash('app/components/foo')
9
- *
10
- * (unless your app name is 'app')
11
- *
12
- * @param {string} modulePath
13
- * @returns {string}
14
- */
15
- export function hash(modulePath: string): string;
16
- /**
17
- * The intent of this function is to generate the suffix/postfix for the
18
- * css classes, based on the module-scoped path name.
19
- *
20
- * for example,
21
- * hash('my-app/components/foo')
22
- * instead of
23
- * hash('app/components/foo')
24
- *
25
- * (unless your app name is 'app')
26
- *
27
- * @param {string} modulePath
28
- * @returns {string}
29
- */
30
- export function hashFromModulePath(modulePath: string): string;
31
- //# sourceMappingURL=hash-from-module-path.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hash-from-module-path.d.ts","sourceRoot":"","sources":["../../../src/lib/path/hash-from-module-path.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,iCAHW,MAAM,GACJ,MAAM,CAIlB;AAhBD;;;;;;;;;;;;;GAaG;AACH,+CAHW,MAAM,GACJ,MAAM,CAIlB"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Calculates MD5 value for a given string.
3
- * If a key is provided, calculates the HMAC-MD5 value.
4
- * Returns a Hex encoded string unless the raw argument is given.
5
- *
6
- * @param {string} string Input string
7
- * @param {string} [key] HMAC key
8
- * @param {boolean} [raw] Raw output switch
9
- * @returns {string} MD5 output
10
- */
11
- export function md5(string: string, key?: string, raw?: boolean): string;
12
- //# sourceMappingURL=md5.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"md5.d.ts","sourceRoot":"","sources":["../../../src/lib/path/md5.js"],"names":[],"mappings":"AAkYA;;;;;;;;;GASG;AACH,4BALW,MAAM,QACN,MAAM,QACN,OAAO,GACL,MAAM,CAgBlB"}
@@ -1,11 +0,0 @@
1
- /**
2
- * template plugins do not hand us the correct file path.
3
- * additionally, we may not be able to rely on this data in the future,
4
- * so this functions acts as a means of normalizing _whatever_ we're given
5
- * in the future.
6
- *
7
- * @param {string} filename
8
- * @returns {string} the absolute path to the file
9
- */
10
- export function fixFilename(filename: string): string;
11
- //# sourceMappingURL=template-transform-paths.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"template-transform-paths.d.ts","sourceRoot":"","sources":["../../../src/lib/path/template-transform-paths.js"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,sCAHW,MAAM,GACJ,MAAM,CAqDlB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=template-transform-paths.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"template-transform-paths.test.d.ts","sourceRoot":"","sources":["../../../src/lib/path/template-transform-paths.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=utils.appPath.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.appPath.test.d.ts","sourceRoot":"","sources":["../../../src/lib/path/utils.appPath.test.ts"],"names":[],"mappings":""}
@@ -1,94 +0,0 @@
1
- /**
2
- * Regardless of what the filePath format is,
3
- * this will try to return the correct postfix.
4
- *
5
- * @param {string} filePath
6
- * @returns
7
- */
8
- export function hashFrom(filePath: string): string;
9
- /**
10
- *
11
- */
12
- export function cssHasAssociatedComponent(cssPath: any): boolean | undefined;
13
- /**
14
- * Based on ember's component location conventions,
15
- * this function will provide a path for where we
16
- * expect the CSS to live.
17
- *
18
- * For co-located structure:
19
- * - components/my-component.hbs
20
- * - components/my-component.css
21
- *
22
- * For nested co-located structure
23
- * - components/my-component/foo.hbs
24
- * - components/my-component/foo.css
25
- *
26
- * For Pods routes structure
27
- * - routes/my-route/template.{hbs,js}
28
- * - routes/my-route/styles.css
29
- *
30
- * Deliberately not supported:
31
- * - components w/ pods -- this is deprecated in 5.10
32
- *
33
- * @param {string} fileName - the hbs, js, gjs, gts or whatever co-located path.
34
- * @returns {string} - expected css path
35
- */
36
- export function cssPathFor(fileName: string): string;
37
- /**
38
- * Note that components in the "pods" convention will
39
- * never be supported.
40
- *
41
- * @param {string} filePath
42
- */
43
- export function isPodTemplate(filePath: string): boolean;
44
- /**
45
- * Note that components in the "pods" convention will
46
- * never be supported.
47
- *
48
- * Checks if a file ends with
49
- * - template.js
50
- * - template.hbs
51
- * - styles.css
52
- *
53
- * @param {string} filePath
54
- */
55
- export function isPod(filePath: string): boolean;
56
- /**
57
- *
58
- * @param {string} filePath
59
- * @returns the same path, but without the extension
60
- */
61
- export function withoutExtension(filePath: string): string;
62
- /**
63
- * Examples for fileName
64
- * - absolute on-disk path
65
- * - in webpack
66
- * - URL-absolute path, starting with /
67
- *
68
- * @param {string} fileName
69
- * @param {{ additionalRoots?: string[]; cwd: string }} options
70
- * @returns
71
- */
72
- export function isRelevantFile(fileName: string, { additionalRoots, cwd }: {
73
- additionalRoots?: string[];
74
- cwd: string;
75
- }): boolean | undefined;
76
- export function packageScopedPathToModulePath(packageScopedPath: any): string;
77
- /**
78
- * returns the app-module path of the source file
79
- *
80
- * This assumes normal ember app conventions
81
- *
82
- * which is `<package.json#name>/path-to-file`
83
- */
84
- export function appPath(sourcePath: any): string;
85
- export function findWorkspacePath(sourcePath: any, options: any): any;
86
- /**
87
- * Will return the package.json#name, or config/environment#moudlePrefix (if v1 app)
88
- *
89
- * @param {string} sourcePath
90
- */
91
- export function moduleName(sourcePath: string): any;
92
- export { hashFromAbsolutePath } from "./hash-from-absolute-path.js";
93
- export { hashFromModulePath } from "./hash-from-module-path.js";
94
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/path/utils.js"],"names":[],"mappings":"AA4BA;;;;;;GAMG;AACH,mCAHW,MAAM,UAShB;AAED;;GAEG;AACH,6EAEC;AA4CD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qCAHW,MAAM,GACJ,MAAM,CAalB;AAED;;;;;GAKG;AACH,wCAFW,MAAM,WAQhB;AAED;;;;;;;;;;GAUG;AACH,gCAFW,MAAM,WAYhB;AAED;;;;GAIG;AACH,2CAHW,MAAM,UAOhB;AAED;;;;;;;;;GASG;AACH,yCAJW,MAAM,4BACN;IAAE,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,uBA0CrD;AAED,8EAsCC;AAED;;;;;;GAMG;AACH,iDAsBC;AA0BD,sEAgCC;AA2BD;;;;GAIG;AACH,uCAFW,MAAM,OAOhB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=utils.findWorkspacePath.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.findWorkspacePath.test.d.ts","sourceRoot":"","sources":["../../../src/lib/path/utils.findWorkspacePath.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=utils.hashFrom.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.hashFrom.test.d.ts","sourceRoot":"","sources":["../../../src/lib/path/utils.hashFrom.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=utils.isRelevantFile.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.isRelevantFile.test.d.ts","sourceRoot":"","sources":["../../../src/lib/path/utils.isRelevantFile.test.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- export declare const paths: {
2
- v2Addon: string;
3
- viteApp: string;
4
- };
5
- //# sourceMappingURL=utils.paths.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.paths.test.d.ts","sourceRoot":"","sources":["../../../src/lib/path/utils.paths.test.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,KAAK;;;CAGjB,CAAC"}
@@ -1,9 +0,0 @@
1
- /**
2
- *
3
- * @param {string} className
4
- * @param {string} postfix
5
- * @param {Set<string>} [classesInCss]
6
- * @returns
7
- */
8
- export function renameClass(className: string, postfix: string, classesInCss?: Set<string>): string;
9
- //# sourceMappingURL=renameClass.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renameClass.d.ts","sourceRoot":"","sources":["../../src/lib/renameClass.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,uCALW,MAAM,WACN,MAAM,iBACN,GAAG,CAAC,MAAM,CAAC,UAyBrB"}
@@ -1,8 +0,0 @@
1
- export function isScopedCSSRequest(request: any): boolean;
2
- export function decodeScopedCSSRequest(request: any): {
3
- postfix: any;
4
- css: string | null;
5
- cssId: any;
6
- };
7
- export function makeRequest(postfix: any, cssId: any, cssContent: any): string;
8
- //# sourceMappingURL=request.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/lib/request.js"],"names":[],"mappings":"AAiBA,0DAQC;AAED;;;;EAQC;AAED,+EAEC"}
@@ -1,17 +0,0 @@
1
- export function templatePlugin({ classes, tags, postfix }: {
2
- classes: any;
3
- tags: any;
4
- postfix: any;
5
- }): {
6
- AttrNode(node: any): void;
7
- ElementNode(node: any): void;
8
- All: {
9
- enter(node: any): void;
10
- exit(): void;
11
- };
12
- MustacheStatement(node: any): recast.AST.TextNode | undefined;
13
- SubExpression(node: any): recast.AST.Literal | undefined;
14
- };
15
- export default function rewriteHbs(hbs: any, classes: any, tags: any, postfix: any): string;
16
- import recast from 'ember-template-recast';
17
- //# sourceMappingURL=rewriteHbs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rewriteHbs.d.ts","sourceRoot":"","sources":["../../src/lib/rewriteHbs.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;EAmHC;AAgBD,4FAQC;mBA/IkB,uBAAuB"}