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 18, 2024
1 parent 280e70c commit 4492666
Show file tree
Hide file tree
Showing 201 changed files with 1,539 additions and 566 deletions.
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: pnpm exec turbo run ci:cspell

changesets:
name: Check for changesets
if: ${{ github.event_name == 'pull_request' }}
Expand Down
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 {
"packages/monorepo.*/**/*.{js,jsx,ts,tsx,mjs,cjs}": [
"dprint fmt",
CSPELL_CMD,
],
"*.md": [CSPELL_CMD],
"packages/**/*.{js,jsx,ts,tsx,mjs,cjs}": (
files,
) => {
Expand All @@ -30,9 +34,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 @@ -40,6 +40,7 @@ const nonStandardPackages = [
"@osdk/e2e.generated.*", // generated sdks for e2e testing
"@osdk/shared.client",
"@osdk/create-app.template.*",
"@osdk/monorepo.cspell",
"@osdk/tests.*",
];

Expand Down Expand Up @@ -287,6 +288,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");

This file was deleted.

This file was deleted.

This file was deleted.

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

This file was deleted.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"check-mrl": "mrl check --verbose",
"ci:publish": "./scripts/ci-publish.sh",
"ci:publishSnapshot": "pnpm run prePublish && pnpm exec changeset version --snapshot && pnpm exec changeset publish --no-git-tag --snapshot --tag=next",
"cspell:all": "cspell . --quiet",
"lint": "turbo run lint",
"postVersionCmd": "turbo run postVersioning && turbo codegen",
"prePublish": "turbo build && turbo lint",
Expand All @@ -25,11 +26,13 @@
"@monorepolint/config": "0.5.0-beta.10",
"@monorepolint/core": "0.5.0-beta.10",
"@monorepolint/rules": "0.5.0-beta.10",
"@osdk/monorepo.cspell": "workspace:~",
"@osdk/monorepo.tsconfig": "workspace:~",
"@osdk/monorepo.tsup": "workspace:~",
"@types/lint-staged": "^13.3.0",
"@typescript-eslint/parser": "^7.16.0",
"babel-plugin-dev-expression": "^0.2.3",
"cspell": "^8.11.0",
"dprint": "^0.45.1",
"esbuild-plugin-babel": "^0.2.3",
"eslint": "^9.3.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,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 @@ -164,7 +164,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

## 0.0.6

Expand Down
1 change: 1 addition & 0 deletions packages/api/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",
"fix-lint": "eslint . --fix && dprint fmt --config $(find-up dprint.json)",
"lint": "eslint . && dprint check --config $(find-up dprint.json)",
Expand Down
1 change: 1 addition & 0 deletions packages/cli.cmd.typescript/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
1 change: 1 addition & 0 deletions packages/cli.common/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
2 changes: 1 addition & 1 deletion packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,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
1 change: 1 addition & 0 deletions packages/cli/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",
"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 @@ -80,7 +80,7 @@ export default async function siteDeployCommand(
clientCtx,
application,
siteVersion,
Readable.toWeb(archive) as ReadableStream<any>, // This cast is because the dom fetch doesnt align type wise with streams
Readable.toWeb(archive) as ReadableStream<any>, // This cast is because the dom fetch doesn't align type wise with streams
),
archive.finalize(),
]);
Expand Down
Loading

0 comments on commit 4492666

Please sign in to comment.