@teleporthq/teleport-plugin-next-data-source 0.43.60 → 0.43.62
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/cjs/cache/ast.d.ts.map +1 -1
- package/dist/cjs/cache/ast.js +2 -2
- package/dist/cjs/cache/ast.js.map +1 -1
- package/dist/cjs/pagination-plugin.js +2 -4
- package/dist/cjs/pagination-plugin.js.map +1 -1
- package/dist/cjs/transformations/blog-post.d.ts.map +1 -1
- package/dist/cjs/transformations/blog-post.js +1 -1
- package/dist/cjs/transformations/blog-post.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/cjs/utils.d.ts.map +1 -1
- package/dist/cjs/utils.js +5 -7
- package/dist/cjs/utils.js.map +1 -1
- package/dist/esm/cache/ast.d.ts.map +1 -1
- package/dist/esm/cache/ast.js +2 -2
- package/dist/esm/cache/ast.js.map +1 -1
- package/dist/esm/pagination-plugin.js +3 -5
- package/dist/esm/pagination-plugin.js.map +1 -1
- package/dist/esm/transformations/blog-post.d.ts.map +1 -1
- package/dist/esm/transformations/blog-post.js +1 -1
- package/dist/esm/transformations/blog-post.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/utils.d.ts.map +1 -1
- package/dist/esm/utils.js +6 -8
- package/dist/esm/utils.js.map +1 -1
- package/package.json +5 -5
- package/src/cache/ast.ts +2 -2
- package/src/pagination-plugin.ts +3 -5
- package/src/transformations/blog-post.ts +29 -0
- package/src/utils.ts +6 -8
package/src/utils.ts
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from '@teleporthq/teleport-types'
|
|
11
11
|
import * as types from '@babel/types'
|
|
12
12
|
import { ASTUtils } from '@teleporthq/teleport-plugin-common'
|
|
13
|
-
import { StringUtils } from '@teleporthq/teleport-shared'
|
|
13
|
+
import { GenericUtils, StringUtils } from '@teleporthq/teleport-shared'
|
|
14
14
|
import { generateDataSourceFetcherWithCore } from './data-source-fetchers'
|
|
15
15
|
import type { EcommerceProductTransformOptions } from './transformations'
|
|
16
16
|
import { DATA_SOURCE_ISR_REVALIDATE_SECONDS } from './isr'
|
|
@@ -1253,13 +1253,11 @@ export const extractDataSourceIntoGetStaticProps = (
|
|
|
1253
1253
|
|
|
1254
1254
|
// Add dependency for the fetcher
|
|
1255
1255
|
const fetcherImportName = StringUtils.dashCaseToCamelCase(fileName)
|
|
1256
|
-
//
|
|
1257
|
-
//
|
|
1258
|
-
//
|
|
1259
|
-
//
|
|
1260
|
-
|
|
1261
|
-
const depth = (folderPath ? folderPath.length : 0) + 1
|
|
1262
|
-
const relativePrefix = '../'.repeat(depth)
|
|
1256
|
+
// Relative path from the page back to the project root. `folderPath` holds
|
|
1257
|
+
// the subfolders WITHIN pages/ (e.g. ['admin'] for pages/admin/X.js), so
|
|
1258
|
+
// the pages/ folder itself has to be counted too — which is exactly what
|
|
1259
|
+
// the shared helper does (see `generatePageDependenciesPrefix`).
|
|
1260
|
+
const relativePrefix = GenericUtils.generatePageToRootPrefix({ folderPath })
|
|
1263
1261
|
dependencies[fetcherImportName] = {
|
|
1264
1262
|
type: 'local',
|
|
1265
1263
|
path: `${relativePrefix}utils/data-sources/${fileName}`,
|