Skip to content

Commit afb6c2c

Browse files
author
Pierre
authored
Merge branch 'main' into pierre-readme
2 parents a2a05d9 + 4793263 commit afb6c2c

110 files changed

Lines changed: 10064 additions & 4159 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
root = true
3+
4+
[{src,scripts}/**.{ts,json,js}]
5+
end_of_line = crlf
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
indent_style = space
10+
indent_size = 2
11+
max_line_length = 120

.eslintrc.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ module.exports = {
44
'eslint:recommended',
55
'plugin:@typescript-eslint/recommended',
66
'plugin:require-extensions/recommended',
7-
// 'prettier', Since configs and plugins are installed in sub folders, this needs to be defined locally in package.json
7+
'plugin:storybook/recommended',
8+
'plugin:react/recommended',
9+
'plugin:react-hooks/recommended',
810
],
911
ignorePatterns: ['**/node_modules/**', '**/dist/**'],
1012
// parser: '@typescript-eslint/parser', Since configs and plugins are installed in sub folders, this needs to be defined locally in package.json
@@ -18,6 +20,8 @@ module.exports = {
1820
'import/order': 0, // turn off in favor of eslint-plugin-simple-import-sort
1921
'import/no-unresolved': 0,
2022
'import/no-duplicates': 1,
23+
'react/react-in-jsx-scope': 'off',
24+
'react-hooks/exhaustive-deps': 'error',
2125

2226
'sort-imports': 0, // we use eslint-plugin-import instead
2327

@@ -56,4 +60,9 @@ module.exports = {
5660
},
5761
},
5862
],
63+
settings: {
64+
react: {
65+
version: 'detect',
66+
},
67+
},
5968
};

.github/workflows/.publish.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Publish
33
on:
44
workflow_call:
55
inputs:
6+
package:
7+
type: string
8+
required: true
69
branch:
710
type: string
811
default: ${{ github.ref_name }}
@@ -34,12 +37,12 @@ jobs:
3437
run: npm ci
3538

3639
- name: Check version
37-
run: npm run check-version ${{ inputs.expectedVersion }}
40+
run: npm run check-version ${{ inputs.expectedVersion }} ${{ inputs.package }}
3841

3942
- name: Build
40-
run: npm run build
43+
run: npm run build --workspace=@workflowai/${{ inputs.package }}
4144

4245
- name: Publish to NPM
43-
run: npx tsx ./bin/npm-publish --tag=${{ inputs.tag }}
46+
run: npm publish --tag=${{ inputs.tag }} --workspace=@workflowai/${{ inputs.package }} --loglevel=error
4447
env:
4548
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/branches.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: branches
33
on:
44
push:
55
branches:
6-
- "**"
6+
- '**'
77

88
permissions:
99
contents: read

.github/workflows/manual_publish.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/tags.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,32 @@ name: tags
33
on:
44
push:
55
tags:
6-
- 'v*'
6+
- '*@*'
77

88
permissions:
99
contents: read
1010
id-token: write
1111

12+
env:
13+
TAG_NAME: ${{ github.ref_name }}
14+
1215
jobs:
1316
quality:
1417
uses: ./.github/workflows/.quality.yml
1518
secrets: inherit
1619

20+
splits:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Set package and version
24+
run: |
25+
echo "PACKAGE=${TAG_NAME%%@*}" >> $GITHUB_ENV
26+
echo "VERSION=${TAG_NAME#*@}" >> $GITHUB_ENV
1727
publish:
1828
needs: quality
1929
uses: ./.github/workflows/.publish.yml
2030
secrets: inherit
2131
with:
2232
tag: latest
23-
expectedVersion: ${{ github.ref_name }}
33+
expectedVersion: ${{ env.VERSION }}
34+
package: ${{ env.PACKAGE }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ dist/
2121
packages/sandbox/
2222

2323
examples/*.ts
24-
!examples/generated-code.ts
24+
!examples/generated-code.ts
25+
*storybook.log

.prettierrc.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,8 @@
44
"tabWidth": 2,
55
"singleQuote": true,
66
"jsxSingleQuote": true,
7-
"importOrder": [
8-
"^@/(.*)$",
9-
"^../(.*)$",
10-
"^./(.*)$",
11-
"^[./]"
12-
],
7+
"importOrder": ["^@/(.*)$", "^../(.*)$", "^./(.*)$", "^[./]"],
138
"importOrderSeparation": false,
149
"importOrderSortSpecifiers": true,
15-
"plugins": [
16-
"@trivago/prettier-plugin-sort-imports"
17-
]
10+
"plugins": ["@trivago/prettier-plugin-sort-imports"]
1811
}

.storybook/main.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import type { StorybookConfig } from '@storybook/react-vite';
2+
import { dirname, join } from 'path';
3+
import { mergeConfig } from 'vite';
4+
import viteTsConfigPaths from 'vite-tsconfig-paths';
5+
6+
/**
7+
* This function is used to resolve the absolute path of a package.
8+
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
9+
*/
10+
function getAbsolutePath(value: string): any {
11+
return dirname(require.resolve(join(value, 'package.json')));
12+
}
13+
const config: StorybookConfig = {
14+
stories: [
15+
'../stories/**/*.mdx',
16+
'../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)',
17+
],
18+
addons: [
19+
{
20+
name: getAbsolutePath('@storybook/addon-essentials'),
21+
options: {
22+
docs: false,
23+
},
24+
},
25+
],
26+
framework: {
27+
name: getAbsolutePath('@storybook/react-vite'),
28+
options: {},
29+
},
30+
viteFinal: (config) => {
31+
return mergeConfig(config, {
32+
plugins: [viteTsConfigPaths()],
33+
define: {
34+
'process.env': {},
35+
},
36+
});
37+
},
38+
};
39+
export default config;

.storybook/preview.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import type { Preview } from '@storybook/react';
2+
3+
const preview: Preview = {
4+
parameters: {
5+
controls: {
6+
matchers: {
7+
color: /(background|color)$/i,
8+
date: /Date$/i,
9+
},
10+
},
11+
},
12+
};
13+
14+
export default preview;

0 commit comments

Comments
 (0)