Skip to content

Commit

Permalink
Merge branch 'release/v1.0.2' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-lebleu committed Apr 15, 2021
2 parents 8b37ebf + 3059375 commit d3ebac5
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 18 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

## [v1.0.1](https://github.com/konfer-be/cliam/compare/v1.0.0...v1.0.1)
## [v1.0.2](https://github.com/konfer-be/cliam/compare/v1.0.1...v1.0.2)

### Commits

- Templates relative path [`cfbc4b6`](https://github.com/konfer-be/cliam/commit/cfbc4b6b37d0c0251aeb1e0f994263b3a2408332)

## [v1.0.1](https://github.com/konfer-be/cliam/compare/v1.0.0...v1.0.1) - 2021-04-15

### Commits

- Remove typescript paths [`a917877`](https://github.com/konfer-be/cliam/commit/a917877435d28b59f61181cb2c93009589c71844)
- Update NPM dependencies [`f488bda`](https://github.com/konfer-be/cliam/commit/f488bda78965c51801d895b2c3adfe1eb091746a)
- Update changelog [`4a0dfbb`](https://github.com/konfer-be/cliam/commit/4a0dfbb9a8cacedd1a8dfdd1285fb60321ee66f2)

## v1.0.0 - 2021-04-15

Expand Down
6 changes: 4 additions & 2 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Roadmap

- [ ] **v1.0.1**
- [ ] **v1.0.3**
- [ ] Headers images
- [ ] Integration HTML/CSS for all transactions. Factored code. 4 colours

- [ ] Export views in lib
- [ ] Check meta.to validation

- [ ] **v1.1.0**
- [ ] Check / sanitize payloads
- [ ] Support inlines images
Expand Down
14 changes: 7 additions & 7 deletions lib/services/compiler.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ class Compiler {
/**
* @description
*/
this.LAYOUT = '/src/views/layouts/default.hbs';
this.LAYOUT = '/../../src/views/layouts/default.hbs';
/**
* @description
*/
this.PARTIALS = '/src/views/partials/';
this.PARTIALS = '/../../src/views/partials';
/**
* @description
*/
this.BLOCKS = '/src/views/blocks/';
this.BLOCKS = '/../../src/views/blocks';
/**
* @description
*/
Expand Down Expand Up @@ -101,10 +101,10 @@ class Compiler {
});
}
data.banner = this.getBanner(event);
Hbs.handlebars.registerPartial('header', Hbs.handlebars.compile(fs_1.readFileSync(`${process.cwd()}${this.PARTIALS}/header.hbs`, { encoding: 'utf-8' }))(container_service_1.Container.configuration.consumer));
Hbs.handlebars.registerPartial('body', Hbs.handlebars.compile(fs_1.readFileSync(`${process.cwd()}${this.BLOCKS}/${this.getSegment(event)}.hbs`, { encoding: 'utf-8' }))(data));
Hbs.handlebars.registerPartial('footer', Hbs.handlebars.compile(fs_1.readFileSync(`${process.cwd()}${this.PARTIALS}/footer.hbs`, { encoding: 'utf-8' }))(container_service_1.Container.configuration.consumer));
const html = Hbs.handlebars.compile(fs_1.readFileSync(`${process.cwd()}${this.LAYOUT}`, { encoding: 'utf-8' }))(data);
Hbs.handlebars.registerPartial('header', Hbs.handlebars.compile(fs_1.readFileSync(`${__dirname}${this.PARTIALS}/header.hbs`, { encoding: 'utf-8' }))(container_service_1.Container.configuration.consumer));
Hbs.handlebars.registerPartial('body', Hbs.handlebars.compile(fs_1.readFileSync(`${__dirname}${this.BLOCKS}/${this.getSegment(event)}.hbs`, { encoding: 'utf-8' }))(data));
Hbs.handlebars.registerPartial('footer', Hbs.handlebars.compile(fs_1.readFileSync(`${__dirname}${this.PARTIALS}/footer.hbs`, { encoding: 'utf-8' }))(container_service_1.Container.configuration.consumer));
const html = Hbs.handlebars.compile(fs_1.readFileSync(`${__dirname}${this.LAYOUT}`, { encoding: 'utf-8' }))(data);
return {
text: this.textify(html),
html: this.customize(html)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cliam",
"version": "1.0.1",
"version": "1.0.2",
"engines": {
"node": ">=14.16"
},
Expand Down
14 changes: 7 additions & 7 deletions src/services/compiler.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ class Compiler {
/**
* @description
*/
private readonly LAYOUT: string = '/src/views/layouts/default.hbs';
private readonly LAYOUT: string = '/../../src/views/layouts/default.hbs';

/**
* @description
*/
private readonly PARTIALS: string = '/src/views/partials/';
private readonly PARTIALS: string = '/../../src/views/partials';

/**
* @description
*/
private readonly BLOCKS: string = '/src/views/blocks/';
private readonly BLOCKS: string = '/../../src/views/blocks';

/**
* @description
Expand Down Expand Up @@ -119,11 +119,11 @@ class Compiler {

data.banner = this.getBanner(event);

Hbs.handlebars.registerPartial('header', Hbs.handlebars.compile( readFileSync(`${process.cwd()}${this.PARTIALS}/header.hbs`, { encoding: 'utf-8' } ))(Container.configuration.consumer))
Hbs.handlebars.registerPartial('body', Hbs.handlebars.compile( readFileSync(`${process.cwd()}${this.BLOCKS}/${this.getSegment(event)}.hbs`, { encoding: 'utf-8' } ))(data))
Hbs.handlebars.registerPartial('footer', Hbs.handlebars.compile( readFileSync(`${process.cwd()}${this.PARTIALS}/footer.hbs`, { encoding: 'utf-8' } ))(Container.configuration.consumer))
Hbs.handlebars.registerPartial('header', Hbs.handlebars.compile( readFileSync(`${__dirname}${this.PARTIALS}/header.hbs`, { encoding: 'utf-8' } ))(Container.configuration.consumer))
Hbs.handlebars.registerPartial('body', Hbs.handlebars.compile( readFileSync(`${__dirname}${this.BLOCKS}/${this.getSegment(event)}.hbs`, { encoding: 'utf-8' } ))(data))
Hbs.handlebars.registerPartial('footer', Hbs.handlebars.compile( readFileSync(`${__dirname}${this.PARTIALS}/footer.hbs`, { encoding: 'utf-8' } ))(Container.configuration.consumer))

const html = Hbs.handlebars.compile( readFileSync(`${process.cwd()}${this.LAYOUT}`, { encoding: 'utf-8' } ) )(data);
const html = Hbs.handlebars.compile( readFileSync(`${__dirname}${this.LAYOUT}`, { encoding: 'utf-8' } ) )(data);

return {
text: this.textify(html),
Expand Down

0 comments on commit d3ebac5

Please sign in to comment.