@contentful/app-scripts 0.15.0 → 0.16.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,10 +6,7 @@ const { isString, isPlainObject, has } = require('lodash');
6
6
 
7
7
  const { throwValidationException, selectFromList } = require('../utils');
8
8
  const { cacheEnvVars } = require('../../utils/cache-credential');
9
- const {
10
- ORG_ID_ENV_KEY,
11
- APP_DEF_ENV_KEY,
12
- } = require('../../utils/constants');
9
+ const { ORG_ID_ENV_KEY, APP_DEF_ENV_KEY } = require('../../utils/constants');
13
10
 
14
11
  async function fetchOrganizations(client) {
15
12
  try {
@@ -64,7 +61,11 @@ async function createAppDefinition(accessToken, appDefinitionSettings = { locati
64
61
  const client = createClient({ accessToken });
65
62
  const organizations = await fetchOrganizations(client);
66
63
 
67
- const selectedOrg = await selectFromList(organizations, 'Select an organization for your app:', ORG_ID_ENV_KEY);
64
+ const selectedOrg = await selectFromList(
65
+ organizations,
66
+ 'Select an organization for your app:',
67
+ ORG_ID_ENV_KEY
68
+ );
68
69
  const organizationId = selectedOrg.value;
69
70
 
70
71
  const appName = appDefinitionSettings.name || path.basename(process.cwd());
@@ -89,7 +90,7 @@ async function createAppDefinition(accessToken, appDefinitionSettings = { locati
89
90
  const organization = await client.getOrganization(organizationId);
90
91
  const createdAppDefinition = await organization.createAppDefinition(body);
91
92
  await cacheEnvVars({
92
- [APP_DEF_ENV_KEY]: createdAppDefinition.sys.id
93
+ [APP_DEF_ENV_KEY]: createdAppDefinition.sys.id,
93
94
  });
94
95
 
95
96
  console.log(`
@@ -111,7 +112,7 @@ async function createAppDefinition(accessToken, appDefinitionSettings = { locati
111
112
  } catch (err) {
112
113
  console.log(`
113
114
  Something went wrong while creating the app definition.
114
- Run ${chalk.cyan('`npx @contentful/create-contentful-app create-definition`')} to try again.
115
+ Run ${chalk.cyan('`npx @contentful/app-scripts create-app-definition`')} to try again.
115
116
 
116
117
  ${err.message}
117
118
  `);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/app-scripts",
3
- "version": "0.15.0",
3
+ "version": "0.16.0-alpha.1",
4
4
  "description": "A collection of scripts for building Contentful Apps",
5
5
  "author": "Contentful GmbH",
6
6
  "license": "MIT",
@@ -61,5 +61,5 @@
61
61
  "open": "^8.0.5",
62
62
  "ora": "^5.4.0"
63
63
  },
64
- "gitHead": "c99c580ff38697de28525f5214b7c9e616493f14"
64
+ "gitHead": "8080d77aa57344f434a9ce6f223eff40328c7a33"
65
65
  }