-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* updated the minor deps * replace tslint with eslint and update a few deps * put the vscode ruler at 100 ch * improve type annotations (no functionality change) * make eslint and rollup work again * add the dist-test to the build process * improve linting or silence it when tricky * update the examples and run them * add a few .github files * add a note to the changelog * update the performance comparison * improve perf messages * run perf tests more times to get a better picture * doc: add a note about security support * fix: format the rollup config * refactor: small syntax improvement * refactor: use util type checks whenever possible * chore: some basic formatting * refactor: move the template type checking to tokenize * feat: add isInt() util function * refactor: remove the extra confusing param * fix: Renderer should check that it gets an object option * refactor: pass options object to tokenize() * update a few deps and fix broken changes add nvm support addressed some known security issues refactored the dist-test clean up tests * update packages * update some more deps * add a barebone playground * improve playground * improve the playground * add a bit more info to the changelog * get() takes an options object * applied prettier and made eslint happy * rename a perf file * fix a broken path * add the depth option. Close #34 * make travis happy * validate the depth option * make it slightly shorter to minify * add a few empty lines to improve readability * increase the cache size * refactor the perf test script * refactor the perf script further * improve the output of the perf comparison * improve the deep perf test * fix a bug in long template perf test * improve typedoc and annotations * trigger github page build * change master to update (github pages) * set local_dir * remove the markdown docs in favour of gh-pages docs * refer to examples dir in README * slightly improve the playground * travis only deploys on lts/* * travis deploy docs only on master * travis deploy only on node version specified in .nvm * 8.0.0
- Loading branch information
Showing
61 changed files
with
4,190 additions
and
2,242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
dist/ | ||
dist-test/ | ||
examples/ | ||
perf/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"node": true, | ||
"jest": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/recommended-requiring-type-checking", | ||
"prettier" | ||
], | ||
"globals": { | ||
"Atomics": "readonly", | ||
"SharedArrayBuffer": "readonly" | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 2018, | ||
"sourceType": "module", | ||
"project": "./tsconfig.json" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"rules": { | ||
"indent": [ | ||
"warn", | ||
2 | ||
], | ||
"linebreak-style": [ | ||
"error", | ||
"unix" | ||
], | ||
"quotes": [ | ||
"warn", | ||
"single", | ||
{ | ||
"avoidEscape": true, | ||
"allowTemplateLiterals": true | ||
} | ||
], | ||
"semi": [ | ||
"warn", | ||
"never" | ||
], | ||
"no-unused-vars": "warn", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/member-delimiter-style": [ | ||
"warn", | ||
{ | ||
"multiline": { | ||
"delimiter": "none", | ||
"requireLast": true | ||
}, | ||
"singleline": { | ||
"delimiter": "semi", | ||
"requireLast": true | ||
} | ||
} | ||
], | ||
"@typescript-eslint/require-await": "warn", | ||
"@typescript-eslint/no-unsafe-assignment": "warn", | ||
"@typescript-eslint/restrict-template-expressions": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Current behavior | ||
|
||
# Expected behavior |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Summary | ||
|
||
# Checklist | ||
|
||
- [ ] The work was discussed in an issue prior to making a PR | ||
- [ ] All new functionality is tested | ||
- [ ] Any documentation that will be affected is updated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
If you have questions or suggestions, [create an issue](https://github.com/userpixel/micromustache/issues/new). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"recommendations": [ | ||
"esbenp.prettier-vscode", | ||
"dbaeumer.vscode-eslint" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"editor.rulers": [80] | ||
"editor.rulers": [100], | ||
"editor.formatOnSave": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const am = require('am') | ||
const assert = require('assert') | ||
const { | ||
promises: { readdir, access }, | ||
} = require('fs') | ||
const { resolve, extname } = require('path') | ||
const pkgJson = require('../package.json') | ||
|
||
const rootDir = resolve(__dirname, '..') | ||
const distDir = resolve(rootDir, './dist') | ||
|
||
async function main() { | ||
const validFileExtentions = ['.mjs', '.js', '.cjs', '.map'] | ||
for await (let file of await readdir(distDir, { withFileTypes: true })) { | ||
console.log(`Checking ${file.name}...`) | ||
// only inspect files | ||
if (file.isFile()) { | ||
// does not contain any unexpected file extension | ||
const fileExtension = extname(file.name) | ||
assert(validFileExtentions.includes(fileExtension)) | ||
// Has the package name in its file name | ||
assert(file.name.includes(pkgJson.name)) | ||
} | ||
} | ||
// pkg-ok checks "package.json:main", "package.json:module" and "package.json:types" | ||
} | ||
|
||
am(main) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
const { render } = require('../dist/micromustache.js') | ||
// This is a "normal" Node js file which tries to load the CommonJS version specifying its extension | ||
const { render } = require('../dist/micromustache.cjs') | ||
|
||
const result = render('Hello {{ name }}!', { name: 'Alex' }) | ||
if (result !== 'Hello Alex!') { | ||
throw new Error(`The result does not match ${result}`) | ||
throw new Error(`The result does not match ${result}`) | ||
} | ||
console.log('✔', __filename) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// This is a Node CommonJS file which tries to use the CommonJS export as specified in the package.json | ||
const mm = require('..') | ||
|
||
const { render } = mm | ||
const result = render('Hello {{ name }}!', { name: 'Alex' }) | ||
if (result !== 'Hello Alex!') { | ||
throw new Error(`The result does not match ${result}`) | ||
} | ||
console.log('✔', __filename) |
Oops, something went wrong.