diff --git a/.changeset/config.json b/.changeset/config.json index 6abd4ba50..69674ca2f 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -14,8 +14,7 @@ "@osdk/examples.*", "@osdk/tests.*", "@osdk/version-updater", - "mytsup", - "tsconfig" + "@osdk/monorepo.*" ], "bumpVersionsWithWorkspaceProtocolOnly": true, "snapshot": { diff --git a/.changeset/gentle-hairs-decide.md b/.changeset/gentle-hairs-decide.md new file mode 100644 index 000000000..a845151cc --- /dev/null +++ b/.changeset/gentle-hairs-decide.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.changeset/lazy-tools-hear.md b/.changeset/lazy-tools-hear.md new file mode 100644 index 000000000..a845151cc --- /dev/null +++ b/.changeset/lazy-tools-hear.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.changeset/pre.json b/.changeset/pre.json index 63a4ac8e1..36cf49a27 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -2,16 +2,16 @@ "mode": "pre", "tag": "beta", "initialVersions": { - "@osdk/examples.basic.cli": "0.0.0", - "@osdk/examples.basic.sdk": "0.0.0", + "@osdk/e2e.sandbox.catchall": "0.0.0", + "@osdk/e2e.generated.catchall": "0.0.0", "@osdk/examples.docs.example": "0.0.1", - "@osdk/examples.one.dot.one": "0.0.17", - "@osdk/examples.todoapp": "0.0.10", + "@osdk/e2e.generated.1.1.x": "0.0.17", + "@osdk/e2e.sandbox.todoappapp": "0.0.10", "@osdk/examples.next-static-export": "0.0.0", "@osdk/examples.react": "0.0.0", "@osdk/examples.tutorial-todo-app": "0.0.0", "@osdk/examples.vue": "0.0.0", - "mytsup": "0.0.0", + "@osdk/monorepo.tsup": "0.0.0", "tsconfig": "0.0.0", "@osdk/api": "1.8.0", "@osdk/cli": "0.21.0", diff --git a/.changeset/sixty-rules-attend.md b/.changeset/sixty-rules-attend.md new file mode 100644 index 000000000..e64ac8d8e --- /dev/null +++ b/.changeset/sixty-rules-attend.md @@ -0,0 +1,41 @@ +--- +"@osdk/foundry.thirdpartyapplications": patch +"@osdk/internal.foundry.ontologiesv2": patch +"@osdk/internal.foundry.ontologies": patch +"@osdk/internal.foundry.datasets": patch +"@osdk/internal.foundry.models": patch +"@osdk/platform-sdk-generator": patch +"@osdk/shared.net.platformapi": patch +"@osdk/foundry-sdk-generator": patch +"@osdk/internal.foundry.core": patch +"@osdk/client.test.ontology": patch +"@osdk/generator-converters": patch +"@osdk/client.unstable.osw": patch +"@osdk/cli.cmd.typescript": patch +"@osdk/shared.client.impl": patch +"@osdk/example-generator": patch +"@osdk/gateway-generator": patch +"@osdk/shared.net.errors": patch +"@osdk/foundry.security": patch +"@osdk/internal.foundry": patch +"@osdk/shared.net.fetch": patch +"@osdk/client.unstable": patch +"@osdk/legacy-client": patch +"@osdk/foundry.core": patch +"@osdk/tool.release": patch +"@osdk/shared.test": patch +"@osdk/cli.common": patch +"@osdk/client.api": patch +"@osdk/create-app": patch +"@osdk/shared.net": patch +"@osdk/generator": patch +"@osdk/foundry": patch +"@osdk/gateway": patch +"@osdk/client": patch +"@osdk/maker": patch +"@osdk/oauth": patch +"@osdk/api": patch +"@osdk/cli": patch +--- + +Spelling fixes and spell check in CI diff --git a/.changeset/smart-feet-chew.md b/.changeset/smart-feet-chew.md index 7839c8cd8..2b59c18dc 100644 --- a/.changeset/smart-feet-chew.md +++ b/.changeset/smart-feet-chew.md @@ -2,4 +2,4 @@ "@osdk/client": patch --- -Fixes link direction for experiental bulk loads +Fixes link direction for experimental bulk loads diff --git a/.changeset/weak-dragons-wonder.md b/.changeset/weak-dragons-wonder.md new file mode 100644 index 000000000..a845151cc --- /dev/null +++ b/.changeset/weak-dragons-wonder.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5802228b4..1e8042fc4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,32 @@ on: types: [opened, synchronize, reopened] jobs: + cspell: + name: Check spelling + timeout-minutes: 5 + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: pnpm/action-setup@v4 + with: + version: 8.7.4 + + - name: Setup Node.js environment + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Check spelling + run: pnpm exec turbo run ci:cspell + changesets: name: Check for changesets if: ${{ github.event_name == 'pull_request' }} diff --git a/.gitignore b/.gitignore index 0aaa4d434..1b89f1029 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ tsconfig.tsbuildinfo packages/client/src/generatedNoCheck packages/client.test.ontology/src/generatedNoCheck packages/legacy-client/src/generatedNoCheck +packages/create-app.template.*/src/generatedNoCheck .log pnpm-publish-summary.json diff --git a/.lintstagedrc.mjs b/.lintstagedrc.mjs index 4dfe6836c..40e8a801f 100644 --- a/.lintstagedrc.mjs +++ b/.lintstagedrc.mjs @@ -2,6 +2,8 @@ import micromatch from "micromatch"; +const CSPELL_CMD = "cspell --quiet --no-must-find-files"; + /* * Overview: * - Fixes lint rules and formatting for code @@ -12,23 +14,33 @@ import micromatch from "micromatch"; * @type {import("lint-staged").Config} */ export default { - "monorepo/**/*.{js,jsx,ts,tsx,mjs,cjs}": [ + "packages/monorepo.*/**/*.{js,jsx,ts,tsx,mjs,cjs}": [ "dprint fmt", + CSPELL_CMD, ], - "{packages,examples-extra/basic}/**/*.{js,jsx,ts,tsx,mjs,cjs}": ( + "*.md": [CSPELL_CMD], + "packages/**/*.{js,jsx,ts,tsx,mjs,cjs}": ( files, ) => { const match = micromatch.not( files, - ["**/templates/**/*", "**/generatedNoCheck/**/*"], + [ + "**/templates/**/*", + "**/generatedNoCheck/**/*", + "**/generatedNoCheck2/**/*", + ], ); if (match.length === 0) return []; return [ `dprint fmt ${match.join(" ")}`, `eslint --fix ${match.join(" ")}`, + `${CSPELL_CMD} ${match.join(" ")}`, ]; }, - "(.lintstagedrc.mjs|.monorepolint.config.mjs)": ["dprint fmt"], + "(.lintstagedrc.mjs|.monorepolint.config.mjs)": [ + "dprint fmt", + CSPELL_CMD, + ], "*": (files) => { const mrlFiles = micromatch(files, [ "package.json", diff --git a/.monorepolint.config.mjs b/.monorepolint.config.mjs index eb9dc76c2..c7153f578 100644 --- a/.monorepolint.config.mjs +++ b/.monorepolint.config.mjs @@ -33,14 +33,15 @@ const LATEST_TYPESCRIPT_DEP = "^5.5.2"; const DELETE_SCRIPT_ENTRY = { options: [undefined], fixValue: undefined }; const nonStandardPackages = [ - "mytsup", - "tsconfig", - "@osdk/api-extractor", - "@osdk/examples.todoapp", - "@osdk/tests.*", - "@osdk/foundry-sdk-generator", "@osdk/examples.*", + "@osdk/foundry-sdk-generator", + "@osdk/monorepo.*", + "@osdk/e2e.sandbox.*", // sandboxes for manual e2e testing + "@osdk/e2e.generated.*", // generated sdks for e2e testing "@osdk/shared.client", + "@osdk/create-app.template.*", + "@osdk/monorepo.cspell", + "@osdk/tests.*", ]; const legacyPackages = [ @@ -73,6 +74,7 @@ const esmOnlyPackages = [ "@osdk/tool.release", "@osdk/version-updater", "@osdk/client.test.ontology", + "@osdk/create-app.template-packager", // "@osdk/examples.*", but they have their own config cause they are nonstandard ]; @@ -234,7 +236,7 @@ function standardPackageRules(shared, options) { ...shared, options: getTsconfigOptions( - `${pathToWorkspaceRoot}/monorepo/tsconfig/tsconfig.base.json`, + `@osdk/monorepo.tsconfig/base.json`, { customTsconfigExcludes: options.customTsconfigExcludes, skipTsconfigReferences: options.skipTsconfigReferences, @@ -271,11 +273,22 @@ function standardPackageRules(shared, options) { }), ] : []), + requireDependency({ + ...shared, + options: { + devDependencies: { + "@osdk/monorepo.tsconfig": "workspace:~", + "@osdk/monorepo.tsup": "workspace:~", + "@osdk/monorepo.api-extractor": "workspace:~", + }, + }, + }), packageScript({ ...shared, options: { scripts: { clean: "rm -rf lib dist types build tsconfig.tsbuildinfo", + "check-spelling": "cspell --quiet .", "check-attw": `${pathToWorkspaceRoot}/scripts/build_common/check-attw.sh ${ options.esmOnly ? "esm" : "both" @@ -365,7 +378,7 @@ function standardPackageRules(shared, options) { import { defineConfig } from "tsup"; export default defineConfig(async (options) => - (await import("mytsup")).default(options, { + (await import("@osdk/monorepo.tsup")).default(options, { ${options.legacy ? "cjsExtension: '.js'" : ""} ${options.esmOnly ? "esmOnly: true," : ""} }) @@ -383,6 +396,48 @@ function standardPackageRules(shared, options) { */ export default { rules: [ + fileContents({ + includePackages: ["@osdk/create-app.template.*"], + options: { + file: "README.md", + generator: (context) => { + return `# ${context.getPackageJson().name} + +This package contains templates for \`@osdk/create-app\`. + +The dependencies will come from this package's \`package.json\` (excluding \`@osdk/create-app.template-packager\`) and the rest of template is filled out from the \`templates\` directory. + +NOTE: DO NOT EDIT THIS README BY HAND. It is generated by monorepolint. +`; + }, + }, + }), + fileContents({ + includePackages: ["@osdk/create-app.template.*"], + options: { + file: "turbo.json", + template: `{ + // WARNING: GENERATED FILE. DO NOT EDIT DIRECTLY. See .monorepolint.config.mjs + "extends": ["//"], + "tasks": { + "codegen": { + "inputs": ["templates/**/*"], + "outputs": ["src/generatedNoCheck/**/*"], + "dependsOn": ["@osdk/create-app.template-packager#transpile"] + } + } +} +`, + }, + }), + ...standardPackageRules({ + includePackages: ["@osdk/create-app.template.*"], + }, { + legacy: false, + packageDepth: 2, + type: "example", + esmOnly: true, + }), ...standardPackageRules({ excludePackages: [ ...nonStandardPackages, @@ -435,19 +490,22 @@ export default { ), ...standardPackageRules({ - includePackages: ["@osdk/examples.basic.**"], - excludePackages: ["@osdk/examples.one.dot.one"], + includePackages: [ + "@osdk/e2e.generated.catchall", + "@osdk/e2e.sandbox.catchall", + ], + excludePackages: ["@osdk/e2e.generated.1.1.x"], }, { esmOnly: true, legacy: false, - packageDepth: 3, + packageDepth: 2, type: "example", }), // most packages can use the newest typescript, but we enforce that @osdk/example.one.dot.one uses TS4.9 // so that we get build-time checking to make sure we don't regress v1.1 clients using an older Typescript. ...standardPackageRules({ - includePackages: ["@osdk/examples.one.dot.one"], + includePackages: ["@osdk/e2e.generated.1.1.x"], }, { legacy: false, packageDepth: 2, diff --git a/.vscode/extensions.json b/.vscode/extensions.json index bc26a82ae..703abe0be 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -4,7 +4,8 @@ // List of extensions which should be recommended for users of this workspace. "recommendations": [ - "dprint.dprint" + "dprint.dprint", + "streetsidesoftware.code-spell-checker" ], // List of extensions recommended by VS Code that should not be recommended for users of this workspace. "unwantedRecommendations": [] diff --git a/.vscode/settings.json b/.vscode/settings.json index f8830bca7..7f3da05b2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -22,5 +22,8 @@ "pino", "todoapp" ], - "typescript.tsdk": "node_modules/typescript/lib" + "typescript.tsdk": "node_modules/typescript/lib", + "[jsonc]": { + "editor.defaultFormatter": "dprint.dprint" + } } diff --git a/cspell.config.cjs b/cspell.config.cjs new file mode 100644 index 000000000..a1cdc1f7e --- /dev/null +++ b/cspell.config.cjs @@ -0,0 +1,18 @@ +/* + * Copyright 2024 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. + */ + +"use strict"; +module.exports = require("@osdk/monorepo.cspell"); diff --git a/eslint.config.mjs b/eslint.config.mjs index 869c194ed..69dc1cefb 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -106,6 +106,7 @@ export default tseslint.config( "**/bin/*.mjs", "**/bin/*.cjs", "examples-extra/**/*", + "packages/e2e.sandbox.*/**/*", ], rules: { "header/header": "off", @@ -120,6 +121,7 @@ export default tseslint.config( "**/*.test.ts", "**/test/*", "examples-extra/**/*", + "packages/e2e.sandbox.*/**/*", ], rules: { "no-console": "off", @@ -139,7 +141,7 @@ export default tseslint.config( "**/src/generatedNoCheck2/", "**/templates/", "examples/**/*", - "monorepo/**", + "packages/monorepo.*/**", "google-font-mocked-response.js", ".lintstagedrc.mjs", "tests/", diff --git a/examples-extra/docs_example/package.json b/examples-extra/docs_example/package.json index 9e63ed236..7c301bfce 100644 --- a/examples-extra/docs_example/package.json +++ b/examples-extra/docs_example/package.json @@ -42,7 +42,7 @@ "eslint": "^8.57.0", "eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-react-refresh": "^0.4.7", - "postcss": "^8.4.31", + "postcss": "^8.4.39", "rollup-plugin-visualizer": "^5.12.0", "tailwindcss": "^3.4.4", "tslib": "^2.6.2", diff --git a/examples-extra/docs_example/src/osdkExample.tsx b/examples-extra/docs_example/src/osdkExample.tsx index d1d002259..d40faacb2 100644 --- a/examples-extra/docs_example/src/osdkExample.tsx +++ b/examples-extra/docs_example/src/osdkExample.tsx @@ -51,7 +51,7 @@ export async function osdkObjectSetExample() { meetingRoomCapacities: { $contains: 30 }, }); - // Where clause GEOTYPES + // Where clause geo types // Within clauses take either a polygon or bounding box const withinFilteredObjectSet = await client(Office).where({ diff --git a/examples-extra/todoapp/src/main.tsx b/examples-extra/todoapp/src/main.tsx deleted file mode 100644 index 3d7150da8..000000000 --- a/examples-extra/todoapp/src/main.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import React from 'react' -import ReactDOM from 'react-dom/client' -import App from './App.tsx' -import './index.css' - -ReactDOM.createRoot(document.getElementById('root')!).render( - - - , -) diff --git a/examples/example-next-static-export/package.json b/examples/example-next-static-export/package.json index 8246bf121..c98721861 100644 --- a/examples/example-next-static-export/package.json +++ b/examples/example-next-static-export/package.json @@ -14,7 +14,7 @@ "start": "next start" }, "dependencies": { - "@osdk/examples.one.dot.one": "workspace:*", + "@osdk/e2e.generated.1.1.x": "workspace:*", "next": "14.2.3", "react": "^18", "react-dom": "^18" diff --git a/examples/example-next-static-export/src/app/page.tsx b/examples/example-next-static-export/src/app/page.tsx index 589cae4b0..100175c50 100644 --- a/examples/example-next-static-export/src/app/page.tsx +++ b/examples/example-next-static-export/src/app/page.tsx @@ -15,7 +15,7 @@ function Home() { return (
-

@osdk/examples.one.dot.one

+

@osdk/e2e.generated.1.1.x

Welcome to your Ontology SDK! Try using any of the following methods now. diff --git a/examples/example-next-static-export/src/lib/client.ts b/examples/example-next-static-export/src/lib/client.ts index cb69b4fee..24c84ab66 100644 --- a/examples/example-next-static-export/src/lib/client.ts +++ b/examples/example-next-static-export/src/lib/client.ts @@ -1,4 +1,4 @@ -import { FoundryClient, PublicClientAuth } from "@osdk/examples.one.dot.one"; +import { FoundryClient, PublicClientAuth } from "@osdk/e2e.generated.1.1.x"; const url = process.env.NEXT_PUBLIC_FOUNDRY_API_URL; const clientId = process.env.NEXT_PUBLIC_FOUNDRY_CLIENT_ID; diff --git a/examples/example-react/package.json b/examples/example-react/package.json index d22a43404..c4c92d5f0 100644 --- a/examples/example-react/package.json +++ b/examples/example-react/package.json @@ -14,7 +14,7 @@ "preview": "vite preview" }, "dependencies": { - "@osdk/examples.one.dot.one": "workspace:*", + "@osdk/e2e.generated.1.1.x": "workspace:*", "react": "^18", "react-dom": "^18", "react-router-dom": "^6.23.1" diff --git a/examples/example-react/src/Home.tsx b/examples/example-react/src/Home.tsx index 7fa2a8b85..5b4375dc8 100644 --- a/examples/example-react/src/Home.tsx +++ b/examples/example-react/src/Home.tsx @@ -9,7 +9,7 @@ function Home() { return ( -

@osdk/examples.one.dot.one

+

@osdk/e2e.generated.1.1.x

Welcome to your Ontology SDK! Try using any of the following methods now. diff --git a/examples/example-react/src/client.ts b/examples/example-react/src/client.ts index 6c54ec01d..83a1db626 100644 --- a/examples/example-react/src/client.ts +++ b/examples/example-react/src/client.ts @@ -1,4 +1,4 @@ -import { FoundryClient, PublicClientAuth } from "@osdk/examples.one.dot.one"; +import { FoundryClient, PublicClientAuth } from "@osdk/e2e.generated.1.1.x"; const url = import.meta.env.VITE_FOUNDRY_API_URL; const clientId = import.meta.env.VITE_FOUNDRY_CLIENT_ID; diff --git a/examples/example-tutorial-todo-aip-app/package.json b/examples/example-tutorial-todo-aip-app/package.json index 1f34c26fc..9d2e18782 100644 --- a/examples/example-tutorial-todo-aip-app/package.json +++ b/examples/example-tutorial-todo-aip-app/package.json @@ -14,7 +14,7 @@ "preview": "vite preview" }, "dependencies": { - "@osdk/examples.one.dot.one": "workspace:*", + "@osdk/e2e.generated.1.1.x": "workspace:*", "react": "^18", "react-dom": "^18", "react-router-dom": "^6.23.1", diff --git a/examples/example-tutorial-todo-aip-app/src/client.ts b/examples/example-tutorial-todo-aip-app/src/client.ts index 6c54ec01d..83a1db626 100644 --- a/examples/example-tutorial-todo-aip-app/src/client.ts +++ b/examples/example-tutorial-todo-aip-app/src/client.ts @@ -1,4 +1,4 @@ -import { FoundryClient, PublicClientAuth } from "@osdk/examples.one.dot.one"; +import { FoundryClient, PublicClientAuth } from "@osdk/e2e.generated.1.1.x"; const url = import.meta.env.VITE_FOUNDRY_API_URL; const clientId = import.meta.env.VITE_FOUNDRY_CLIENT_ID; diff --git a/examples/example-tutorial-todo-app/package.json b/examples/example-tutorial-todo-app/package.json index 3b1aebe5c..a723d4e69 100644 --- a/examples/example-tutorial-todo-app/package.json +++ b/examples/example-tutorial-todo-app/package.json @@ -14,7 +14,7 @@ "preview": "vite preview" }, "dependencies": { - "@osdk/examples.one.dot.one": "workspace:*", + "@osdk/e2e.generated.1.1.x": "workspace:*", "react": "^18", "react-dom": "^18", "react-router-dom": "^6.23.1", diff --git a/examples/example-tutorial-todo-app/src/client.ts b/examples/example-tutorial-todo-app/src/client.ts index 6c54ec01d..83a1db626 100644 --- a/examples/example-tutorial-todo-app/src/client.ts +++ b/examples/example-tutorial-todo-app/src/client.ts @@ -1,4 +1,4 @@ -import { FoundryClient, PublicClientAuth } from "@osdk/examples.one.dot.one"; +import { FoundryClient, PublicClientAuth } from "@osdk/e2e.generated.1.1.x"; const url = import.meta.env.VITE_FOUNDRY_API_URL; const clientId = import.meta.env.VITE_FOUNDRY_CLIENT_ID; diff --git a/examples/example-vue/package.json b/examples/example-vue/package.json index 81a9d3671..5d2593dd0 100644 --- a/examples/example-vue/package.json +++ b/examples/example-vue/package.json @@ -13,7 +13,7 @@ "preview": "vite preview" }, "dependencies": { - "@osdk/examples.one.dot.one": "workspace:*", + "@osdk/e2e.generated.1.1.x": "workspace:*", "vue": "^3.4.27", "vue-router": "^4.2.5" }, diff --git a/examples/example-vue/src/Home.vue b/examples/example-vue/src/Home.vue index 4b68a66f7..f9a368fed 100644 --- a/examples/example-vue/src/Home.vue +++ b/examples/example-vue/src/Home.vue @@ -7,7 +7,7 @@ const queryApiNames = Object.keys(client.ontology.queries);