@tanstack/cta-engine 0.15.4 → 0.15.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/file-helpers.js +6 -0
- package/package.json +1 -1
- package/src/file-helpers.ts +7 -0
- package/tests/file-helper.test.ts +8 -0
package/dist/file-helpers.js
CHANGED
|
@@ -31,6 +31,12 @@ export function getBinaryFile(content) {
|
|
|
31
31
|
export function relativePath(from, to) {
|
|
32
32
|
const cleanedFrom = from.startsWith('./') ? from.slice(2) : from;
|
|
33
33
|
const cleanedTo = to.startsWith('./') ? to.slice(2) : to;
|
|
34
|
+
if (process.env.CTA_DEBUG) {
|
|
35
|
+
console.log('from', from);
|
|
36
|
+
console.log('to', to);
|
|
37
|
+
console.log('cleanedFrom', cleanedFrom);
|
|
38
|
+
console.log('cleanedTo', cleanedTo);
|
|
39
|
+
}
|
|
34
40
|
const fromSegments = cleanedFrom.split('/');
|
|
35
41
|
const toSegments = cleanedTo.split('/');
|
|
36
42
|
fromSegments.pop();
|
package/package.json
CHANGED
package/src/file-helpers.ts
CHANGED
|
@@ -40,6 +40,13 @@ export function relativePath(from: string, to: string) {
|
|
|
40
40
|
const cleanedFrom = from.startsWith('./') ? from.slice(2) : from
|
|
41
41
|
const cleanedTo = to.startsWith('./') ? to.slice(2) : to
|
|
42
42
|
|
|
43
|
+
if (process.env.CTA_DEBUG) {
|
|
44
|
+
console.log('from', from)
|
|
45
|
+
console.log('to', to)
|
|
46
|
+
console.log('cleanedFrom', cleanedFrom)
|
|
47
|
+
console.log('cleanedTo', cleanedTo)
|
|
48
|
+
}
|
|
49
|
+
|
|
43
50
|
const fromSegments = cleanedFrom.split('/')
|
|
44
51
|
const toSegments = cleanedTo.split('/')
|
|
45
52
|
|
|
@@ -47,6 +47,14 @@ describe('relativePath', () => {
|
|
|
47
47
|
),
|
|
48
48
|
).toBe('../integrations/tanstack-query/layout.tsx')
|
|
49
49
|
})
|
|
50
|
+
// it('windows', () => {
|
|
51
|
+
// expect(
|
|
52
|
+
// relativePath(
|
|
53
|
+
// 'c:\\test-app\\src\\main.tsx',
|
|
54
|
+
// 'src/integrations/tanstack-query/root-provider.tsx',
|
|
55
|
+
// ),
|
|
56
|
+
// ).toBe('./integrations/tanstack-query/root-provider.tsx')
|
|
57
|
+
// })
|
|
50
58
|
})
|
|
51
59
|
|
|
52
60
|
describe('readFileHelper', () => {
|