Skip to content

Commit ec47e76

Browse files
committed
pull request changes
1 parent de75636 commit ec47e76

File tree

3 files changed

+50
-2
lines changed

3 files changed

+50
-2
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules/*
1+
node_modules/*
2+
dist/*

README.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,17 @@ Coming soon.
77

88
## Setup
99

10-
Coming soon.
10+
Setting up Cement on your local machine is easy. There's two folders to look out for. The `lib` folder contains the framework code that compliles into `dist`. The `dist` folder is what you would use in your node_modules folder.
11+
12+
The `debug` folder is its own project running within Cement to test the framework. Here's a quick guide on how to set it up.
13+
14+
1. First of all we need all our dependencies installed.
15+
Run `npm install` in both the root directory and in the `debug` folder.
16+
17+
2. To compile our `lib` folder into `dist` with our config file we have to run `rollup -c` in the root directory.
18+
19+
3. Now let's create a node_module link for Cement. Go to the root folder and run `npm link`, then head to the `dist` folder and run `npm link cement`. This creates a cement folder in your node_modules folder.
20+
21+
4. Lastly go to your `debug` folder and run this command to start the test project `npm start`
22+
23+
Woila! Project should now be running on `http://localhost:8080/`.

lib/index.ts

+34
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,44 @@
1+
<<<<<<< Updated upstream
12
import { ConfigInterface } from './interfaces/config.interface';
23

34
// Heart of Cement
45
export default class Cement {
56
public data: object;
67
public methods: object;
78
public element: string;
9+
=======
10+
import get from 'lodash.get';
11+
import set from 'lodash.set';
12+
13+
import { IConfig, IAnyDictionary } from './types';
14+
import { NoRootException, UndefinedDataReferencedException } from './exceptions';
15+
16+
export default class Cement<
17+
Data extends IAnyDictionary = {},
18+
Methods extends IAnyDictionary = {}
19+
> {
20+
private _data: Data;
21+
public data: Data;
22+
public methods: Methods;
23+
public config: IConfig<Data, Cement['methods']>;
24+
25+
constructor(config: IConfig<Data, Methods>) {
26+
this.config = config;
27+
this.data = new Proxy<Data>(
28+
{ ...config.data },
29+
{
30+
set: (obj, prop: keyof Data, value) => {
31+
obj[prop] = value;
32+
this.render();
33+
return true;
34+
}
35+
},
36+
);
37+
this.methods = config.methods;
38+
this.render();
39+
console.log();
40+
}
41+
>>>>>>> Stashed changes
842

943
public initialRoot: any;
1044

0 commit comments

Comments
 (0)