mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-05-20 00:06:24 +08:00
chore(repo): move files to new repo name
This commit is contained in:
@@ -8,7 +8,7 @@ export const ROOT = path.resolve(__dirname, '../../');
|
||||
// tslint:disable-next-line:no-var-requires
|
||||
export const TS_CONFIG = clone(require(path.resolve(ROOT, 'tsconfig.json')));
|
||||
export const COMPILER_OPTIONS = TS_CONFIG.compilerOptions;
|
||||
export const PLUGINS_ROOT = path.join(ROOT, 'src/@ionic-native/plugins/');
|
||||
export const PLUGINS_ROOT = path.join(ROOT, 'src/@awesome-cordova-plugins/plugins/');
|
||||
export const PLUGIN_PATHS = fs.readdirSync(PLUGINS_ROOT).map(d => path.join(PLUGINS_ROOT, d, 'index.ts'));
|
||||
|
||||
export function getDecorator(node: ts.Node, index = 0): ts.Decorator {
|
||||
|
||||
@@ -34,7 +34,7 @@ export function getProgram(rootNames: string[] = createSourceFiles()) {
|
||||
|
||||
// hacky way to export metadata only for core package
|
||||
export function transpileNgxCore() {
|
||||
getProgram([path.resolve(ROOT, 'src/@ionic-native/core/index.ts')]).emit({
|
||||
getProgram([path.resolve(ROOT, 'src/@awesome-cordova-plugins/core/index.ts')]).emit({
|
||||
emitFlags: EmitFlags.Metadata,
|
||||
emitCallback: ({ program, writeFile, customTransformers, cancellationToken, targetSourceFile }) => {
|
||||
return program.emit(targetSourceFile, writeFile, cancellationToken, true, customTransformers);
|
||||
@@ -57,7 +57,7 @@ export function generateDeclarationFiles() {
|
||||
|
||||
export function generateLegacyBundles() {
|
||||
[
|
||||
path.resolve(ROOT, 'dist/@ionic-native/core/index.js'),
|
||||
path.resolve(ROOT, 'dist/@awesome-cordova-plugins/core/index.js'),
|
||||
...PLUGIN_PATHS.map(p =>
|
||||
p.replace(path.join(ROOT, 'src'), path.join(ROOT, 'dist')).replace('index.ts', 'ngx/index.js')
|
||||
),
|
||||
@@ -69,7 +69,7 @@ export function generateLegacyBundles() {
|
||||
if (warning.code === 'UNUSED_EXTERNAL_IMPORT') return;
|
||||
warn(warning);
|
||||
},
|
||||
external: ['@angular/core', '@ionic-native/core', 'rxjs', 'tslib'],
|
||||
external: ['@angular/core', '@awesome-cordova-plugins/core', 'rxjs', 'tslib'],
|
||||
})
|
||||
.then(bundle =>
|
||||
bundle.write({
|
||||
@@ -80,7 +80,7 @@ export function generateLegacyBundles() {
|
||||
);
|
||||
}
|
||||
|
||||
// remove reference to @ionic-native/core decorators
|
||||
// remove reference to @awesome-cordova-plugins/core decorators
|
||||
export function modifyMetadata() {
|
||||
debugger;
|
||||
PLUGIN_PATHS.map(p =>
|
||||
@@ -106,7 +106,7 @@ export function modifyMetadata() {
|
||||
function removeIonicNativeDecorators(node: any) {
|
||||
if (node.decorators && node.decorators.length) {
|
||||
node.decorators = node.decorators.filter(
|
||||
(d: { expression: { module: string } }) => d.expression.module !== '@ionic-native/core'
|
||||
(d: { expression: { module: string } }) => d.expression.module !== '@awesome-cordova-plugins/core'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ export const EMIT_PATH = path.resolve(ROOT, 'injectable-classes.json');
|
||||
export function extractInjectables() {
|
||||
return (ctx: ts.TransformationContext) => {
|
||||
return tsSourceFile => {
|
||||
if (tsSourceFile.fileName.indexOf('src/@ionic-native/plugins') > -1) {
|
||||
if (tsSourceFile.fileName.indexOf('src/@awesome-cordova-plugins/plugins') > -1) {
|
||||
ts.visitEachChild(
|
||||
tsSourceFile,
|
||||
node => {
|
||||
|
||||
@@ -10,12 +10,12 @@ function transformImports(file: ts.SourceFile, ctx: ts.TransformationContext, ng
|
||||
);
|
||||
}
|
||||
|
||||
// find the @ionic-native/core import statement
|
||||
// find the @awesome-cordova-plugins/core import statement
|
||||
const importStatement = (file.statements as any).find((s: any) => {
|
||||
return s.kind === ts.SyntaxKind.ImportDeclaration && s.moduleSpecifier.text === '@ionic-native/core';
|
||||
return s.kind === ts.SyntaxKind.ImportDeclaration && s.moduleSpecifier.text === '@awesome-cordova-plugins/core';
|
||||
});
|
||||
|
||||
// we're only interested in files containing @ionic-native/core import statement
|
||||
// we're only interested in files containing @awesome-cordova-plugins/core import statement
|
||||
if (!importStatement) return file;
|
||||
|
||||
const decorators: string[] = [];
|
||||
|
||||
@@ -63,7 +63,7 @@ function transformClasses(file: ts.SourceFile, ctx: ts.TransformationContext, ng
|
||||
export function pluginClassTransformer(ngcBuild?: boolean): ts.TransformerFactory<ts.SourceFile> {
|
||||
return (ctx: ts.TransformationContext) => {
|
||||
return tsSourceFile => {
|
||||
if (tsSourceFile.fileName.indexOf('src/@ionic-native/plugins') > -1)
|
||||
if (tsSourceFile.fileName.indexOf('src/@awesome-cordova-plugins/plugins') > -1)
|
||||
return transformClasses(tsSourceFile, ctx, ngcBuild);
|
||||
return tsSourceFile;
|
||||
};
|
||||
|
||||
@@ -22,7 +22,7 @@ interface Plugin {
|
||||
const rootDir = resolve(__dirname, '../..');
|
||||
const typedocDocsTmp = resolve(__dirname, 'typedoc-docs');
|
||||
const typedocTmp = resolve(__dirname, 'typedoc.tmp.json');
|
||||
const pluginsDir = resolve(rootDir, 'src/@ionic-native/plugins');
|
||||
const pluginsDir = resolve(rootDir, 'src/@awesome-cordova-plugins/plugins');
|
||||
const typedoc = new Application();
|
||||
|
||||
typedoc.options.addReader(new TypeDoc.TSConfigReader());
|
||||
@@ -66,7 +66,7 @@ function processPlugin(pluginModule): Plugin {
|
||||
const pluginClass = pluginModule.children.find(isPlugin);
|
||||
console.log(pluginClass);
|
||||
const decorator = getPluginDecorator(pluginClass);
|
||||
const packageName = `@ionic-native/${basename(dirname(pluginModule.originalName))}`;
|
||||
const packageName = `@awesome-cordova-plugins/${basename(dirname(pluginModule.originalName))}`;
|
||||
const displayName = getTag(pluginClass, 'name');
|
||||
const usage = getTag(pluginClass, 'usage');
|
||||
const description = getTag(pluginClass, 'description');
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
"sitePath": "../ionic-site",
|
||||
"v2DocsDir": "docs/native",
|
||||
"docsDest": "../ionic-site/content/docs/native",
|
||||
"pluginDir": "dist/@ionic-native/plugins"
|
||||
"pluginDir": "dist/@awesome-cordova-plugins/plugins"
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ module.exports = currentVersion => {
|
||||
readFilesProcessor.basePath = path.resolve(__dirname, '../../..');
|
||||
|
||||
readTypeScriptModules.basePath = path.resolve(__dirname, '../../..');
|
||||
readTypeScriptModules.sourceFiles = ['./src/@ionic-native/plugins/**/*.ts'];
|
||||
readTypeScriptModules.sourceFiles = ['./src/@awesome-cordova-plugins/plugins/**/*.ts'];
|
||||
})
|
||||
|
||||
// Configure file writing
|
||||
|
||||
@@ -51,12 +51,12 @@ module.exports = currentVersion => {
|
||||
readFilesProcessor.basePath = path.resolve(__dirname, '../../..');
|
||||
|
||||
readTypeScriptModules.basePath = path.resolve(path.resolve(__dirname, '../../..'));
|
||||
readTypeScriptModules.sourceFiles = ['./src/@ionic-native/plugins/**/*.ts'];
|
||||
readTypeScriptModules.sourceFiles = ['./src/@awesome-cordova-plugins/plugins/**/*.ts'];
|
||||
})
|
||||
|
||||
// Configure file writing
|
||||
.config(function (writeFilesProcessor) {
|
||||
writeFilesProcessor.outputFolder = './dist/@ionic-native/';
|
||||
writeFilesProcessor.outputFolder = './dist/@awesome-cordova-plugins/';
|
||||
})
|
||||
|
||||
// Configure rendering
|
||||
|
||||
@@ -10,7 +10,7 @@ module.exports = function readmes(renderDocsProcessor) {
|
||||
docs = docs.filter(doc => (!!doc.name && !!doc.outputPath) || doc.docType === 'index-page');
|
||||
|
||||
docs.forEach(doc => {
|
||||
doc.outputPath = doc.outputPath.replace('src/@ionic-native/', '');
|
||||
doc.outputPath = doc.outputPath.replace('src/@awesome-cordova-plugins/', '');
|
||||
});
|
||||
|
||||
return docs;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<a style="float:right;font-size:12px;" href="http://github.com/ionic-team/ionic-native/edit/master/<$ doc.fileInfo.relativePath|replace('/home/ubuntu/ionic-native/', '')|replace('//','/') $>#L<$ doc.location.start.line $>">
|
||||
<a style="float:right;font-size:12px;" href="http://github.com/danielsogl/awesome-cordova-plugins/edit/master/<$ doc.fileInfo.relativePath|replace('/home/ubuntu/ionic-native/', '')|replace('//','/') $>#L<$ doc.location.start.line $>">
|
||||
Improve this doc
|
||||
</a>
|
||||
|
||||
@@ -20,7 +20,7 @@ $ <@ if prop.install @><$ prop.install $><@ else @>ionic cordova plugin add <$ p
|
||||
$ npm install @ionic-native/<$ doc.npmId $>
|
||||
```
|
||||
|
||||
## [Usage Documentation](https://ionicframework.com/docs/native/<$ doc.fileInfo.relativePath|replace('/home/ubuntu/ionic-native/', '')|replace('//','/')|replace('index.ts','')|replace('src/@ionic-native/plugins/','') $>)
|
||||
## [Usage Documentation](https://ionicframework.com/docs/native/<$ doc.fileInfo.relativePath|replace('/home/ubuntu/ionic-native/', '')|replace('//','/')|replace('index.ts','')|replace('src/@awesome-cordova-plugins/plugins/','') $>)
|
||||
|
||||
Plugin Repo: [<$ prop.repo $>](<$ prop.repo $>)
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ const webpackConfig: webpack.Configuration = {
|
||||
modules: ['node_modules'],
|
||||
extensions: ['.js'],
|
||||
alias: {
|
||||
'@ionic-native/core': path.resolve(DIST, '@ionic-native/core/index.js'),
|
||||
'@awesome-cordova-plugins/core': path.resolve(DIST, '@awesome-cordova-plugins/core/index.js'),
|
||||
},
|
||||
},
|
||||
module: {
|
||||
@@ -68,8 +68,8 @@ function createIndexFile() {
|
||||
fileContent += `\nwindow.IonicNative = {\n`;
|
||||
fileContent += INJECTABLE_CLASSES.map(e => e.className).join(',\n');
|
||||
fileContent += '\n};\n';
|
||||
fileContent += `require('./@ionic-native/core/bootstrap').checkReady();\n`;
|
||||
fileContent += `require('./@ionic-native/core/ng1').initAngular1(window.IonicNative);`;
|
||||
fileContent += `require('./@awesome-cordova-plugins/core/bootstrap').checkReady();\n`;
|
||||
fileContent += `require('./@awesome-cordova-plugins/core/ng1').initAngular1(window.IonicNative);`;
|
||||
|
||||
fs.writeFileSync(INDEX_PATH, fileContent, { encoding: 'utf-8' });
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ const VERSION = MAIN_PACKAGE_JSON.version;
|
||||
const FLAGS = '--access public';
|
||||
|
||||
const PACKAGE_JSON_BASE = {
|
||||
description: 'Ionic Native - Native plugins for ionic apps',
|
||||
description: 'Awesome Cordova Plugins - Native plugins for ionic apps',
|
||||
main: 'bundle.js',
|
||||
module: 'index.js',
|
||||
typings: 'index.d.ts',
|
||||
@@ -22,11 +22,11 @@ const PACKAGE_JSON_BASE = {
|
||||
license: 'MIT',
|
||||
repository: {
|
||||
type: 'git',
|
||||
url: 'https://github.com/ionic-team/ionic-native.git',
|
||||
url: 'https://github.com/danielsogl/awesome-cordova-plugins.git',
|
||||
},
|
||||
};
|
||||
|
||||
const DIST = path.resolve(ROOT, 'dist/@ionic-native');
|
||||
const DIST = path.resolve(ROOT, 'dist/@awesome-cordova-plugins');
|
||||
|
||||
const PACKAGES = [];
|
||||
|
||||
@@ -34,13 +34,13 @@ const MIN_CORE_VERSION = '^5.1.0';
|
||||
const RXJS_VERSION = '^5.5.0 || ^6.5.0';
|
||||
|
||||
const PLUGIN_PEER_DEPENDENCIES = {
|
||||
'@ionic-native/core': MIN_CORE_VERSION,
|
||||
'@awesome-cordova-plugins/core': MIN_CORE_VERSION,
|
||||
rxjs: RXJS_VERSION,
|
||||
};
|
||||
|
||||
function getPackageJsonContent(name: string, peerDependencies = {}, dependencies = {}) {
|
||||
return merge(PACKAGE_JSON_BASE, {
|
||||
name: '@ionic-native/' + name,
|
||||
name: '@awesome-cordova-plugins/' + name,
|
||||
dependencies,
|
||||
peerDependencies,
|
||||
version: VERSION,
|
||||
@@ -57,7 +57,7 @@ function writeNGXPackageJson(data: any, dir: string) {
|
||||
fs.writeJSONSync(filePath, data);
|
||||
}
|
||||
function prepare() {
|
||||
// write @ionic-native/core package.json
|
||||
// write @awesome-cordova-plugins/core package.json
|
||||
writePackageJson(
|
||||
getPackageJsonContent('core', { rxjs: RXJS_VERSION }, { '@types/cordova': 'latest' }),
|
||||
path.resolve(DIST, 'core')
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"noImplicitAny": false,
|
||||
"lib": ["es6"],
|
||||
"paths": {
|
||||
"@ionic-native/core": ["../src/@ionic-native/core"]
|
||||
"@awesome-cordova-plugins/core": ["../src/@awesome-cordova-plugins/core"]
|
||||
}
|
||||
},
|
||||
"exclude": ["node_modules"]
|
||||
|
||||
Reference in New Issue
Block a user