Skip to content

Commit

Permalink
Introduce spell checking into builds
Browse files Browse the repository at this point in the history
  • Loading branch information
ericanderson committed Jul 17, 2024
1 parent 8b91726 commit 5647d2c
Show file tree
Hide file tree
Showing 193 changed files with 1,669 additions and 447 deletions.
3 changes: 2 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"@osdk/tests.*",
"@osdk/version-updater",
"mytsup",
"tsconfig"
"tsconfig",
"@osdk/monorepo.cspell"
],
"bumpVersionsWithWorkspaceProtocolOnly": true,
"snapshot": {
Expand Down
41 changes: 41 additions & 0 deletions .changeset/sixty-rules-attend.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .changeset/smart-feet-chew.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"@osdk/client": patch
---

Fixes link direction for experiental bulk loads
Fixes link direction for experimental bulk loads
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: turbo run ci:cspell

changesets:
name: Check for changesets
if: ${{ github.event_name == 'pull_request' }}
Expand Down
120 changes: 120 additions & 0 deletions .junk.cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
"ignorePaths": [
"node_modules/**",
"packages/*/build/**",
"examples-extra/basic/*/{build,dist}/**",
"examples-extra/*/{build,dist}/**",
"packages/client.unstable/src/generated/**",
"*.json",
"/packages/foundry-sdk-generator/src/generatedNoCheck/**/*",
"*.{yml,yaml}",
"*.sh",
"dict.*.txt",
"eslint.config.mjs",
"tsup.config.js",
"*.svg",
"*.css",
"_gitignore",
"*.snap"
],
"dictionaryDefinitions": [
{ "name": "foundry-words", "path": "packages/monorepo.cspell/dict.foundry-words.txt" },
{ "name": "imported-ontologies", "path": "packages/monorepo.cspell/dict.imported-ontologies.txt" },
{ "name": "npm-packages", "path": "packages/monorepo.cspell/dict.npm-packages.txt" },
{ "name": "osdk-code", "path": "packages/monorepo.cspell/dict.osdk-code.txt" },
{ "name": "osdk", "path": "packages/monorepo.cspell/dict.osdk.txt" },
{ "name": "test-words", "path": "packages/monorepo.cspell/dict.test-words.txt" },
{ "name": "wire-api-words-to-fix", "path": "packages/monorepo.cspell/dict.wire-api-words-to-fix.txt" },
{ "name": "wire-api-words", "path": "packages/monorepo.cspell/dict.wire-api-words.txt" }
],
"patterns": [
{ "name": "api", "pattern": "/api%3A[a-z]+/" },
{ "name": "token", "pattern": "/eyJ[a-zA-Z0-9_.]+5c/" }
],
"ignoreRegExpList": [
"api",
"token",
"/\/entitymetadata\//"
],
"dictionaries": [
"en_US",
"softwareTerms",
"typescript",
"node",
"npm",
"osdk",
"npm-packages"
],
"words": [
"@myapp",
"0123456789bcdefghjkmnpqrstuvwxyz",
"Aggregatable",
"api%3Aread",
"api%3Awrite",
"approxes",
"asdfasdfdhjlkajhgj",
"blocklist",
"blocklisted",
"Ciphertext",
"codegen",
"devx",
"Groupable",
"isModifierable",
"mgrs",
"multitenant",
"onwarn",
"Palo",
"PKCE",
"Retryable",
"tsdoc",
"typecheck",
"typesafety",
"Uncapitalize",
"underlyings",
"unevaluable",
"unioned",
"@osdk/examples.todoapp",
"@osdk/internal.foundry.ontologiesv2",
"@osdk/shared.net.platformapi",
"webapi"
],
"suggestWords": [],
"ignoreWords": [],
"import": [],
"overrides": [
{
"filename": ["**/*.md"],
"dictionaries": ["osdk"]
},
{
"filename": [
"packages/*/generatedNoCheck",
"packages/*/generatedNoCheck2",
"packages/client.unstable/src/generated/**",
"packages/gateway/src/generated/**",
"packages/foundry.*/src/**",
"packages/internal.foundry.*/src/**"
],
"dictionaries": ["wire-api-words", "wire-api-words-to-fix"]
},
{
"filename": "**/*.test.{mts,cts,ts,tsx}",
"dictionaries": ["test-words"]
},
{
"filename": [
"packages/shared.test/src/mock-ontology/**/*.{mts,cts,ts,tsx}",
"examples-extra/basic/*/src/**/*.{mts,cts,ts,tsx}",
"examples-extra/one_dot_one/src/**/*.{mts,cts,ts,tsx}"
],
"dictionaries": ["imported-ontologies"]
},
{
"filename": ["**/*.{mts,cts,ts,tsx}"],
"dictionaries": ["osdk-code"]
},
{ "filename": ["*.md"], "dictionaries": ["foundry-words"] }
]
}
10 changes: 9 additions & 1 deletion .lintstagedrc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -14,7 +16,9 @@ import micromatch from "micromatch";
export default {
"monorepo/**/*.{js,jsx,ts,tsx,mjs,cjs}": [
"dprint fmt",
CSPELL_CMD,
],
"*.md": [CSPELL_CMD],
"{packages,examples-extra/basic}/**/*.{js,jsx,ts,tsx,mjs,cjs}": (
files,
) => {
Expand All @@ -26,9 +30,13 @@ export default {
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",
Expand Down
2 changes: 2 additions & 0 deletions .monorepolint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const nonStandardPackages = [
"@osdk/foundry-sdk-generator",
"@osdk/examples.*",
"@osdk/shared.client",
"@osdk/monorepo.cspell",
];

const legacyPackages = [
Expand Down Expand Up @@ -276,6 +277,7 @@ function standardPackageRules(shared, options) {
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"
Expand Down
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": []
Expand Down
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@
"pino",
"todoapp"
],
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"[jsonc]": {
"editor.defaultFormatter": "dprint.dprint"
}
}
18 changes: 18 additions & 0 deletions cspell.config.cjs
Original file line number Diff line number Diff line change
@@ -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");
1 change: 1 addition & 0 deletions examples-extra/basic/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
"scripts": {
"check-attw": "../../../scripts/build_common/check-attw.sh esm",
"check-spelling": "cspell --quiet .",
"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)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export async function fetchEmployeePage(client: Client) {
printEmployees(result.data);

console.log({
apiname: result.data[0].$apiName,
apiName: result.data[0].$apiName,
});
console.log(result.data[0]);

Expand Down
1 change: 1 addition & 0 deletions examples-extra/basic/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
},
"scripts": {
"check-attw": "../../../scripts/build_common/check-attw.sh esm",
"check-spelling": "cspell --quiet .",
"clean": "rm -rf lib dist types build tsconfig.tsbuildinfo",
"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)",
Expand Down
2 changes: 1 addition & 1 deletion examples-extra/docs_example/src/osdkExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
6 changes: 3 additions & 3 deletions examples-extra/one_dot_one/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@

### Patch Changes

- f3120fb: Move 2.0 client into @osdk/client to fix typescript 4.9 compatability in @osdk/api"
- f3120fb: Move 2.0 client into @osdk/client to fix typescript 4.9 compatibility in @osdk/api"
- 848404c: Handle conflicts between object, action, and query names
- Updated dependencies [f3120fb]
- Updated dependencies [848404c]
Expand Down Expand Up @@ -131,7 +131,7 @@

### Patch Changes

- 70719db: Fixing nits, and adding support for legacy reservered word backcompat
- 70719db: Fixing nits, and adding support for legacy reserved word back-compat
- Updated dependencies [70719db]
- @osdk/generator@0.0.5
- @osdk/legacy-client@0.0.5
Expand All @@ -150,7 +150,7 @@

### Patch Changes

- a2b7874: Addin TimeSeries support and fixing issues during code-gen time with Queries
- a2b7874: Add in TimeSeries support and fixing issues during code-gen time with Queries
- Updated dependencies [a2b7874]
- @osdk/legacy-client@0.0.3
- @osdk/generator@0.0.3
Expand Down
1 change: 1 addition & 0 deletions examples-extra/one_dot_one/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
},
"scripts": {
"check-attw": "../../scripts/build_common/check-attw.sh both",
"check-spelling": "cspell --quiet .",
"clean": "rm -rf lib dist types build tsconfig.tsbuildinfo",
"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)",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Auth as OG_Auth } from '@osdk/legacy-client';

/** @deprecated submodule imports arent public api **/
/** @deprecated submodule imports aren't public api **/
export type Auth = OG_Auth;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConfidentialClientAuth as OG_ConfidentialClientAuth } from '@osdk/legacy-client';

/** @deprecated submodule imports arent public api **/
/** @deprecated submodule imports aren't public api **/
export const ConfidentialClientAuth = OG_ConfidentialClientAuth;
Loading

0 comments on commit 5647d2c

Please sign in to comment.