-
Notifications
You must be signed in to change notification settings - Fork 7
Create monorepo and typeScript react base project #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b031f32
dc72eb2
f9142aa
3d9cfcc
7dc0b87
8f67689
130d375
3f2def2
b673547
f7de5f6
01e7d27
47c1329
be9b489
6b2efdf
3551bc6
c41482b
17a5d47
fa8522a
43c5c79
ffd9383
c007a9d
9dac815
e530668
7f73cb3
2cf3c6a
5425f39
e85b2e4
406d8fc
6f57688
321414b
210ce40
aa6e562
cd606df
b2412e0
4c50c14
38137b3
c689b19
aee6ce6
8f6da0e
ecb0b49
7f34832
b615ca3
8038953
972f68a
27d1ce6
3178886
ed75c88
b598631
ac8cfb6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #!/bin/sh | ||
| # | ||
| # Copyright 2026 The Serverless Workflow Specification Authors | ||
| # | ||
| # 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. | ||
| # | ||
|
|
||
| pnpm exec lint-staged |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ignore-workspace-root-check=true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "$schema": "./node_modules/oxfmt/configuration_schema.json", | ||
| "ignorePatterns": [] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "$schema": "https://oxc.rs/schema/oxlintrc.json", | ||
| "plugins": ["react", "typescript", "import", "jsx-a11y"], | ||
| "rules": { | ||
| "react/react-in-jsx-scope": "off", | ||
| "typescript/no-unused-vars": ["warn", { "varsIgnorePattern": "^_" }], | ||
| "typescript/no-explicit-any": "warn" | ||
| }, | ||
| "ignorePatterns": ["**/dist/", "**/dist-storybook/", "**/node_modules/"] | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,9 +1,9 @@ | ||||||||||||||||
| .gitattributes | ||||||||||||||||
| .npmrc | ||||||||||||||||
| .prettierignore | ||||||||||||||||
| .rat-excludes | ||||||||||||||||
| .rat-reports | ||||||||||||||||
| pnpm-lock.yaml | ||||||||||||||||
| pnpm-workspace.yaml | ||||||||||||||||
| repo/graph.dot | ||||||||||||||||
| repo/repo.iml | ||||||||||||||||
|
|
||||||||||||||||
handreyrc marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||
| packages/serverless-workflow-diagram-editor/stories/assets/**/*.png | |
| packages/serverless-workflow-diagram-editor/stories/assets/**/*.avif | |
| packages/serverless-workflow-diagram-editor/stories/assets/**/*.jpg | |
| packages/serverless-workflow-diagram-editor/stories/assets/**/*.jpeg | |
| packages/serverless-workflow-diagram-editor/stories/assets/**/*.gif | |
| packages/serverless-workflow-diagram-editor/stories/assets/**/*.webp |
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -3,23 +3,40 @@ | |||
| "version": "0.0.0", | ||||
| "private": true, | ||||
| "description": "CNCF Serverless Workflow Specification Visual Editor", | ||||
| "homepage": "https://github.com/serverlessworkflow/editor", | ||||
| "bugs": { | ||||
| "url": "https://github.com/serverlessworkflow/editor/issues" | ||||
| }, | ||||
| "license": "Apache-2.0", | ||||
| "repository": { | ||||
| "type": "git", | ||||
| "url": "https://github.com/serverlessworkflow/editor.git" | ||||
| }, | ||||
| "type": "module", | ||||
| "scripts": { | ||||
| "dependencies:check": "syncpack lint", | ||||
| "dependencies:fix": "syncpack fix", | ||||
| "format": "oxfmt --config .oxfmtrc.json", | ||||
| "format:check": "oxfmt --config .oxfmtrc.json --check", | ||||
| "build:prod": "pnpm -r --stream --if-present build:prod", | ||||
| "build:dev": "pnpm -r --stream --if-present build:dev", | ||||
| "prepare": "husky" | ||||
| }, | ||||
| "devDependencies": { | ||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing root test/lint/(start) scripts?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @JBBianchi , ok for test and lint, but because this monorepo will probably host multiple packages, I think
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could, we could also have a root |
||||
| "husky": "^9.1.7", | ||||
| "syncpack": "^14.2.0" | ||||
| "husky": "catalog:", | ||||
| "lint-staged": "catalog:", | ||||
| "oxfmt": "catalog:", | ||||
| "syncpack": "catalog:", | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure we need syncpack right now? Considering its a new, small repo and that we now have pnpm catalogs I think we could leave syncpack out and add it in the future if we really see a need? Considering pnpm catalogs gives us shared versions for the repo I think it will be much easier to manage, what do you think?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree catalogs are a great default and probably enough for now. The only concern I have is that they don’t enforce usage. Someone could still accidentally install a different version instead of using That’s where syncpack could help as a lightweight safety net (e.g. catching mismatches in CI). That said, I’m also fine keeping things simple for now and adding it later if we start seeing that kind of drift, I just wanted to call out the tradeoff.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It wasn't added in this PR, I only updated the settings to match the catalog approach. To not mix things, I recommend removing it in other PR if that's the case.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Im happy to leave in, im new to pnpm catalogs (very nice by the way) but its good to stay safe based on above. Thanks for the input!
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @handreyrc @JBBianchi @lornakelly
Having two different versions of the same dependency across two packages, even if they differ only by a patch version, can lead to strange behaviour and can be difficult to debug. I remember this happened to the team and me before in another pnpm monorepo. On the other hand, this does not increase the bundle size, and it is a very quick check in CI. Please feel free to share your viewpoint on these points.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the additional info Fabrizio! |
||||
| "typescript": "catalog:" | ||||
| }, | ||||
| "lint-staged": { | ||||
| "*.{ts,tsx,js,jsx,json,md,yml,yaml}": [ | ||||
| "pnpm format" | ||||
handreyrc marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
| ] | ||||
handreyrc marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
| }, | ||||
| "engines": { | ||||
| "node": ">=24" | ||||
| } | ||||
| "node": ">=22", | ||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Root doesn't declare @types/node. The linter package uses ^22.10.2, diagram-editor uses ^25.3.3. These should be consistent. Consider pnpm catalogs?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I created an issue to develop a dependency consistency check CI, to have this check in our PRs:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The use of pnpm catalogs is awesome. Thanks @JBBianchi for the tip |
||||
| "pnpm": "10.31.0" | ||||
| }, | ||||
| "packageManager": "pnpm@10.31.0" | ||||
| } | ||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "extends": ["../../.oxfmtrc.json"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "extends": ["../../.oxlintrc.json"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| /* | ||
| * Copyright 2021-Present The Serverless Workflow Specification Authors | ||
| * | ||
| * 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. | ||
| */ | ||
|
|
||
| import type { StorybookConfig } from "@storybook/react-vite"; | ||
|
|
||
| const config: StorybookConfig = { | ||
| typescript: { | ||
| check: true, | ||
| }, | ||
| core: { | ||
| disableTelemetry: true, // Do not collect data | ||
| }, | ||
| stories: ["../stories/**/*.mdx", "../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)"], | ||
| addons: ["@chromatic-com/storybook", "@storybook/addon-vitest", "@storybook/addon-a11y", "@storybook/addon-docs"], | ||
| framework: "@storybook/react-vite", | ||
| }; | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| /* | ||
| * Copyright 2021-Present The Serverless Workflow Specification Authors | ||
| * | ||
| * 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. | ||
| */ | ||
|
|
||
| import type { Preview } from "@storybook/react-vite"; | ||
|
|
||
| const preview: Preview = { | ||
| parameters: { | ||
| controls: { | ||
| matchers: { | ||
| color: /(background|color)$/i, | ||
| date: /Date$/i, | ||
| }, | ||
| }, | ||
|
|
||
| a11y: { | ||
| // 'todo' - show a11y violations in the test UI only | ||
| // 'error' - fail CI on a11y violations | ||
| // 'off' - skip a11y checks entirely | ||
| test: "todo", | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| export default preview; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /* | ||
| * Copyright 2021-Present The Serverless Workflow Specification Authors | ||
| * | ||
| * 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. | ||
| */ | ||
|
|
||
| import * as a11yAddonAnnotations from "@storybook/addon-a11y/preview"; | ||
| import { setProjectAnnotations } from "@storybook/react-vite"; | ||
| import * as projectAnnotations from "./preview"; | ||
|
|
||
| // This is an important step to apply the right configuration when testing your stories. | ||
| // More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations | ||
| setProjectAnnotations([a11yAddonAnnotations, projectAnnotations]); |
Uh oh!
There was an error while loading. Please reload this page.