Skip to content

Commit 8f32666

Browse files
authored
chore: Merge PR #54 from feat/use-form-state
2 parents 7b2ba82 + 4e29072 commit 8f32666

File tree

172 files changed

+3586
-2070
lines changed

Some content is hidden

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

172 files changed

+3586
-2070
lines changed

.github/workflows/chromatic.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: 'Check out Git repository'
14-
uses: actions/checkout@v1
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
1517

1618
- name: 'Check secrets'
1719
id: check-secrets
@@ -21,7 +23,7 @@ jobs:
2123

2224
- name: Setup Node
2325
if: ${{ steps.check-secrets.outputs.has-secrets == 'true' }}
24-
uses: actions/setup-node@v2
26+
uses: actions/setup-node@v4
2527
with:
2628
node-version: 18.x
2729
cache: yarn

.github/workflows/eas.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- name: Check out Git repository
9-
uses: actions/checkout@v2
9+
uses: actions/checkout@v4
1010

1111
- name: 'Check secrets'
1212
id: check-secrets
@@ -20,7 +20,7 @@ jobs:
2020

2121
- name: Setup Node
2222
if: ${{ steps.check-secrets.outputs.has-secrets == 'true' }}
23-
uses: actions/setup-node@v2
23+
uses: actions/setup-node@v4
2424
with:
2525
node-version: 18.x
2626
cache: yarn
@@ -38,15 +38,15 @@ jobs:
3838
- name: Find yarn cache
3939
id: yarn-cache-path
4040
if: ${{ steps.check-secrets.outputs.has-secrets == 'true' }}
41-
run: echo "::set-output name=dir::$(yarn cache dir)"
42-
43-
- name: Restore cache
44-
if: ${{ steps.check-secrets.outputs.has-secrets == 'true' }}
45-
uses: actions/cache@v2
46-
with:
47-
path: ${{ steps.yarn-cache-path.outputs.dir }}
48-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
49-
restore-keys: ${{ runner.os }}-yarn-
41+
run: echo "{dir}={dir::$(yarn cache dir)} >> $GITHUB_OUTPUT"
42+
43+
# - name: Restore cache
44+
# if: ${{ steps.check-secrets.outputs.has-secrets == 'true' }}
45+
# uses: actions/cache@v2
46+
# with:
47+
# path: ${{ steps.yarn-cache-path.outputs.dir }}
48+
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
49+
# restore-keys: ${{ runner.os }}-yarn-
5050

5151
- name: Install Node.js dependencies
5252
if: ${{ steps.check-secrets.outputs.has-secrets == 'true' }}

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ jobs:
55
runs-on: ubuntu-latest
66
steps:
77
- name: Check out Git repository
8-
uses: actions/checkout@v2
8+
uses: actions/checkout@v4
99

1010
- name: Setup Node
11-
uses: actions/setup-node@v2
11+
uses: actions/setup-node@v4
1212
with:
1313
node-version: 18.x
1414
cache: yarn

.storybook/disabled/@aetherspace-mongoose/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ git merge with/mongoose
2929

3030
```tsx
3131
import { z, aetherSchema } from 'aetherspace/schemas'
32-
import { aetherSchemaToMongoose } from '@aetherspace/mongoose/schemas'
32+
import { createMongooseDataModel } from '@aetherspace/mongoose/schemas'
3333

3434
/* --- Schemas ---- */
3535

@@ -40,20 +40,20 @@ const MyCollectionSchema = aetherSchema('MyCollection', {
4040

4141
/* --- Models ----- */
4242

43-
export const MyCollectionModel = aetherSchemaToMongoose(MyCollectionSchema)
43+
export const MyCollectionModel = createMongooseDataModel(MyCollectionSchema)
4444

4545
```
4646

4747
> However, it's recommended to define your schemas and models in separate files. Otherwise, importing the schema from the same file as the model might cause front-end issues.
4848
4949
`/features/{workspace}/schemas/models.ts`
5050
```tsx
51-
import { aetherSchemaToMongoose } from '@aetherspace/mongoose/schemas'
51+
import { createMongooseDataModel } from '@aetherspace/mongoose/schemas'
5252
import { MyCollectionSchema } from './MyCollectionSchema.ts' // <- Much safer
5353
5454
/* --- Models ----- */
5555

56-
export const MyCollectionModel = aetherSchemaToMongoose(MyCollectionSchema)
56+
export const MyCollectionModel = createMongooseDataModel(MyCollectionSchema)
5757
```
5858

5959
## Roadmap - More to come

.storybook/docs/Automation.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ import AutomationReadme from '../../packages/@aetherspace/scripts/README.md'
66
<StorybookLinkTransformer />
77
<StorybookFontTransformer />
88

9-
<Meta title="Aetherspace / Automation" />
9+
<Meta title="Aetherspace / Recommended Workflow" />
1010

1111
<AutomationReadme />

.storybook/docs/Forms.stories.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Meta } from '@storybook/addon-docs'
2+
import StorybookLinkTransformer from '../../packages/@aetherspace/docs/helpers/StorybookLinkTransformer'
3+
import StorybookFontTransformer from '../../packages/@aetherspace/docs/helpers/StorybookFontTransformer'
4+
import FormManagementMD from '../../packages/@aetherspace/forms/README.md'
5+
6+
<StorybookLinkTransformer />
7+
<StorybookFontTransformer />
8+
9+
<Meta title="Aetherspace / Form Management" />
10+
11+
<FormManagementMD />

.storybook/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ module.exports = {
1111
'./docs/Styling.stories.mdx',
1212
'./docs/UniversalRouting.stories.mdx',
1313
'./docs/GraphQL.stories.mdx',
14-
'./docs/Automation.stories.mdx',
14+
'./docs/Forms.stories.mdx',
1515
'./docs/Icons.stories.mdx',
16+
'./docs/Automation.stories.mdx',
1617
'./docs/Deployment.stories.mdx',
1718
'./plugins/README.stories.mdx',
1819
'./other/License.stories.mdx',

.storybook/manager-head.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,27 @@
1616
height: 100%;
1717
}
1818
</style>
19+
<script>
20+
// Add a listener to switch back from the GraphQL tab to the Canvas when the user clicks on the sidebar
21+
setTimeout(() => {
22+
const $sidebar = document.querySelector('.sidebar-container')
23+
console.log('StorybookLinkTransformer', { $sidebar })
24+
if ($sidebar) {
25+
$sidebar.addEventListener('click', () => {
26+
// Extract the current story ID from the URL
27+
const urlParams = new URLSearchParams(window.location.search)
28+
const path = urlParams.get('path')
29+
const isGraphqlTab = path && path.includes('graphql')
30+
31+
// Construct the new URL for the Canvas tab
32+
const newUrl = window.location.href.replace('/graphql/', '/story/')
33+
34+
// Push the new URL to the history
35+
window.history.pushState({}, '', newUrl)
36+
37+
// Optionally, force Storybook to re-render
38+
window.dispatchEvent(new PopStateEvent('popstate'))
39+
})
40+
}
41+
}, 3000)
42+
</script>

.storybook/public/add-resolver.png

125 KB
Loading

.storybook/public/add-route.png

97.6 KB
Loading

0 commit comments

Comments
 (0)