From 266dd729b60a656d2b38caefc970b4978d696757 Mon Sep 17 00:00:00 2001 From: jcesarmobile Date: Thu, 2 Jul 2020 18:57:40 +0200 Subject: [PATCH 1/3] chore(cli): pin cli version instead of latest on plugin generation --- cli/src/tasks/new-plugin.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cli/src/tasks/new-plugin.ts b/cli/src/tasks/new-plugin.ts index 071ed6800..147d364d6 100644 --- a/cli/src/tasks/new-plugin.ts +++ b/cli/src/tasks/new-plugin.ts @@ -97,6 +97,7 @@ export async function newPlugin(config: Config) { const pluginPath = removeScope(answers.name); const domain = answers.domain; const className = answers.className; + const cliVersion = config.cli.package.version; if (await existsAsync(pluginPath)) { logFatal(`Directory ${pluginPath} already exists. Not overwriting.`); @@ -112,7 +113,7 @@ export async function newPlugin(config: Config) { }); await runTask('Writing package.json', () => { - return writePrettyJSON(join(pluginPath, 'package.json'), generatePackageJSON(answers)); + return writePrettyJSON(join(pluginPath, 'package.json'), generatePackageJSON(answers, cliVersion)); }); await runTask('Installing NPM dependencies', async () => { @@ -218,7 +219,7 @@ function generateAndroidManifest(domain: string, pluginPath: string) { `; } -function generatePackageJSON(answers: NewPluginAnswers) { +function generatePackageJSON(answers: NewPluginAnswers, cliVersion: string) { return { name: answers.name, version: '0.0.1', @@ -234,13 +235,13 @@ function generatePackageJSON(answers: NewPluginAnswers) { author: answers.author, license: answers.license, dependencies: { - '@capacitor/core': 'latest' + '@capacitor/core': `${cliVersion}` }, devDependencies: { 'rimraf': '^3.0.0', 'typescript': '^3.2.4', - '@capacitor/ios': 'latest', - '@capacitor/android': 'latest' + '@capacitor/ios': `${cliVersion}`, + '@capacitor/android': `${cliVersion}` }, files: [ 'dist/', From 9585bf154abab368a30837a092b4a529982a4f4d Mon Sep 17 00:00:00 2001 From: jcesarmobile Date: Thu, 2 Jul 2020 22:27:59 +0200 Subject: [PATCH 2/3] Update cli/src/tasks/new-plugin.ts Co-authored-by: Dan Imhoff --- cli/src/tasks/new-plugin.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cli/src/tasks/new-plugin.ts b/cli/src/tasks/new-plugin.ts index 147d364d6..94033d54a 100644 --- a/cli/src/tasks/new-plugin.ts +++ b/cli/src/tasks/new-plugin.ts @@ -235,7 +235,7 @@ function generatePackageJSON(answers: NewPluginAnswers, cliVersion: string) { author: answers.author, license: answers.license, dependencies: { - '@capacitor/core': `${cliVersion}` + '@capacitor/core': `^${cliVersion}` }, devDependencies: { 'rimraf': '^3.0.0', @@ -271,4 +271,3 @@ function generatePackageJSON(answers: NewPluginAnswers, cliVersion: string) { } }; } - From c69add1b3dbe15b5dbdaf7eabee103d1b62c8044 Mon Sep 17 00:00:00 2001 From: jcesarmobile Date: Thu, 2 Jul 2020 22:28:10 +0200 Subject: [PATCH 3/3] Update cli/src/tasks/new-plugin.ts Co-authored-by: Dan Imhoff --- cli/src/tasks/new-plugin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/tasks/new-plugin.ts b/cli/src/tasks/new-plugin.ts index 94033d54a..6f9a22e4c 100644 --- a/cli/src/tasks/new-plugin.ts +++ b/cli/src/tasks/new-plugin.ts @@ -240,8 +240,8 @@ function generatePackageJSON(answers: NewPluginAnswers, cliVersion: string) { devDependencies: { 'rimraf': '^3.0.0', 'typescript': '^3.2.4', - '@capacitor/ios': `${cliVersion}`, - '@capacitor/android': `${cliVersion}` + '@capacitor/ios': `^${cliVersion}`, + '@capacitor/android': `^${cliVersion}` }, files: [ 'dist/',