Skip to content

Commit

Permalink
Merge branch 'main' into nadro/gh-4441/allow-orbit-in-sketch-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nadr0 authored Jan 14, 2025
2 parents 4811d6e + 8b60f75 commit 97897c1
Show file tree
Hide file tree
Showing 178 changed files with 110,742 additions and 1,260 deletions.
28 changes: 25 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,32 @@
},
"plugins": [
"css-modules",
"jest",
"jsx-a11y",
"react",
"react-hooks",
"suggest-no-throw",
"testing-library",
"@typescript-eslint"
],
"extends": [
"react-app",
"react-app/jest",
"plugin:css-modules/recommended"
"plugin:css-modules/recommended",
"plugin:jsx-a11y/recommended",
"plugin:react-hooks/recommended"
],
"rules": {
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-misused-promises": "error",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-autofocus": "off",
"jsx-a11y/no-noninteractive-element-interactions": "off",
"no-restricted-globals": [
"error",
{
"name": "isNaN",
"message": "Use Number.isNaN() instead."
}
],
"semi": [
"error",
"never"
Expand All @@ -25,6 +41,9 @@
"overrides": [
{
"files": ["e2e/**/*.ts"], // Update the pattern based on your file structure
"extends": [
"plugin:testing-library/react"
],
"rules": {
"suggest-no-throw/suggest-no-throw": "off",
"testing-library/prefer-screen-queries": "off",
Expand All @@ -33,6 +52,9 @@
},
{
"files": ["src/**/*.test.ts"],
"extends": [
"plugin:testing-library/react"
],
"rules": {
"suggest-no-throw/suggest-no-throw": "off",
}
Expand Down
2 changes: 1 addition & 1 deletion .github/ci-cd-scripts/playwright-electron.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if [[ ! -f "test-results/.last-run.json" ]]; then
fi

retry=1
max_retrys=4
max_retrys=5

# retry failed tests, doing our own retries because using inbuilt playwright retries causes connection issues
while [[ $retry -le $max_retrys ]]; do
Expand Down
17 changes: 13 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,36 @@
version: 2
updates:
- package-ecosystem: 'npm' # See documentation for possible values
directory: '/' # Location of package manifests
directories:
- '/'
- '/packages/codemirror-lang-kcl/'
- '/packages/codemirror-lsp-client/'
schedule:
interval: 'weekly'
interval: weekly
day: monday
reviewers:
- franknoirot
- irev-dev
- package-ecosystem: 'github-actions' # See documentation for possible values
directory: '/' # Location of package manifests
schedule:
interval: 'weekly'
interval: weekly
day: monday
reviewers:
- adamchalmers
- jessfraz
- package-ecosystem: 'cargo' # See documentation for possible values
directory: '/src/wasm-lib/' # Location of package manifests
schedule:
interval: 'weekly'
interval: weekly
day: monday
reviewers:
- adamchalmers
- jessfraz
groups:
serde-dependencies:
patterns:
- "serde*"
wasm-bindgen-deps:
patterns:
- "wasm-bindgen*"
32 changes: 32 additions & 0 deletions .github/workflows/codemirror-lang-kcl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CodeMirror Lang KCL

on:
pull_request:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
yarn-unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'

- run: yarn install
working-directory: packages/codemirror-lang-kcl

- run: yarn tsc
working-directory: packages/codemirror-lang-kcl

- name: run unit tests
run: yarn test
working-directory: packages/codemirror-lang-kcl
43 changes: 42 additions & 1 deletion docs/kcl/helix.md

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions docs/kcl/std.json
Original file line number Diff line number Diff line change
Expand Up @@ -75843,7 +75843,6 @@
"required": [
"angleStart",
"axis",
"length",
"radius",
"revolutions"
],
Expand All @@ -75864,9 +75863,10 @@
"type": "boolean"
},
"length": {
"description": "Length of the helix.",
"description": "Length of the helix. This is not necessary if the helix is created around an edge. If not given the length of the edge is used.",
"type": "number",
"format": "double"
"format": "double",
"nullable": true
},
"radius": {
"description": "Radius of the helix.",
Expand Down Expand Up @@ -76962,7 +76962,8 @@
"deprecated": false,
"examples": [
"// Create a helix around the Z axis.\nhelixPath = helix({\n angleStart = 0,\n ccw = true,\n revolutions = 16,\n length = 10,\n radius = 5,\n axis = 'Z'\n})\n\n// Create a spring by sweeping around the helix path.\nspringSketch = startSketchOn('YZ')\n |> circle({ center = [0, 0], radius = 1 }, %)\n// |> sweep({ path = helixPath }, %)",
""
"// Create a helix around an edge.\nhelper001 = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([0, 10], %, $edge001)\n\nhelixPath = helix({\n angleStart = 0,\n ccw = true,\n revolutions = 16,\n length = 10,\n radius = 5,\n axis = edge001\n})\n\n// Create a spring by sweeping around the helix path.\nspringSketch = startSketchOn('XY')\n |> circle({ center = [0, 0], radius = 1 }, %)\n// |> sweep({ path = helixPath }, %)",
"// Create a helix around a custom axis.\nhelixPath = helix({\n angleStart = 0,\n ccw = true,\n revolutions = 16,\n length = 10,\n radius = 5,\n axis = {\n custom = {\n axis = [0, 0, 1.0],\n origin = [0, 0.25, 0]\n }\n }\n})\n\n// Create a spring by sweeping around the helix path.\nspringSketch = startSketchOn('XY')\n |> circle({ center = [0, 0], radius = 1 }, %)\n// |> sweep({ path = helixPath }, %)"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/kcl/types/HelixData.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Data for a helix.
| `revolutions` |`number`| Number of revolutions. | No |
| `angleStart` |`number`| Start angle (in degrees). | No |
| `ccw` |`boolean`| Is the helix rotation counter clockwise? The default is `false`. | No |
| `length` |`number`| Length of the helix. | No |
| `length` |`number`| Length of the helix. This is not necessary if the helix is created around an edge. If not given the length of the edge is used. | No |
| `radius` |`number`| Radius of the helix. | No |
| `axis` |[`Axis3dOrEdgeReference`](/docs/kcl/types/Axis3dOrEdgeReference)| Axis to use as mirror. | No |

Expand Down
5 changes: 5 additions & 0 deletions e2e/playwright/fixtures/fixtureSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,23 @@ export class AuthenticatedTronApp {

export const fixtures = {
cmdBar: async ({ page }: { page: Page }, use: any) => {
// eslint-disable-next-line react-hooks/rules-of-hooks
await use(new CmdBarFixture(page))
},
editor: async ({ page }: { page: Page }, use: any) => {
// eslint-disable-next-line react-hooks/rules-of-hooks
await use(new EditorFixture(page))
},
toolbar: async ({ page }: { page: Page }, use: any) => {
// eslint-disable-next-line react-hooks/rules-of-hooks
await use(new ToolbarFixture(page))
},
scene: async ({ page }: { page: Page }, use: any) => {
// eslint-disable-next-line react-hooks/rules-of-hooks
await use(new SceneFixture(page))
},
homePage: async ({ page }: { page: Page }, use: any) => {
// eslint-disable-next-line react-hooks/rules-of-hooks
await use(new HomePageFixture(page))
},
}
4 changes: 4 additions & 0 deletions e2e/playwright/fixtures/toolbarFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export class ToolbarFixture {

extrudeButton!: Locator
loftButton!: Locator
sweepButton!: Locator
chamferButton!: Locator
shellButton!: Locator
offsetPlaneButton!: Locator
startSketchBtn!: Locator
Expand All @@ -40,6 +42,8 @@ export class ToolbarFixture {
this.page = page
this.extrudeButton = page.getByTestId('extrude')
this.loftButton = page.getByTestId('loft')
this.sweepButton = page.getByTestId('sweep')
this.chamferButton = page.getByTestId('chamfer3d')
this.shellButton = page.getByTestId('shell')
this.offsetPlaneButton = page.getByTestId('plane-offset')
this.startSketchBtn = page.getByTestId('sketch')
Expand Down
Loading

0 comments on commit 97897c1

Please sign in to comment.