deepline 0.2.49 → 0.2.50
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/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +35 -7
- package/dist/bundling-sources/shared_libs/plays/enrich-compat-adapter.ts +21 -0
- package/dist/bundling-sources/shared_libs/plays/enrich-play-compiler.ts +1555 -0
- package/dist/bundling-sources/shared_libs/plays/user-code-safety.ts +61 -0
- package/dist/cli/index.js +7 -5
- package/dist/cli/index.mjs +10 -6
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/install-integrity.json +3 -0
- package/dist/plays/bundle-play-file.d.mts +2 -0
- package/dist/plays/bundle-play-file.d.ts +2 -0
- package/dist/plays/bundle-play-file.mjs +31 -6
- package/package.json +1 -1
|
@@ -160,7 +160,7 @@ export const SDK_RELEASE = {
|
|
|
160
160
|
// 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
|
|
161
161
|
// exposed storage-dependent synchronous access. This deliberate minor
|
|
162
162
|
// release keeps lazy paging semantics independent of row residency.
|
|
163
|
-
version: '0.2.
|
|
163
|
+
version: '0.2.50',
|
|
164
164
|
contracts: {
|
|
165
165
|
api: {
|
|
166
166
|
name: 'sdk-http-api',
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
join,
|
|
11
11
|
relative,
|
|
12
12
|
resolve,
|
|
13
|
+
sep,
|
|
13
14
|
} from 'node:path';
|
|
14
15
|
import { builtinModules } from 'node:module';
|
|
15
16
|
import { Parser } from 'acorn';
|
|
@@ -94,6 +95,8 @@ export type PlayLocalFileDiscoveryResult = {
|
|
|
94
95
|
|
|
95
96
|
export type PlayBundlingAdapter = {
|
|
96
97
|
projectRoot: string;
|
|
98
|
+
/** Optional root used only to make source-graph identity independent of temporary absolute paths. */
|
|
99
|
+
sourceIdentityRoot?: string;
|
|
97
100
|
nodeModulesDir: string;
|
|
98
101
|
cacheDir?: string;
|
|
99
102
|
sdkSourceRoot: string;
|
|
@@ -179,6 +182,24 @@ function sha256(value: string): string {
|
|
|
179
182
|
return createHash('sha256').update(value).digest('hex');
|
|
180
183
|
}
|
|
181
184
|
|
|
185
|
+
function sourceIdentityPath(
|
|
186
|
+
filePath: string,
|
|
187
|
+
adapter: PlayBundlingAdapter,
|
|
188
|
+
): string {
|
|
189
|
+
if (!adapter.sourceIdentityRoot) return filePath;
|
|
190
|
+
const identityRoot = resolve(adapter.sourceIdentityRoot);
|
|
191
|
+
const logicalPath = relative(identityRoot, resolve(filePath));
|
|
192
|
+
if (
|
|
193
|
+
!logicalPath ||
|
|
194
|
+
logicalPath === '..' ||
|
|
195
|
+
logicalPath.startsWith(`..${sep}`) ||
|
|
196
|
+
isAbsolute(logicalPath)
|
|
197
|
+
) {
|
|
198
|
+
return filePath;
|
|
199
|
+
}
|
|
200
|
+
return logicalPath.split(/[\\/]+/).join('/');
|
|
201
|
+
}
|
|
202
|
+
|
|
182
203
|
function formatEsbuildMessage(message: Message): string {
|
|
183
204
|
const location = message.location
|
|
184
205
|
? `${message.location.file}:${message.location.line}:${message.location.column}`
|
|
@@ -1598,9 +1619,12 @@ async function analyzeSourceGraph(
|
|
|
1598
1619
|
const sourceHash = sha256(sourceCode);
|
|
1599
1620
|
const graphHash = sha256(
|
|
1600
1621
|
JSON.stringify({
|
|
1601
|
-
entryFile: absoluteEntryFile,
|
|
1622
|
+
entryFile: sourceIdentityPath(absoluteEntryFile, adapter),
|
|
1602
1623
|
localFiles: [...localFiles.entries()]
|
|
1603
|
-
.map(([filePath, contents]) => ({
|
|
1624
|
+
.map(([filePath, contents]) => ({
|
|
1625
|
+
filePath: sourceIdentityPath(filePath, adapter),
|
|
1626
|
+
hash: sha256(contents),
|
|
1627
|
+
}))
|
|
1604
1628
|
.sort((left, right) => left.filePath.localeCompare(right.filePath)),
|
|
1605
1629
|
nodeBuiltins: [...nodeBuiltins].sort(),
|
|
1606
1630
|
packages: [...packages.entries()]
|
|
@@ -1608,7 +1632,7 @@ async function analyzeSourceGraph(
|
|
|
1608
1632
|
.sort((left, right) => left.name.localeCompare(right.name)),
|
|
1609
1633
|
importedPlayDependencies: [...importedPlayDependencies.values()]
|
|
1610
1634
|
.map((dependency) => ({
|
|
1611
|
-
filePath: dependency.filePath,
|
|
1635
|
+
filePath: sourceIdentityPath(dependency.filePath, adapter),
|
|
1612
1636
|
playName: dependency.playName,
|
|
1613
1637
|
}))
|
|
1614
1638
|
.sort((left, right) => left.filePath.localeCompare(right.filePath)),
|
|
@@ -1660,7 +1684,7 @@ function artifactCachePath(
|
|
|
1660
1684
|
adapter: PlayBundlingAdapter,
|
|
1661
1685
|
): string {
|
|
1662
1686
|
return join(
|
|
1663
|
-
adapter.cacheDir ?? PLAY_ARTIFACT_CACHE_DIR,
|
|
1687
|
+
/* turbopackIgnore: true */ adapter.cacheDir ?? PLAY_ARTIFACT_CACHE_DIR,
|
|
1664
1688
|
`${graphHash}.${artifactKind}.json`,
|
|
1665
1689
|
);
|
|
1666
1690
|
}
|
|
@@ -1672,7 +1696,11 @@ async function readArtifactCache(
|
|
|
1672
1696
|
): Promise<PlayBundleArtifact | null> {
|
|
1673
1697
|
try {
|
|
1674
1698
|
const serialized = await readFile(
|
|
1675
|
-
artifactCachePath(
|
|
1699
|
+
/* turbopackIgnore: true */ artifactCachePath(
|
|
1700
|
+
graphHash,
|
|
1701
|
+
artifactKind,
|
|
1702
|
+
adapter,
|
|
1703
|
+
),
|
|
1676
1704
|
'utf-8',
|
|
1677
1705
|
);
|
|
1678
1706
|
return JSON.parse(serialized) as PlayBundleArtifact;
|
|
@@ -1686,9 +1714,9 @@ async function writeArtifactCache(
|
|
|
1686
1714
|
adapter: PlayBundlingAdapter,
|
|
1687
1715
|
): Promise<void> {
|
|
1688
1716
|
const cacheDir = adapter.cacheDir ?? PLAY_ARTIFACT_CACHE_DIR;
|
|
1689
|
-
await mkdir(cacheDir, { recursive: true });
|
|
1717
|
+
await mkdir(/* turbopackIgnore: true */ cacheDir, { recursive: true });
|
|
1690
1718
|
await writeFile(
|
|
1691
|
-
artifactCachePath(
|
|
1719
|
+
/* turbopackIgnore: true */ artifactCachePath(
|
|
1692
1720
|
artifact.graphHash,
|
|
1693
1721
|
artifact.artifactKind ?? PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
1694
1722
|
adapter,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const ENRICH_COMPAT_DEFAULT_PLAY_NAME = 'deepline-enrich-v1-compat';
|
|
2
|
+
export const ENRICH_COMPAT_DEFAULT_MAP_NAME = 'deepline_enrich_rows';
|
|
3
|
+
|
|
4
|
+
export type EnrichCompatibilityOptions = {
|
|
5
|
+
playName?: string;
|
|
6
|
+
mapName?: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type EnrichCompatibilityPlan = {
|
|
10
|
+
playName: string;
|
|
11
|
+
mapName: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export function buildEnrichCompatibilityPlan(
|
|
15
|
+
options: EnrichCompatibilityOptions = {},
|
|
16
|
+
): EnrichCompatibilityPlan {
|
|
17
|
+
return {
|
|
18
|
+
playName: options.playName?.trim() || ENRICH_COMPAT_DEFAULT_PLAY_NAME,
|
|
19
|
+
mapName: options.mapName?.trim() || ENRICH_COMPAT_DEFAULT_MAP_NAME,
|
|
20
|
+
};
|
|
21
|
+
}
|