Browse Source

Remove old test dir and add yarn lockfile

pull/4023/head
Andrew Kingston 6 years ago
parent
commit
540cb33d09
  1. 1
      packages/standard-components/.gitignore
  2. 6
      packages/standard-components/rollup.config.js
  3. 47
      packages/standard-components/src/tests/TestApp.svelte
  4. 64
      packages/standard-components/src/tests/props.js
  5. 15
      packages/standard-components/src/tests/rootComponent.js
  6. 3
      packages/standard-components/src/tests/testComponents.js
  7. 7
      packages/standard-components/src/tests/testMain.js
  8. 2228
      packages/standard-components/yarn.lock

1
packages/standard-components/.gitignore

@ -1,5 +1,4 @@
.DS_Store
node_modules
yarn.lock
package-lock.json
dist/

6
packages/standard-components/rollup.config.js

@ -1,6 +1,5 @@
import commonjs from "@rollup/plugin-commonjs"
import resolve from "@rollup/plugin-node-resolve"
// import replace from "@rollup/plugin-replace"
import svelte from "rollup-plugin-svelte"
import postcss from "rollup-plugin-postcss"
import { terser } from "rollup-plugin-terser"
@ -29,10 +28,5 @@ export default {
skip: externals,
}),
commonjs(),
// Fix for https://github.com/sveltejs/svelte/issues/3165
// replace({
// "outros.c.push":
// "if (outros === undefined) { block.o(local); return }\noutros.c.push",
// }),
],
}

47
packages/standard-components/src/tests/TestApp.svelte

@ -1,47 +0,0 @@
<script>
import createApp from "./createApp"
import { form } from "./props"
let _bb
let currentComponent
let _appPromise
const autoAssignIds = (props, count = 0) => {
if (!props._id) {
props._id = `auto_id_${count}`
}
if (props._children) {
for (let child of props._children) {
count += 1
autoAssignIds(child, count)
}
}
}
$: {
if (currentComponent) {
const _appPromise = createApp()
const page = {
props: form,
}
autoAssignIds(page.props)
_appPromise.then(initialise => {
initialise(page, currentComponent, "")
})
}
}
</script>
{#await _appPromise}
loading
{:then _}
<div id="current_component" bind:this={currentComponent} />
{/await}
<style>
#current_component {
height: 100%;
width: 100%;
}
</style>

64
packages/standard-components/src/tests/props.js

@ -1,64 +0,0 @@
export const form = {
_id: "1",
_component: "@budibase/standard-components/container",
type: "main",
_children: [
{
_component: "@budibase/standard-components/heading",
type: "h1",
_children: [
{
_component: "@budibase/standard-components/text",
text: "This is an H1 Heading",
},
],
},
{
_component: "@budibase/standard-components/text",
text: "This just some text",
type: "strong",
},
{
_component: "@budibase/standard-components/container",
type: "paragraph",
backgroundColor: "red",
color: "white",
borderStyle: "solid",
borderWidth: "3px",
borderColor: "blue",
_children: [
{
_component: "@budibase/standard-components/text",
formattingTag: "<i>",
text: "some iatlics in a paragraph",
},
],
},
{
_component: "@budibase/standard-components/heading",
type: "h2",
_children: [
{
_component: "@budibase/standard-components/text",
text: "This is an H2 Heading",
},
],
},
{
_component: "@budibase/standard-components/select",
value: "two",
_children: [
{
_component: "@budibase/standard-components/option",
text: "number 1",
value: "one",
},
{
_component: "@budibase/standard-components/option",
text: "number 2",
value: "two",
},
],
},
],
}

15
packages/standard-components/src/tests/rootComponent.js

@ -1,15 +0,0 @@
export const rootComponent = window => {
return function(opts) {
const node = window.document.createElement("DIV")
const $set = props => {
props._bb.attachChildren(node)
}
const $destroy = () => {
if (opts.target && node) opts.target.removeChild(node)
}
this.$set = $set
this.$set(opts.props)
this.$destroy = $destroy
opts.target.appendChild(node)
}
}

3
packages/standard-components/src/tests/testComponents.js

@ -1,3 +0,0 @@
import * as components from "../index"
export default components

7
packages/standard-components/src/tests/testMain.js

@ -1,7 +0,0 @@
import App from "./TestApp.svelte"
const app = new App({
target: document.body,
})
export default app

2228
packages/standard-components/yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save