-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #169 from mgechev/html-css-dsls
feat: supports html & css dsls through sourcemaps
- Loading branch information
Showing
29 changed files
with
613 additions
and
266 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# AppVeyor file | ||
# http://www.appveyor.com/docs/appveyor-yml | ||
# This file: cloned from https://github.com/gruntjs/grunt/blob/master/appveyor.yml | ||
|
||
# Build version format | ||
version: "{build}" | ||
|
||
# Test against this version of Node.js | ||
environment: | ||
nodejs_version: "Stable" | ||
|
||
build: off | ||
|
||
clone_depth: 10 | ||
|
||
# Fix line endings on Windows | ||
init: | ||
- git config --global core.autocrlf true | ||
|
||
install: | ||
- ps: Install-Product node $env:nodejs_version | ||
- npm install -g npm@3.10.8 | ||
- ps: $env:path = $env:appdata + "\npm;" + $env:path | ||
- npm install | ||
|
||
test_script: | ||
# Output useful info for debugging. | ||
- node --version && npm --version | ||
# We test multiple Windows shells because of prior stdout buffering issues | ||
# filed against Grunt. https://github.com/joyent/node/issues/3584 | ||
- ps: "npm --version # PowerShell" # Pass comment to PS for easier debugging | ||
- npm t | ||
|
||
notifications: | ||
- provider: Webhook | ||
url: https://webhooks.gitter.im/e/cfd8ce5ddee6f3a0b0c9 | ||
on_build_success: false | ||
on_build_failure: true | ||
on_build_status_changed: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,66 @@ | ||
import * as ts from 'typescript'; | ||
|
||
const root = require('app-root-path'); | ||
const join = require('path').join; | ||
import {CodeWithSourceMap} from './metadata'; | ||
|
||
export interface UrlResolver { | ||
(url: string, d: ts.Decorator): string; | ||
} | ||
|
||
export interface TemplateTransformer { | ||
(template: string, url: string, d: ts.Decorator): CodeWithSourceMap; | ||
} | ||
|
||
export interface StyleTransformer { | ||
(style: string, url: string, d: ts.Decorator): CodeWithSourceMap; | ||
} | ||
|
||
export const LogLevel = { | ||
None: 0, | ||
Error: 0b001, | ||
Info: 0b011, | ||
Debug: 0b111 | ||
}; | ||
|
||
export interface Config { | ||
interpolation: [string, string]; | ||
resolveUrl: UrlResolver; | ||
transformTemplate: TemplateTransformer; | ||
transformStyle: StyleTransformer; | ||
predefinedDirectives: DirectiveDeclaration[]; | ||
basePath: string; | ||
logLevel: number; | ||
} | ||
|
||
export interface DirectiveDeclaration { | ||
selector: string; | ||
exportAs: string; | ||
} | ||
|
||
export let Config: Config = { | ||
export const Config: Config = { | ||
interpolation: ['{{', '}}'], | ||
|
||
resolveUrl(url: string, d: ts.Decorator) { | ||
return url; | ||
}, | ||
|
||
transformTemplate(code: string, url: string, d: ts.Decorator) { | ||
return { code, url }; | ||
}, | ||
|
||
transformStyle(code: string, url: string, d: ts.Decorator) { | ||
return { code, url }; | ||
}, | ||
|
||
predefinedDirectives: [ | ||
{ selector: 'form', exportAs: 'ngForm' } | ||
], | ||
basePath: '' | ||
|
||
logLevel: LogLevel.None | ||
}; | ||
|
||
const root = require('app-root-path'); | ||
|
||
try { | ||
let newConfig = require(join(root.path, '.codelyzer')); | ||
let newConfig = require(root.path + '/.codelyzer'); | ||
Object.assign(Config, newConfig); | ||
} catch (e) { | ||
|
||
console.info('Cannot find ".codelyzer.js" in the root of the project'); | ||
} | ||
|
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,3 @@ | ||
export abstract class FileResolver { | ||
abstract resolve(path: string): string; | ||
} | ||
|
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
Oops, something went wrong.