Skip to content

Commit 42e00b7

Browse files
committed
Starting out
0 parents  commit 42e00b7

Some content is hidden

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

59 files changed

+17352
-0
lines changed

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* text=auto
2+
3+
*.ts text eol=lf
4+
*.json text eol=lf
5+
*.md text eol=lf

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
node_modules
2+
*.log
3+
lib
4+
dist
5+
test-lib/**/*.js
6+
coverage
7+
.nyc_output
8+
.idea
9+
package-lock.json
10+
.prettierignore
11+
.vscode
12+
.editorconfig

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"printWidth": 100,
3+
"tabWidth": 4,
4+
"singleQuote": false,
5+
"trailingComma": "none",
6+
"semi": false
7+
}

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
language: node_js
2+
cache: yarn
3+
script:
4+
- # TODO
5+
node_js:
6+
- "node"

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Steve Sewell
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Builder
2+
3+
Drag and drop page building for any website. Use your React components, publish remotely
4+
5+
[gif with hot reload]
6+
7+
## What is it good for?
8+
9+
- Landing pages
10+
- Documentation
11+
- Blogging
12+
- Marketing pages (homepage, etc)
13+
- Content pages (about, FAQ, etc)
14+
- Optimization (ab test pages)
15+
- Marketing teams that never stop asking for changes
16+
- Developers who are tired of pushing pixels
17+
18+
19+
## Getting Started
20+
21+
```sh
22+
npm install --save @builder.io/react
23+
```
24+
25+
Create a free account at [builder.io](https://builder.io) and grab your [API key](https://builder.io/account/organization)
26+
27+
```ts
28+
import { builder, BuilderComponent } from '@builder.io/react'
29+
30+
builder.init(YOUR_KEY)
31+
```
32+
33+
Then in your router
34+
```tsx
35+
<Route path="/something" render={() => <BuilderComponent model="page" />}>
36+
```
37+
38+
Create a new page and open your-dev-url:port/something and edit
39+
40+
[gif]
41+
42+
### Using your components
43+
44+
Wrap a component
45+
46+
```tsx
47+
import { BuilderBlock } from '@builder.io/react'
48+
49+
@BuilderBlock({
50+
name: 'Simple Text',
51+
inputs: [{ name: 'text', type: 'string' }]
52+
})
53+
export class SimpleText extends React.Component {
54+
render() {
55+
return <h1>{this.props.text}</h1>
56+
}
57+
}
58+
```
59+
60+
Then back at your page
61+
62+
```tsx
63+
import './simple-page'
64+
65+
// ...
66+
67+
<Route path="/something" render={() => <BuilderComponent model="page">}>
68+
```
69+
70+
Open the dashboard and use it
71+
72+
[gif]
73+
74+
More docs on builder APIs and such at [builder.io/c/docs](https://builder.io/c/docs)
75+
76+
For Builder decorator support you need to be using typescript or babel with legacy decorators.
77+
Alternatively you can use the alternative syntax:
78+
79+
```tsx
80+
import { builderBlocks } from '@builder.io/react'
81+
82+
class SimpleText extends React.Component {
83+
render() {
84+
return <h1>{this.props.text}</h1>
85+
}
86+
}
87+
88+
builderBlocks.add(SimpleText, {
89+
name: 'Simple Text',
90+
inputs: [{ name: 'text', type: 'string' }]
91+
})
92+
```
93+
94+
95+
96+
## Troubleshooting and feedback
97+
98+
Problems? Requests? Open an issue. Always want feedback, interesting new use cases, happy to help.

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "@builder.io/builder",
3+
"private": true,
4+
"dependencies": {},
5+
"devDependencies": {},
6+
"scripts": {}
7+
}

packages/react/.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
node_modules
2+
coverage
3+
.nyc_output
4+
.DS_Store
5+
*.log
6+
.vscode
7+
.idea
8+
dist
9+
compiled
10+
.awcache
11+
.rpt2_cache
12+
docs

packages/react/.npmignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
node_modules
2+
coverage
3+
.nyc_output
4+
.DS_Store
5+
*.log
6+
.vscode
7+
.idea
8+
compiled
9+
.awcache
10+
.rpt2_cache
11+
docs
12+
/src

packages/react/.travis.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
language: node_js
2+
branches:
3+
only:
4+
- master
5+
- /^greenkeeper/.*$/
6+
cache:
7+
yarn: true
8+
directories:
9+
- node_modules
10+
notifications:
11+
email: false
12+
node_js:
13+
- node
14+
script:
15+
- npm run test:prod && npm run build
16+
after_success:
17+
- npm run report-coverage
18+
- npm run deploy-docs
19+
- npm run semantic-release

0 commit comments

Comments
 (0)