Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
torifat committed Nov 3, 2017
0 parents commit ad855ba
Show file tree
Hide file tree
Showing 23 changed files with 4,877 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .babelrc
@@ -0,0 +1,50 @@
{
"env": {
"modern": {
"presets": [
[
"env",
{
"targets": {
"node": "8"
},
"loose": true
}
]
],
"plugins": [["transform-object-rest-spread", { "useBuiltIns": true }]],
"ignore": ["__tests__", "_fixtures__", "node_modules"]
},
"legacy": {
"presets": [
[
"env",
{
"targets": {
"node": "4"
},
"loose": true
}
]
],
"plugins": [
["transform-object-rest-spread", { "useBuiltIns": true }],
"transform-runtime"
],
"ignore": ["__tests__", "_fixtures__", "node_modules"]
},
"test": {
"presets": [
[
"env",
{
"targets": {
"node": "current"
}
}
]
],
"plugins": [["transform-object-rest-spread", { "useBuiltIns": true }]]
}
}
}
9 changes: 9 additions & 0 deletions .flowconfig
@@ -0,0 +1,9 @@
[ignore]

[include]

[libs]

[lints]

[options]
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
/lib/
/node_modules/
*.log
17 changes: 17 additions & 0 deletions index.js
@@ -0,0 +1,17 @@
'use strict';

var ver = process.versions.node;
var majorVer = parseInt(ver.split('.')[0], 10);

if (majorVer < 4) {
console.error(
'Node version ' +
ver +
' is not supported, please use Node.js 4.0 or higher.'
);
process.exit(1);
} else if (majorVer < 8) {
module.exports = require('./lib/legacy');
} else {
module.exports = require('./lib/modern');
}
46 changes: 46 additions & 0 deletions package.json
@@ -0,0 +1,46 @@
{
"name": "better-avj-errors",
"version": "0.1.0",
"main": "index.js",
"author": "Rifat Nabi <to.rifat@gmail.com>",
"license": "MIT",
"files": ["lib"],
"dependencies": {
"chalk": "^2.3.0",
"jest-diff": "^21.2.1",
"jest-fixtures": "^0.6.0",
"jsonpointer": "^4.0.1",
"leven": "^2.1.0"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-jest": "^21.2.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.1",
"flow-bin": "^0.57.3",
"jest": "^21.2.1",
"prettier": "^1.7.4"
},
"peerDependencies": {
"ajv": "^4.11.8"
},
"scripts": {
"clean": "rm -rf lib",
"prebuild": "yarn run clean",
"build": "yarn build:modern && yarn build:legacy",
"build:modern": "BABEL_ENV=modern babel src -d lib/modern/",
"build:legacy": "BABEL_ENV=legacy babel src -d lib/legacy",
"prepublish": "yarn build",
"format": "prettier --write src/*.js src/**/*.js",
"test": "node node_modules/.bin/jest"
},
"jest": {
"testMatch": ["<rootDir>/src/**/__tests__/*.js"]
},
"prettier": {
"singleQuote": true,
"trailing-comma": "es5"
}
}
26 changes: 26 additions & 0 deletions src/__fixtures__/data.json
@@ -0,0 +1,26 @@
{
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"type": "inlineMacro",
"attrs": {
"macroId": "gjbk",
"name": "mymacro",
"placeholderUrl": "https://",
"params": {}
}
},
{
"type": "rawHtmlBlob",
"attrs": {
"html": "<p>Leand<strong>ro</strong></p>"
}
}
]
}
]
}

0 comments on commit ad855ba

Please sign in to comment.