Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/eta-dev/eta
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowtime2000 committed Jul 5, 2021
2 parents 9c1d3ca + 2078f4a commit 80fc526
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 31 deletions.
7 changes: 2 additions & 5 deletions deno_dist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,8 @@ To be added

## Projects using `eta`

- [Docusaurus v2](https://v2.docusaurus.io): open-source documentation framework
that uses Eta to generate a SSR build
- [swagger-typescript-api](https://github.com/acacode/swagger-typescript-api):
Open source typescript api codegenerator from Swagger. Uses Eta as
codegenerator by templates
- [Docusaurus v2](https://v2.docusaurus.io): open-source documentation framework that uses Eta to generate a SSR build
- [swagger-typescript-api](https://github.com/acacode/swagger-typescript-api): Open source typescript api codegenerator from Swagger. Uses Eta as codegenerator by templates
- [Add yours!](https://github.com/eta-dev/eta/edit/master/README.md)

## Contributors
Expand Down
4 changes: 2 additions & 2 deletions deno_dist/file-methods.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { existsSync } from "https://deno.land/std@0.66.0/fs/exists.ts";
export * as path from "https://deno.land/std@0.66.0/path/mod.ts";
export { existsSync } from "https://deno.land/std@0.97.0/fs/exists.ts";
export * as path from "https://deno.land/std@0.97.0/path/mod.ts";

export const readFileSync = Deno.readTextFileSync;
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"size": "size-limit",
"start": "rollup -c rollup.config.ts -w",
"test": "jest --coverage && npm run test:deno && npm run size",
"test:deno": "deno test test/deno/*.spec.ts --allow-read",
"test:deno": "deno test test/deno/*.spec.ts --allow-read --unstable",
"test:prod": "npm run lint && npm run test -- --no-cache",
"test:watch": "jest --coverage --watch",
"travis-deploy-once": "travis-deploy-once --pro"
Expand Down Expand Up @@ -156,13 +156,13 @@
"travis-deploy-once": "^5.0.11",
"ts-jest": "^26.3.0",
"ts-node": "^9.0.0",
"tslib": "^2.2.0",
"typedoc": "^0.19.1",
"typescript": "^4.0.2"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"dependencies": {}
}
}
4 changes: 2 additions & 2 deletions src/file-methods.deno.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { existsSync } from "https://deno.land/std@0.66.0/fs/exists.ts"
export * as path from "https://deno.land/std@0.66.0/path/mod.ts"
export { existsSync } from "https://deno.land/std@0.97.0/fs/exists.ts"
export * as path from "https://deno.land/std@0.97.0/path/mod.ts"

export const readFileSync = Deno.readTextFileSync
2 changes: 1 addition & 1 deletion test/deno/basic.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from 'https://deno.land/std@0.67.0/testing/asserts.ts'
import { assertEquals } from 'https://deno.land/std@0.97.0/testing/asserts.ts'
import * as eta from '../../deno_dist/mod.ts'

Deno.test('simple render', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/deno/config.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from 'https://deno.land/std@0.67.0/testing/asserts.ts'
import { assertEquals } from 'https://deno.land/std@0.97.0/testing/asserts.ts'
import * as eta from '../../deno_dist/mod.ts'

Deno.test('Renders a simple template with default env', () => {
Expand Down
14 changes: 7 additions & 7 deletions test/deno/file-helpers.spec.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { assertEquals, assertThrows } from 'https://deno.land/std@0.67.0/testing/asserts.ts'
import * as path from 'https://deno.land/std@0.66.0/path/mod.ts'
import { assertEquals, assertThrows } from 'https://deno.land/std@0.97.0/testing/asserts.ts'
import * as path from 'https://deno.land/std@0.97.0/path/mod.ts'
const __dirname = new URL('.', import.meta.url).pathname

import { render, templates, compile } from '../../deno_dist/mod.ts'

templates.define('test-template', compile('Saluton <%=it.name%>'))

Deno.test('include works', async () => {
Deno.test('include works', () => {
const renderedTemplate = render('<%~ include("test-template", it) %>', { name: 'Ada' })

assertEquals(renderedTemplate, 'Saluton Ada')
})

Deno.test('includeFile works w/ filename prop', async () => {
Deno.test('includeFile works w/ filename prop', () => {
const renderedTemplate = render(
'<%~ includeFile("simple", it) %>',
{ name: 'Ada' },
Expand All @@ -22,7 +22,7 @@ Deno.test('includeFile works w/ filename prop', async () => {
assertEquals(renderedTemplate, 'Hi Ada')
})

Deno.test('"E.includeFile" works with "views" array', async () => {
Deno.test('"E.includeFile" works with "views" array', () => {
const renderedTemplate = render(
'<%~ E.includeFile("randomtemplate", it) %>',
{ user: 'Ben' },
Expand All @@ -32,7 +32,7 @@ Deno.test('"E.includeFile" works with "views" array', async () => {
assertEquals(renderedTemplate, 'This is a random template. Hey Ben')
})

Deno.test('"includeFile" works with "views" array', async () => {
Deno.test('"includeFile" works with "views" array', () => {
const renderedTemplate = render(
'<%~ includeFile("randomtemplate", it) %>',
{ user: 'Ben' },
Expand All @@ -42,7 +42,7 @@ Deno.test('"includeFile" works with "views" array', async () => {
assertEquals(renderedTemplate, 'This is a random template. Hey Ben')
})

Deno.test('"includeFile" works with "views" string', async () => {
Deno.test('"includeFile" works with "views" string', () => {
const renderedTemplate = render(
'<%~ includeFile("randomtemplate", it) %>',
{ user: 'Ben' },
Expand Down
2 changes: 1 addition & 1 deletion test/deno/helpers.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals, assertThrows } from 'https://deno.land/std@0.67.0/testing/asserts.ts'
import { assertEquals, assertThrows } from 'https://deno.land/std@0.97.0/testing/asserts.ts'
import { render } from '../../deno_dist/mod.ts'

// SHOULD TEST COMMON ETA USAGE PATTERNS HERE
Expand Down
23 changes: 14 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8604,9 +8604,9 @@ postcss-value-parser@^4.0.2, postcss-value-parser@^4.1.0:
integrity sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==

postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.27, postcss@^7.0.32, postcss@^7.0.5, postcss@^7.0.6:
version "7.0.32"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.32.tgz#4310d6ee347053da3433db2be492883d62cec59d"
integrity sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==
version "7.0.36"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.36.tgz#056f8cffa939662a8f5905950c07d5285644dfcb"
integrity sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==
dependencies:
chalk "^2.4.2"
source-map "^0.6.1"
Expand Down Expand Up @@ -10306,9 +10306,9 @@ travis-deploy-once@^5.0.11:
yargs "^12.0.1"

trim-newlines@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.0.tgz#79726304a6a898aa8373427298d54c2ee8b1cb30"
integrity sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==
version "3.0.1"
resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144"
integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==

trim-off-newlines@^1.0.0:
version "1.0.1"
Expand Down Expand Up @@ -10373,6 +10373,11 @@ tslib@^1.8.1, tslib@^1.9.0:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043"
integrity sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==

tslib@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.2.0.tgz#fb2c475977e35e241311ede2693cee1ec6698f5c"
integrity sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==

tsutils@^3.17.1:
version "3.17.1"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759"
Expand Down Expand Up @@ -11035,9 +11040,9 @@ write@1.0.3:
mkdirp "^0.5.1"

ws@^6.0.0:
version "6.2.1"
resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.1.tgz#442fdf0a47ed64f59b6a5d8ff130f4748ed524fb"
integrity sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==
version "6.2.2"
resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.2.tgz#dd5cdbd57a9979916097652d78f1cc5faea0c32e"
integrity sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==
dependencies:
async-limiter "~1.0.0"

Expand Down

0 comments on commit 80fc526

Please sign in to comment.