Skip to content

Commit 2cea248

Browse files
Separate playground from former (#82)
Co-authored-by: mariusheine <[email protected]>
1 parent 1478466 commit 2cea248

32 files changed

+326
-356
lines changed

.github/workflows/playground.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ jobs:
2121
with:
2222
version: 9
2323
run_install: true
24-
- run: pnpm -r build:playground --base './'
24+
- name: Build
25+
run: pnpm build
2526
- name: Upload Pages artifact
2627
uses: actions/upload-pages-artifact@v3
2728
with:
28-
path: packages/former/dist-playground
29+
path: packages/playground/dist
2930

3031
deploy:
3132
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

.github/workflows/tests.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ jobs:
3232
with:
3333
version: 9
3434
run_install: true
35-
- run: pnpm test
35+
- run: pnpm build
36+
- run: pnpm typecheck
3637

3738
unit-test:
3839
name: Unit Tests

packages/former/index.html

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

packages/former/package.json

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,9 @@
1313
"form-builder",
1414
"forms"
1515
],
16-
"exports": {
17-
".": {
18-
"types": "./dist/former/src/index.d.ts",
19-
"import": "./dist/index.js",
20-
"require": "./dist/index.umd.cjs"
21-
}
22-
},
2316
"main": "./dist/index.umd.cjs",
2417
"module": "./dist/index.js",
25-
"types": "./dist/former/src/index.d.ts",
18+
"types": "./dist/index.d.ts",
2619
"files": [
2720
"README.md",
2821
"dist"
@@ -32,13 +25,10 @@
3225
"node": ">=22.0.0"
3326
},
3427
"scripts": {
35-
"dev": "vite",
3628
"build": "vite build",
3729
"prepack": "pnpm build",
3830
"test": "vitest --pass-with-no-tests",
39-
"typecheck": "vue-tsc --build --force",
40-
"build:playground": "vite build --config vite.config.playground.ts",
41-
"preview:playground": "vite preview --config vite.config.playground.ts"
31+
"typecheck": "vue-tsc --build --force"
4232
},
4333
"peerDependencies": {
4434
"vue": "^3.0.0"
@@ -61,6 +51,6 @@
6151
"vite-plugin-dts": "4.3.0",
6252
"vitest": "2.1.9",
6353
"vue": "3.5.13",
64-
"vue-tsc": "2.1.10"
54+
"vue-tsc": "3.0.7"
6555
}
6656
}

packages/former/src/compositions/injectProvide.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { getCurrentInstance, type InjectionKey, type Ref, inject as vueInject, p
44
export type InjectKeys = {
55
mode: Ref<Mode>;
66
formId: Ref<string>;
7+
formerIsUpdating: Ref<boolean>;
78
schema: Ref<InternalSchemaNode[]>;
89
data: Ref<FormData | FieldData>;
910
components: FormComponents;

packages/former/src/index.ts

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
1-
import type { FieldData, FormComponents, FormData, FormerProps, FormFieldType, Mode, SchemaNode, ShowIfPredicate, Validator } from '~/types';
2-
3-
import FormAdd from '~/components/FormAdd.vue';
4-
import FormContent from '~/components/FormContent.vue';
5-
import Former from '~/components/Former.vue';
6-
import FormNodeProps from '~/components/FormNodeProps.vue';
7-
import FormRenderer from '~/components/FormRenderer.vue';
8-
import FormDataProvider from './components/FormDataProvider.vue';
91
import './index.css';
102

11-
export {
12-
type FieldData,
13-
FormAdd,
14-
type FormComponents,
15-
FormContent,
16-
type FormData,
17-
FormDataProvider,
18-
Former,
19-
type FormerProps,
20-
type FormFieldType,
21-
FormNodeProps,
22-
FormRenderer,
23-
type Mode,
24-
type SchemaNode,
25-
type ShowIfPredicate,
26-
type Validator,
27-
};
3+
export { default as FormAdd } from './components/FormAdd.vue';
4+
export { default as FormContent } from './components/FormContent.vue';
5+
export { default as FormDataProvider } from './components/FormDataProvider.vue';
6+
export { default as Former } from './components/Former.vue';
7+
export { default as FormNodeProps } from './components/FormNodeProps.vue';
8+
export { default as FormRenderer } from './components/FormRenderer.vue';
9+
10+
export type {
11+
FieldData,
12+
FormComponents,
13+
FormData,
14+
FormerProps,
15+
FormFieldType,
16+
Mode,
17+
SchemaNode,
18+
ShowIfPredicate,
19+
Validator,
20+
} from './types';

packages/former/src/sample/Checkbox.vue

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

packages/former/vite.config.playground.ts

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

packages/former/vite.config.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@ export default defineConfig({
3838
globals: {
3939
vue: 'Vue',
4040
},
41-
assetFileNames: (chunkInfo) => {
42-
if (chunkInfo.name === 'style.css') {
43-
return 'index.css';
44-
};
45-
return chunkInfo.name as string;
46-
},
4741
},
4842
},
4943
},

packages/playground/env.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/// <reference types="vite/client" />
2+
declare module '*.vue' {
3+
import type { DefineComponent } from 'vue';
4+
5+
const component: DefineComponent;
6+
export default component;
7+
}

0 commit comments

Comments
 (0)