Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/dev-console-browser-aliases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@osdk/aliases": minor
"@osdk/functions": minor
---

Add `@osdk/aliases`, extracting the alias runtime so consumers that are not Functions can read aliases without depending on `@osdk/functions`. The `Aliases` namespace exported by `@osdk/functions` is unchanged.

`@osdk/aliases/experimental` is a new browser-safe entry point for applications served to a browser, such as Developer Console apps: call `await Aliases.initAliases()` once at startup, then read values synchronously with `Aliases.custom("myAlias")`. It reads the installer's resolved values on a Marketplace-installed site and falls back to the author's declared defaults in `public/resources.json` otherwise. It sits behind the `experimental` subpath because both custom aliases and the shape of this API are provisional.

`@osdk/aliases/node` is the existing filesystem-backed runtime for code running in Node.
18 changes: 15 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
- main
- release/*
- next
# TEMPORARY: publish snapshots from this branch for stack testing. Revert
# this line (and the `always()` on the snapshot job below) before merging.
- jzhang/dev-console-aliases

concurrency: ${{ github.workflow }}-${{ github.ref }}

Expand Down Expand Up @@ -50,8 +53,14 @@ jobs:
snapshot:
name: Snapshot
needs: release
if: ${{ !failure() && !cancelled() }}
# `always()` is required: on a non-release branch the `release` job is
# skipped by its own `if`, and a skipped dependency skips this job too
# unless the condition forces evaluation. TEMPORARY, revert with the branch
# trigger above.
if: ${{ always() && !failure() && !cancelled() }}
runs-on: ubuntu-latest
# TEMPORARY: fail fast instead of hanging for an hour. Revert with the rest.
timeout-minutes: 25
permissions:
contents: read
id-token: write
Expand All @@ -76,7 +85,9 @@ jobs:
run: pnpm exec turbo run build

- name: Update versions for snapshots
run: pnpm exec changeset version --snapshot ${GITHUB_REF_NAME//\//__}
# TEMPORARY: fixed tag, matching the previously-working branch-snapshot
# hack. The ref-derived name contains a slash on this branch. Revert.
run: pnpm exec changeset version --snapshot pr-jzhang

- name: Make sure code is up to date
run: pnpm exec turbo run postVersioning
Expand All @@ -85,4 +96,5 @@ jobs:
run: pnpm exec turbo run build

- name: Publish results
run: pnpm exec changeset publish --no-git-tag --tag next-${GITHUB_REF_NAME//\//__}
# TEMPORARY: fixed tag, see above. Revert.
run: pnpm exec changeset publish --no-git-tag --tag pr-jzhang
1 change: 1 addition & 0 deletions .lintstagedrc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const OXC_PACKAGE_GLOB = `packages/{${
* at that nested config instead of the root one. Map of package dir -> config.
*/
const OXC_NESTED_CONFIG_PACKAGES = {
"aliases": "packages/aliases/oxlint.config.ts",
"react-components-storybook":
"packages/react-components-storybook/oxlint.config.ts",
"react-components": "packages/react-components/oxlint.config.ts",
Expand Down
1 change: 1 addition & 0 deletions .monorepolint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ const archetypeRules = archetypes(standardPackageRules, {
.addArchetype(
"oxc migrated libraries with carve-outs",
[
"@osdk/aliases",
"@osdk/maker",
"@osdk/maker-experimental",
"@osdk/maker-import",
Expand Down
65 changes: 12 additions & 53 deletions etc/functions.report.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,22 @@ import type { ActionDefinition } from '@osdk/client';
import { Attachment } from '@osdk/client';
import type { Client } from '@osdk/client';
import type { CompileTimeMetadata } from '@osdk/client';
import { Custom } from '@osdk/aliases/node';
import { custom } from '@osdk/aliases/node';
import { Dataset } from '@osdk/aliases/node';
import { dataset } from '@osdk/aliases/node';
import { Geometry } from 'geojson';
import { GeometryCollection } from 'geojson';
import type { GroupId as GroupId_2 } from '@osdk/foundry.core';
import type { InterfaceDefinition } from '@osdk/client';
import { LineString } from 'geojson';
import type { Media } from '@osdk/client';
import { MediaReference } from '@osdk/client';
import { Mediaset } from '@osdk/aliases/node';
import { mediaset } from '@osdk/aliases/node';
import { MediaUpload } from '@osdk/client';
import { Model } from '@osdk/aliases/node';
import { model } from '@osdk/aliases/node';
import { MultiLineString } from 'geojson';
import { MultiPoint } from 'geojson';
import { MultiPolygon } from 'geojson';
Expand All @@ -28,6 +36,10 @@ import { Polygon } from 'geojson';
import type { PropertyKeys } from '@osdk/client';
import type { QueryDefinition } from '@osdk/client';
import { Range as Range_2 } from '@osdk/client';
import { Source } from '@osdk/aliases/node';
import { source } from '@osdk/aliases/node';
import { Stream } from '@osdk/aliases/node';
import { stream } from '@osdk/aliases/node';
import { ThreeDimensionalAggregation } from '@osdk/client';
import { TwoDimensionalAggregation } from '@osdk/client';
import type { UserId as UserId_2 } from '@osdk/foundry.core';
Expand Down Expand Up @@ -72,23 +84,6 @@ export type ClassificationMarking<T extends string = string> = T & {
// @public (undocumented)
export function createEditBatch<T extends AnyEdit = never>(_client: Client): EditBatch<T>;

// @public (undocumented)
type Custom = string & {
readonly __brand: "Custom"
};

// @public (undocumented)
function custom(alias: string): Custom;

// @public (undocumented)
interface Dataset {
// (undocumented)
rid: string;
}

// @public (undocumented)
function dataset(alias: string): Dataset;

// @public (undocumented)
export type DateISOString<T extends string = string> = T & {
__dateBrand?: void
Expand Down Expand Up @@ -216,26 +211,8 @@ export type MandatoryMarking<T extends string = string> = T & {

export { MediaReference }

// @public (undocumented)
interface Mediaset {
// (undocumented)
rid: string;
}

// @public (undocumented)
function mediaset(alias: string): Mediaset;

export { MediaUpload }

// @public (undocumented)
interface Model {
// (undocumented)
rid: string;
}

// @public (undocumented)
function model(alias: string): Model;

export { MultiLineString }

export { MultiPoint }
Expand Down Expand Up @@ -308,24 +285,6 @@ export type Short<T extends number = number> = T & {
_shortBrand?: void
};

// @public (undocumented)
interface Source {
// (undocumented)
rid: string;
}

// @public (undocumented)
function source(alias: string): Source;

// @public (undocumented)
interface Stream {
// (undocumented)
rid: string;
}

// @public (undocumented)
function stream(alias: string): Stream;

export { ThreeDimensionalAggregation }

// @public (undocumented)
Expand Down
17 changes: 17 additions & 0 deletions packages/aliases/experimental.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export * from "./build/cjs/public/experimental.cjs";
17 changes: 17 additions & 0 deletions packages/aliases/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export * from "./build/cjs/index.cjs";
17 changes: 17 additions & 0 deletions packages/aliases/node.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export * from "./build/cjs/public/node.cjs";
49 changes: 49 additions & 0 deletions packages/aliases/oxlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { defineConfig } from "oxlint";

import root from "../../oxlint.config.ts";

// Nested oxlint config for @osdk/aliases. This package's source was moved here
// verbatim from @osdk/functions, which carries the same carve-outs, so the same
// rules are disabled to keep the extraction a move rather than a rewrite. Every
// rule below is surfaced only by the moved test setup, not by the runtime source.
// This list is a strict subset of the one in packages/functions/oxlint.config.ts.
//
// `extends` only carries `rules`/`plugins`/`overrides`, so the root's
// `ignorePatterns` are re-applied explicitly.
export default defineConfig({
extends: [root],
ignorePatterns: root.ignorePatterns,

rules: {
// --- typescript ---
// `delete process.env[computed]` in test setup; the pattern is intentional.
"typescript/no-dynamic-delete": "off",

// --- unicorn ---
// `__dirname` in test setup, reading fixture files relative to the test.
"unicorn/prefer-module": "off",
// `require("fs")` / `"fs"` -> `"node:fs"`; the autofix rewrites specifiers,
// and the test deliberately uses `node:fs` separately from the mocked `fs`.
"unicorn/prefer-node-protocol": "off",

// --- node ---
// `require(...)` inside `vi.hoisted(...)`, which must not be a static import.
"node/global-require": "off",
},
});
82 changes: 82 additions & 0 deletions packages/aliases/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"name": "@osdk/aliases",
"version": "0.1.0",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/palantir/osdk-ts.git"
},
"exports": {
".": {
"browser": "./build/browser/index.js",
"import": {
"types": "./build/types/index.d.ts",
"default": "./build/esm/index.js"
},
"require": "./build/cjs/index.cjs",
"default": "./build/browser/index.js"
},
"./experimental": {
"browser": "./build/browser/public/experimental.js",
"import": {
"types": "./build/types/public/experimental.d.ts",
"default": "./build/esm/public/experimental.js"
},
"require": "./build/cjs/public/experimental.cjs",
"default": "./build/browser/public/experimental.js"
},
"./node": {
"browser": "./build/browser/public/node.js",
"import": {
"types": "./build/types/public/node.d.ts",
"default": "./build/esm/public/node.js"
},
"require": "./build/cjs/public/node.cjs",
"default": "./build/browser/public/node.js"
},
"./*": {
"browser": "./build/browser/public/*.js",
"import": {
"types": "./build/types/public/*.d.ts",
"default": "./build/esm/public/*.js"
},
"require": "./build/cjs/public/*.cjs",
"default": "./build/browser/public/*.js"
}
},
"scripts": {
"check-attw": "attw --pack .",
"check-spelling": "cspell --quiet .",
"clean": "rm -rf lib dist types build tsconfig.tsbuildinfo",
"fix-lint": "oxlint -c ./oxlint.config.ts --fix . && oxfmt -c ../../oxfmt.config.ts .",
"lint": "oxlint -c ./oxlint.config.ts . && oxfmt -c ../../oxfmt.config.ts --check .",
"test": "vitest run --pool=forks",
"transpileBrowser": "monorepo.tool.transpile -f esm -m normal -t browser",
"transpileCjs": "monorepo.tool.transpile -f cjs -m bundle -t node",
"transpileEsm": "monorepo.tool.transpile -f esm -m normal -t node",
"transpileTypes": "monorepo.tool.transpile -f esm -m types -t node",
"typecheck": "tsc --noEmit --emitDeclarationOnly false"
},
"devDependencies": {
"@osdk/monorepo.api-extractor": "workspace:~",
"@osdk/monorepo.tsconfig": "workspace:~",
"typescript": "~5.5.4"
},
"publishConfig": {
"access": "public"
},
"files": [
"build/cjs",
"build/esm",
"build/browser",
"build/types",
"CHANGELOG.md",
"package.json",
"templates",
"*.d.ts"
],
"main": "./build/cjs/index.cjs",
"module": "./build/esm/index.js",
"types": "./build/cjs/index.d.cts",
"type": "module"
}
Loading
Loading