mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-07 23:03:19 +08:00
Add ignore list for decorators
This commit is contained in:
parent
75675ea19f
commit
6416395727
2
.gitignore
vendored
2
.gitignore
vendored
@ -5,6 +5,6 @@ node_modules/
|
|||||||
aot/
|
aot/
|
||||||
scripts/ionic-native-bower
|
scripts/ionic-native-bower
|
||||||
dist/
|
dist/
|
||||||
src/plugins/**/ngx
|
src/@ionic-native/plugins/**/ngx
|
||||||
*.d.ts
|
*.d.ts
|
||||||
injectable-classes.json
|
injectable-classes.json
|
||||||
|
@ -19,13 +19,15 @@ function transformImports(file: ts.SourceFile, ctx: ts.TransformationContext, ng
|
|||||||
|
|
||||||
const decoratorRegex: RegExp = /@([a-zA-Z]+)\(/g;
|
const decoratorRegex: RegExp = /@([a-zA-Z]+)\(/g;
|
||||||
|
|
||||||
|
const ignored: string [] = ['Plugin', 'Component'];
|
||||||
|
|
||||||
let m;
|
let m;
|
||||||
|
|
||||||
while ((m = decoratorRegex.exec(file.text)) !== null) {
|
while ((m = decoratorRegex.exec(file.text)) !== null) {
|
||||||
if (m.index === decoratorRegex.lastIndex) {
|
if (m.index === decoratorRegex.lastIndex) {
|
||||||
decoratorRegex.lastIndex++;
|
decoratorRegex.lastIndex++;
|
||||||
}
|
}
|
||||||
if (m && m[1] && decorators.indexOf(m[1]) === -1 && m[1] !== 'Plugin') decorators.push(m[1]);
|
if (m && m[1] && decorators.indexOf(m[1]) === -1 && ignored.indexOf(m[1]) === -1) decorators.push(m[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (decorators.length) {
|
if (decorators.length) {
|
||||||
|
@ -20,7 +20,7 @@ const PACKAGE_JSON_BASE = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const DIST = path.resolve(ROOT, 'dist');
|
const DIST = path.resolve(ROOT, 'dist/@ionic-native');
|
||||||
|
|
||||||
const PACKAGES = [];
|
const PACKAGES = [];
|
||||||
|
|
||||||
@ -66,8 +66,8 @@ function prepare() {
|
|||||||
function publish() {
|
function publish() {
|
||||||
// TODO apply queue system so it doesn't publish everything at once
|
// TODO apply queue system so it doesn't publish everything at once
|
||||||
PACKAGES.forEach((pkg: string) => {
|
PACKAGES.forEach((pkg: string) => {
|
||||||
// console.log('Going to run the following command: ', `npm publish ${ pkg } ${ FLAGS }`);
|
console.log('Going to run the following command: ', `npm publish ${ pkg } ${ FLAGS }`);
|
||||||
exec(`npm publish ${ pkg } ${ FLAGS }`);
|
// exec(`npm publish ${ pkg } ${ FLAGS }`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user