diff --git a/packages/builder/src/helperStores.js b/packages/builder/src/helpers/fetchData.js similarity index 93% rename from packages/builder/src/helperStores.js rename to packages/builder/src/helpers/fetchData.js index 52dd625937..0275230dc4 100644 --- a/packages/builder/src/helperStores.js +++ b/packages/builder/src/helpers/fetchData.js @@ -1,7 +1,7 @@ import { writable } from 'svelte/store' import api from "builderStore/api" -export function fetchData (url) { +export default function (url) { const store = writable({status: 'LOADING', data: {}, error: {}}) async function get() { diff --git a/packages/builder/src/helpers.js b/packages/builder/src/helpers/helpers.js similarity index 99% rename from packages/builder/src/helpers.js rename to packages/builder/src/helpers/helpers.js index 89c7a0a6aa..1fa2399840 100644 --- a/packages/builder/src/helpers.js +++ b/packages/builder/src/helpers/helpers.js @@ -22,3 +22,5 @@ export const capitalise = s => s.substring(0, 1).toUpperCase() + s.substring(1) export const get_name = s => (!s ? "" : last(s.split("/"))) export const get_capitalised_name = name => pipe(name, [get_name, capitalise]) + + diff --git a/packages/builder/src/helpers/index.js b/packages/builder/src/helpers/index.js new file mode 100644 index 0000000000..8649e8c798 --- /dev/null +++ b/packages/builder/src/helpers/index.js @@ -0,0 +1,2 @@ +export { default as fetchData } from './fetchData' +export { buildStyle, convertCamel, pipe, capitalise, get_name, get_capitalised_name } from './helpers' \ No newline at end of file diff --git a/packages/builder/src/helpers/validation/index.js b/packages/builder/src/helpers/validation/index.js new file mode 100644 index 0000000000..77363b89f5 --- /dev/null +++ b/packages/builder/src/helpers/validation/index.js @@ -0,0 +1,2 @@ +export { emailValidator, requiredValidator } from './validators' +export { createValidationStore } from './validation' \ No newline at end of file diff --git a/packages/builder/vite.config.js b/packages/builder/vite.config.js index 77d1eaa7bb..69b5730b5b 100644 --- a/packages/builder/vite.config.js +++ b/packages/builder/vite.config.js @@ -56,10 +56,6 @@ export default ({ mode }) => { find: "actions", replacement: path.resolve("./src/actions"), }, - { - find: "helperStores", - replacement: path.resolve("./src/helperStores"), - }, { find: "helpers", replacement: path.resolve("./src/helpers"),