ember-template-recast
Advanced tools
Comparing version 4.2.1 to 4.3.0
@@ -0,1 +1,10 @@ | ||
## v4.3.0 (2020-11-04) | ||
#### :rocket: Enhancement | ||
* [#384](https://github.com/ember-template-lint/ember-template-recast/pull/384) Allow passing `filePath` to `transform`. ([@rwjblue](https://github.com/rwjblue)) | ||
* [#255](https://github.com/ember-template-lint/ember-template-recast/pull/255) Convert to TypeScript. ([@rwjblue](https://github.com/rwjblue)) | ||
#### Committers: 1 | ||
- Robert Jackson ([@rwjblue](https://github.com/rwjblue)) | ||
## v4.2.1 (2020-10-14) | ||
@@ -2,0 +11,0 @@ |
{ | ||
"name": "ember-template-recast", | ||
"version": "4.2.1", | ||
"version": "4.3.0", | ||
"description": "Non-destructive template transformer.", | ||
@@ -19,18 +19,25 @@ "keywords": [ | ||
"files": [ | ||
"bin/", | ||
"src/" | ||
"lib/", | ||
"!lib/**/*.test.*" | ||
], | ||
"main": "src/index.js", | ||
"bin": "bin/ember-template-recast.js", | ||
"main": "lib/index.js", | ||
"bin": "lib/bin.js", | ||
"scripts": { | ||
"changelog": "lerna-changelog", | ||
"lint:js": "eslint .", | ||
"build": "tsc", | ||
"lint": "npm-run-all lint:*", | ||
"lint:files": "eslint .", | ||
"lint:tsc": "tsc --noEmit", | ||
"prepare": "tsc", | ||
"release": "release-it", | ||
"test": "jest" | ||
"test": "npm-run-all lint test:*", | ||
"test:jest": "jest" | ||
}, | ||
"dependencies": { | ||
"@glimmer/syntax": "^0.62.3", | ||
"@glimmer/reference": "^0.62.4", | ||
"@glimmer/syntax": "^0.62.4", | ||
"@glimmer/validator": "^0.62.4", | ||
"async-promise-queue": "^1.0.5", | ||
"colors": "^1.4.0", | ||
"commander": "^6.1.0", | ||
"commander": "^6.2.0", | ||
"globby": "^11.0.1", | ||
@@ -40,17 +47,25 @@ "ora": "^5.1.0", | ||
"tmp": "^0.2.1", | ||
"workerpool": "^6.0.2" | ||
"workerpool": "^6.0.3" | ||
}, | ||
"devDependencies": { | ||
"@types/common-tags": "^1.8.0", | ||
"@types/jest": "^26.0.14", | ||
"@types/workerpool": "^6.0.0", | ||
"@typescript-eslint/eslint-plugin": "^4.3.0", | ||
"@typescript-eslint/parser": "^4.3.0", | ||
"broccoli-test-helper": "^2.0.0", | ||
"common-tags": "^1.8.0", | ||
"eslint": "^7.11.0", | ||
"eslint-config-prettier": "^6.12.0", | ||
"eslint": "^7.12.1", | ||
"eslint-config-prettier": "^6.15.0", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-prettier": "^3.1.4", | ||
"execa": "^4.0.3", | ||
"jest": "^26.5.3", | ||
"jest": "^26.6.1", | ||
"lerna-changelog": "^1.0.1", | ||
"npm-run-all": "^4.1.5", | ||
"prettier": "^2.1.2", | ||
"release-it": "^14.1.0", | ||
"release-it-lerna-changelog": "^2.4.0" | ||
"release-it": "14.1.0", | ||
"release-it-lerna-changelog": "^2.4.0", | ||
"ts-jest": "^26.4.1", | ||
"typescript": "^4.0.3" | ||
}, | ||
@@ -57,0 +72,0 @@ "engines": { |
@@ -83,11 +83,2 @@ # ember-template-recast | ||
```ts | ||
export interface ASTPluginBuilder { | ||
(env: ASTPluginEnvironment): NodeVisitor; | ||
} | ||
export interface ASTPluginEnvironment { | ||
meta?: any; | ||
syntax: Syntax; | ||
} | ||
export interface Syntax { | ||
@@ -100,6 +91,19 @@ parse: typeof preprocess; | ||
} | ||
export interface TransformPluginEnv { | ||
syntax: Syntax; | ||
contents: string; | ||
filePath?: string; | ||
parseOptions: { | ||
srcName?: string; | ||
}; | ||
} | ||
export interface TransformPluginBuilder { | ||
(env: TransformPluginEnv): NodeVisitor; | ||
} | ||
``` | ||
The list of known builders on the `env.syntax.builders` are [found | ||
here](https://github.com/glimmerjs/glimmer-vm/blob/v0.50.4/packages/%40glimmer/syntax/lib/builders.ts#L547-L578). | ||
here](https://github.com/glimmerjs/glimmer-vm/blob/v0.62.4/packages/%40glimmer/syntax/lib/builders.ts#L547-L578). | ||
@@ -109,2 +113,3 @@ Example: | ||
const { transform } = require('ember-template-recast'); | ||
const template = ` | ||
@@ -115,10 +120,14 @@ {{foo-bar | ||
`; | ||
let { code } = transform(template, env => { | ||
let { builders: b } = env.syntax; | ||
return { | ||
MustacheStatement() { | ||
return b.mustache(b.path('wat-wat')); | ||
}, | ||
}; | ||
let { code } = transform({ | ||
template, | ||
plugin(env) { | ||
let { builders: b } = env.syntax; | ||
return { | ||
MustacheStatement() { | ||
return b.mustache(b.path('wat-wat')); | ||
}, | ||
}; | ||
} | ||
}); | ||
@@ -125,0 +134,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
89001
1351
194
11
20
3
+ Added@glimmer/reference@^0.62.4
+ Added@glimmer/validator@^0.62.4
+ Added@glimmer/global-context@0.62.5(transitive)
+ Added@glimmer/reference@0.62.5(transitive)
+ Added@glimmer/validator@0.62.5(transitive)
Updated@glimmer/syntax@^0.62.4
Updatedcommander@^6.2.0
Updatedworkerpool@^6.0.3