Skip to content

Commit

Permalink
Merge branch 'main' into ssanjay/timeseries
Browse files Browse the repository at this point in the history
  • Loading branch information
ssanjay1 committed Jul 14, 2024
2 parents 3f0008c + 343de0a commit 836913c
Show file tree
Hide file tree
Showing 103 changed files with 1,667 additions and 181 deletions.
5 changes: 5 additions & 0 deletions .changeset/new-points-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@osdk/client": patch
---

Fix action params that take objects to correctly parse out primary key.
5 changes: 5 additions & 0 deletions .changeset/odd-hornets-protect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@osdk/legacy-client": patch
---

Oauth errors should include a cause now on supported platforms
10 changes: 9 additions & 1 deletion .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
},
"changesets": [
"calm-pillows-collect",
"chilly-mayflies-vanish",
"chilly-melons-hammer",
"chilly-singers-compare",
"cool-rice-check",
Expand All @@ -71,23 +72,29 @@
"four-ways-add",
"great-geese-fail",
"green-chefs-speak",
"healthy-nails-relax",
"itchy-radios-own",
"khaki-plants-sort",
"large-ads-listen",
"lazy-jobs-attend",
"lovely-mice-beg",
"moody-bats-hear",
"moody-crews-ring",
"nervous-parrots-admire",
"nervous-pets-return",
"ninety-avocados-unite",
"old-kiwis-marry",
"orange-icons-battle",
"pink-insects-itch",
"plenty-peaches-scream",
"pretty-cherries-hunt",
"pretty-dingos-smash",
"purple-cameras-invite",
"purple-pots-fold",
"purple-trainers-laugh",
"rotten-lamps-protect",
"rotten-shirts-cross",
"serious-camels-rest",
"serious-glasses-try",
"sharp-penguins-double",
"shy-cougars-remain",
Expand All @@ -99,6 +106,7 @@
"tough-hats-push",
"unlucky-moose-lay",
"unlucky-wombats-switch",
"wild-plums-yell"
"wild-plums-yell",
"young-fireants-repair"
]
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ packages/legacy-client/src/generatedNoCheck
.log
pnpm-publish-summary.json
.npmrc

api-docs/
temp/
8 changes: 4 additions & 4 deletions .monorepolint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const DELETE_SCRIPT_ENTRY = { options: [undefined], fixValue: undefined };
const nonStandardPackages = [
"mytsup",
"tsconfig",
"@osdk/api-extractor",
"@osdk/examples.todoapp",
"@osdk/tests.*",
"@osdk/foundry-sdk-generator",
Expand Down Expand Up @@ -215,7 +216,6 @@ function standardPackageRules(shared, options) {
...shared,
options: {
scripts: {
"dev:transpile": DELETE_SCRIPT_ENTRY,
clean: "rm -rf lib dist types build tsconfig.tsbuildinfo",
"check-attw":
`${pathToWorkspaceRoot}/scripts/build_common/check-attw.sh ${
Expand All @@ -224,10 +224,10 @@ function standardPackageRules(shared, options) {
lint: "eslint . && dprint check --config $(find-up dprint.json)",
"fix-lint":
"eslint . --fix && dprint fmt --config $(find-up dprint.json)",
prettier: DELETE_SCRIPT_ENTRY,
transpile: "tsup",
transpile:
"find . \\( -path build/cjs -or -path build/esm -or -path build/browser \\) -type f \\( -name '*.js' -or -name '*.js.map' -or -name '*.cjs' -or -name '*.cjs.map' \\) -delete && tsup",
typecheck:
`${pathToWorkspaceRoot}/scripts/build_common/typecheck.sh ${
`find . \\( -path build/cjs -or -path build/esm -or -path build/browser \\) -type f \\( -name '*.ts' -or -name '*.ts.map' -or -name '*.cts' -or -name '*.cts.map' \\) -delete && ${pathToWorkspaceRoot}/scripts/build_common/typecheck.sh ${
options.esmOnly ? "esm" : "both"
}`,
},
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"editor.defaultFormatter": "dprint.dprint"
},
"[typescript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
"editor.defaultFormatter": "dprint.dprint"
},
"[json]": {
"editor.defaultFormatter": "dprint.dprint"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
> **Follow semver rules here.**
1. Assuming you've run `pnpm install`, run `changeset` (or `pnpm exec changeset`).
2. The tool will split things into changed vs unchanged packages (which you may need if you decide to add changeset logs in a future PR for past features)
3. Select the packages you want the changeset applied to using the arrow keys (up/down) and spacebar to "select" the package.
3. Select the packages you want the changeset applied to using the arrow keys (up/down) and space-bar to "select" the package.
4. Press enter to continue.
5. The CLI will go through a progression of asking you which pacakges you previously selected need a major bump? Then a minor bump? Patch bumps assumed for remaining packages changed. Arrows and space bar to select. Enter to continue (even if you selected nothing).
5. The CLI will go through a progression of asking you which packages you previously selected need a major bump? Then a minor bump? Patch bumps assumed for remaining packages changed. Arrows and space bar to select. Enter to continue (even if you selected nothing).
6. Enter a change (or press enter on empty to open your editor.)

> Info
>
> Full docs on the `changesets` tool can be found at the [changesets/changests github repo](https://github.com/changesets/changesets).
> Full docs on the `changesets` tool can be found at the [changesets/changesets github repo](https://github.com/changesets/changesets).
7. If you're curious what the final build output might look like you can run `pnpm build` from root.
8. Run all lint rules and tests with `pnpm check` from root.
3 changes: 3 additions & 0 deletions dev-docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Developer Docs for Contributing to osdk-ts

If you are looking for documentation on how to use the OSDK, see your developer console on your foundry stack.
14 changes: 14 additions & 0 deletions dev-docs/build-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Build / CI notes for the repo

## api-extractor

Currently, this runs only as part of `@osdk/client.api`, however the goal is to extend this to the entire repo assuming we are satisfied with its output.

While the api-extract can be used for generating rolled up `.d.ts` files, we do not use it for that purpose. Our intention is to use it generate the api report and api documentation. The logic behind the api report is it should make it easier to review the impact of changes to types within the codebase. For example, it can show that we have implicitly created a dependency on a third party library for our own types.

### CI implications

The `api-extractor` has a "local" and a non-local (CI) mode. In the "local" mode, it will automatically update the file we commit for the api report. The intent of the tool is to error in CI if the file that is committed doesn't match the output, however the behavior of the tool is to exit with a non-zero code when there are warnings in the non-local mode. This makes adoption of the tool expensive at best and at worst removes the ability to have granular information.

As such, we run the tool in CI in "local" mode so that we do not get non-zero exits for warnings. Our existing build infrastructure already fails the build if any changes happen to committed files during CI and as such we can rely on that mechanism to be sure that developers have updated the api report that gets committed.

4 changes: 3 additions & 1 deletion dprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
".vscode/settings.json",
"examples/",
"examples-extra/**/dist",
"**/tsup.config.bundled_*"
"**/tsup.config.bundled_*",
"**/api-docs/",
"**/*.report.api.md"
],
"plugins": [
"https://plugins.dprint.dev/typescript-0.90.4.wasm",
Expand Down
4 changes: 2 additions & 2 deletions examples-extra/basic/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"clean": "rm -rf lib dist types build tsconfig.tsbuildinfo",
"fix-lint": "eslint . --fix && dprint fmt --config $(find-up dprint.json)",
"lint": "eslint . && dprint check --config $(find-up dprint.json)",
"transpile": "tsup",
"transpile": "find . \\( -path build/cjs -or -path build/esm -or -path build/browser \\) -type f \\( -name '*.js' -or -name '*.js.map' -or -name '*.cjs' -or -name '*.cjs.map' \\) -delete && tsup",
"transpileWatch": "tsup --watch",
"typecheck": "../../../scripts/build_common/typecheck.sh esm"
"typecheck": "find . \\( -path build/cjs -or -path build/esm -or -path build/browser \\) -type f \\( -name '*.ts' -or -name '*.ts.map' -or -name '*.cts' -or -name '*.cts.map' \\) -delete && ../../../scripts/build_common/typecheck.sh esm"
},
"dependencies": {
"@osdk/api": "workspace:~",
Expand Down
4 changes: 2 additions & 2 deletions examples-extra/basic/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
"codegen": "rm -rf src/generatedNoCheck/* && osdk-unstable-typescript generate --outDir src/generatedNoCheck --ontologyPath ontology.json --beta true --packageType module --version dev --internal",
"fix-lint": "eslint . --fix && dprint fmt --config $(find-up dprint.json)",
"lint": "eslint . && dprint check --config $(find-up dprint.json)",
"transpile": "tsup",
"transpile": "find . \\( -path build/cjs -or -path build/esm -or -path build/browser \\) -type f \\( -name '*.js' -or -name '*.js.map' -or -name '*.cjs' -or -name '*.cjs.map' \\) -delete && tsup",
"transpileWatch": "tsup --watch",
"typecheck": "../../../scripts/build_common/typecheck.sh esm"
"typecheck": "find . \\( -path build/cjs -or -path build/esm -or -path build/browser \\) -type f \\( -name '*.ts' -or -name '*.ts.map' -or -name '*.cts' -or -name '*.cts.map' \\) -delete && ../../../scripts/build_common/typecheck.sh esm"
},
"dependencies": {
"@osdk/api": "workspace:~",
Expand Down
10 changes: 10 additions & 0 deletions examples-extra/basic/sdk/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": ["//"],
"tasks": {
"codegen": {
"inputs": ["ontology.json"],
"outputs": ["src/generatedNoCheck/**/*"],
"dependsOn": ["@osdk/cli.cmd.typescript#transpile"]
}
}
}
2 changes: 1 addition & 1 deletion examples-extra/docs_example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"scripts": {
"build": "tsc && vite build",
"codegen": "rm -rf src/generatedNoCheck2/* && rm -rf src/generatedNoCheck/* && osdk-unstable-typescript generate --outDir src/generatedNoCheck --beta true --ontologyPath ontology.json --version dev --internal",
"codegen": "rm -rf src/generatedNoCheck/* && osdk-unstable-typescript generate --outDir src/generatedNoCheck --beta true --ontologyPath ontology.json --version dev --internal",
"dev": "vite",
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
Expand Down
10 changes: 10 additions & 0 deletions examples-extra/docs_example/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": ["//"],
"tasks": {
"codegen": {
"inputs": ["ontology.json"],
"outputs": ["src/generatedNoCheck/**/*"],
"dependsOn": ["@osdk/cli.cmd.typescript#transpile"]
}
}
}
12 changes: 6 additions & 6 deletions examples-extra/one_dot_one/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@
"codegen": "rm -rf src/generatedNoCheck/* && osdk-unstable-typescript generate --outDir src/generatedNoCheck --ontologyPath ontology.json --version dev --packageType module",
"fix-lint": "eslint . --fix && dprint fmt --config $(find-up dprint.json)",
"lint": "eslint . && dprint check --config $(find-up dprint.json)",
"transpile": "tsup",
"transpile": "find . \\( -path build/cjs -or -path build/esm -or -path build/browser \\) -type f \\( -name '*.js' -or -name '*.js.map' -or -name '*.cjs' -or -name '*.cjs.map' \\) -delete && tsup",
"transpileWatch": "tsup --watch",
"typecheck": "../../scripts/build_common/typecheck.sh both"
"typecheck": "find . \\( -path build/cjs -or -path build/esm -or -path build/browser \\) -type f \\( -name '*.ts' -or -name '*.ts.map' -or -name '*.cts' -or -name '*.cts.map' \\) -delete && ../../scripts/build_common/typecheck.sh both"
},
"dependencies": {
"@osdk/api": "workspace:~",
"@osdk/generator": "workspace:~",
"@osdk/legacy-client": "workspace:~"
},
"peerDependencies": {
"@osdk/api": "^1.8.0",
"@osdk/legacy-client": "^2.4.0-beta.0"
"@osdk/api": "^1.9.0-beta.0",
"@osdk/legacy-client": "^2.4.0-beta.1"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.15.2",
"@osdk/api": "^1.8.0",
"@osdk/api": "^1.9.0-beta.0",
"@osdk/cli.cmd.typescript": "workspace:~",
"@osdk/legacy-client": "^2.4.0-beta.0",
"@osdk/legacy-client": "^2.4.0-beta.1",
"@types/node": "^18.0.0",
"tslib": "^2.6.2",
"typescript": "^4.9.5"
Expand Down
10 changes: 10 additions & 0 deletions examples-extra/one_dot_one/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": ["//"],
"tasks": {
"codegen": {
"inputs": ["ontology.json"],
"outputs": ["src/generatedNoCheck/**/*"],
"dependsOn": ["@osdk/cli.cmd.typescript#transpile"]
}
}
}
10 changes: 10 additions & 0 deletions examples-extra/todoapp/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": ["//"],
"tasks": {
"codegen": {
"inputs": ["ontology.json"],
"outputs": ["src/generatedNoCheck2/**/*"],
"dependsOn": ["@osdk/cli.cmd.typescript#transpile"]
}
}
}
69 changes: 69 additions & 0 deletions monorepo/api-extractor/base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/**
* Config file for API Extractor. For more info, please visit: https://api-extractor.com
*/
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",

"mainEntryPointFilePath": "<projectFolder>/build/esm/index.d.ts",
"bundledPackages": [],
"newlineKind": "lf",

"apiReport": {
"enabled": true,
"reportFileName": "<unscopedPackageName>.report.api.md",
"reportFolder": "<projectFolder>/etc/",
"reportTempFolder": "<projectFolder>/build/api-extractor/"
},

"docModel": {
"enabled": true,
"projectFolderUrl": "https://github.com/palantir/osdk-ts/tree/main/packages/client.api",
"apiJsonFilePath": "<projectFolder>/build/api-extractor/<unscopedPackageName>.api.json"
},
"tsdocMetadata": {
"enabled": false
},

"dtsRollup": {
"enabled": false
},
//
"messages": {
"compilerMessageReporting": {
"default": {
"logLevel": "warning"
}
// "TS2551": {
// "logLevel": "warning",
// "addToApiReportFile": true
// },
//
// . . .
},

"extractorMessageReporting": {
"default": {
"logLevel": "warning"
}
// "ae-extra-release-tag": {
// "logLevel": "warning",
// "addToApiReportFile": true
// },
//
// . . .
},

"tsdocMessageReporting": {
"default": {
"logLevel": "warning",
"addToApiReportFile": true
}
// "tsdoc-link-tag-unescaped-text": {
// "logLevel": "warning",
// "addToApiReportFile": true
// },
//
// . . .
}
}
}
9 changes: 9 additions & 0 deletions monorepo/api-extractor/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "@osdk/api-extractor",
"version": "0.0.0",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/palantir/osdk-ts.git"
}
}
3 changes: 2 additions & 1 deletion monorepo/mytsup/tsup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@ export default async (options, ourOptions) => {
),
TARGET: "node",
},
clean: true,
clean: false, // we do this ourselves so its granular
silent: true,
sourcemap: true,
splitting: true,
minify: false, // !options.watch,
onSuccess: async () => {
console.log("👍");
},
keepNames: false,
treeshake: true,
target: "es2022",

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"tsc-absolute": "^1.0.1",
"tsconfig": "workspace:~",
"tsup": "^8.1.0",
"turbo": "^1.13.2",
"turbo": "^2.0.4",
"typescript": "^5.5.3",
"typescript-eslint": "^7.16.0",
"vitest": "^1.6.0"
Expand Down
11 changes: 11 additions & 0 deletions packages/api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# @osdk/api

## 1.9.0-beta.0

### Minor Changes

- 388dba9: Change all internal dependencies to be tilde not caret

### Patch Changes

- Updated dependencies [388dba9]
- @osdk/shared[email protected]

## 1.8.0

### Minor Changes
Expand Down
Loading

0 comments on commit 836913c

Please sign in to comment.