Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update typedoc to the latest version 🚀 #922

Merged
merged 14 commits into from
Nov 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,39 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [7.7.1](https://github.com/brandingbrand/flagship/compare/v7.7.0...v7.7.1) (2019-11-20)

**Note:** Version bump only for package bb-flagship





# [7.7.0](https://github.com/brandingbrand/flagship/compare/v7.6.0...v7.7.0) (2019-11-20)


### Features

* **flagship:** deprecate appcenter.apiconfig configuration option ([55c4b61](https://github.com/brandingbrand/flagship/commit/55c4b61))





# [7.6.0](https://github.com/brandingbrand/flagship/compare/v7.5.4...v7.6.0) (2019-11-14)


### Features

* **flagship:** Add option to only include the default env ([#925](https://github.com/brandingbrand/flagship/issues/925)) ([f29ecfa](https://github.com/brandingbrand/flagship/commit/f29ecfa))
* **fsshopify:** add safe undefined handler ([273653b](https://github.com/brandingbrand/flagship/commit/273653b))
* **fsshopify:** add safe undefined handler ([ab39b48](https://github.com/brandingbrand/flagship/commit/ab39b48))
* **fsshopify:** account data source implementation ([580d95e](https://github.com/brandingbrand/flagship/commit/580d95e))





## [7.5.4](https://github.com/brandingbrand/flagship/compare/v7.5.3...v7.5.4) (2019-11-08)

**Note:** Version bump only for package bb-flagship
Expand Down
4 changes: 3 additions & 1 deletion greenkeeper.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
"react",
"metro-react-native-babel-preset",
"@babel/core",
"@babel/runtime"
"@babel/runtime",
"@types/react",
"@types/react-native"
]
}
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lerna": "3.4.0",
"version": "7.5.4",
"version": "7.7.1",
"packages": [
"packages/*"
],
Expand Down
18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
"@babel/core": "^7.4.5",
"@babel/polyfill": "^7.0.0",
"@brandingbrand/greenkeeper-lockfile": "^0.0.1",
"@commitlint/cli": "^7.1.2",
"@commitlint/config-conventional": "^7.1.2",
"@commitlint/config-lerna-scopes": "^7.1.2",
"@commitlint/travis-cli": "^7.1.2",
"@commitlint/cli": "^8.3.1",
"@commitlint/config-conventional": "^8.3.1",
"@commitlint/config-lerna-scopes": "^8.3.1",
"@commitlint/travis-cli": "^8.3.1",
"@react-native-community/cli": "^1.11.2",
"@storybook/addon-actions": "4.1.18",
"@storybook/addon-knobs": "4.1.18",
Expand Down Expand Up @@ -76,8 +76,8 @@
"babel-jest": "^24.8.0",
"coveralls": "^3.0.2",
"husky": "^0.14.3",
"jest": "^24.8.0",
"lerna": "^3.4.0",
"jest": "^24.9.0",
"lerna": "^3.18.5",
"markdownlint-cli": "^0.16.0",
"metro-react-native-babel-preset": "^0.54.1",
"npm-run-all": "^4.1.3",
Expand All @@ -86,7 +86,7 @@
"rimraf": "^2.6.2",
"ts-jest": "^22.4.6",
"ts-loader": "^4.3.0",
"typedoc": "^0.12.0",
"typedoc": "^0.15.1",
"typedoc-plugin-monorepo": "^0.1.0",
"typescript": "~3.0.0"
},
Expand All @@ -96,6 +96,10 @@
"devDependencyUpdate": "chore: update ${dependency} to version ${version}"
}
},
"resolutions": {
"handlebars": "^4.5.3",
"https-proxy-agent": "^2.2.3"
},
"workspaces": [
"packages/*"
]
Expand Down
24 changes: 24 additions & 0 deletions packages/create-fs-app/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [7.7.1](https://github.com/brandingbrand/flagship/compare/v7.7.0...v7.7.1) (2019-11-20)

**Note:** Version bump only for package @brandingbrand/create-fs-app





# [7.7.0](https://github.com/brandingbrand/flagship/compare/v7.6.0...v7.7.0) (2019-11-20)

**Note:** Version bump only for package @brandingbrand/create-fs-app





# [7.6.0](https://github.com/brandingbrand/flagship/compare/v7.5.4...v7.6.0) (2019-11-14)

**Note:** Version bump only for package @brandingbrand/create-fs-app





## [7.5.4](https://github.com/brandingbrand/flagship/compare/v7.5.3...v7.5.4) (2019-11-08)

**Note:** Version bump only for package @brandingbrand/create-fs-app
Expand Down
2 changes: 1 addition & 1 deletion packages/create-fs-app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@brandingbrand/create-fs-app",
"sideEffects": false,
"version": "7.5.4",
"version": "7.7.1",
"license": "MIT",
"scripts": {
"watch": "tsc --watch",
Expand Down
30 changes: 30 additions & 0 deletions packages/flagship/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,36 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [7.7.1](https://github.com/brandingbrand/flagship/compare/v7.7.0...v7.7.1) (2019-11-20)

**Note:** Version bump only for package @brandingbrand/flagship





# [7.7.0](https://github.com/brandingbrand/flagship/compare/v7.6.0...v7.7.0) (2019-11-20)


### Features

* **flagship:** deprecate appcenter.apiconfig configuration option ([55c4b61](https://github.com/brandingbrand/flagship/commit/55c4b61))





# [7.6.0](https://github.com/brandingbrand/flagship/compare/v7.5.4...v7.6.0) (2019-11-14)


### Features

* **flagship:** Add option to only include the default env ([#925](https://github.com/brandingbrand/flagship/issues/925)) ([f29ecfa](https://github.com/brandingbrand/flagship/commit/f29ecfa))





## [7.5.4](https://github.com/brandingbrand/flagship/compare/v7.5.3...v7.5.4) (2019-11-08)

**Note:** Version bump only for package @brandingbrand/flagship
Expand Down
2 changes: 1 addition & 1 deletion packages/flagship/android/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ lane :appcenter do
gradle(task: "assembleRelease")

appcenter_upload(
api_token: "INJECTED_FROM_CONFIG", #PROJECT_MODIFY_FLAG_appcenter_api_token
#PROJECT_MODIFY_FLAG_appcenter_api_token
owner_name: "INJECTED_FROM_CONFIG", #PROJECT_MODIFY_FLAG_appcenter_owner_name
app_name: "INJECTED_FROM_CONFIG" #PROJECT_MODIFY_FLAG_appcenter_app_name_android
)
Expand Down
2 changes: 1 addition & 1 deletion packages/flagship/ios/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ lane :appcenter do
)

appcenter_upload(
api_token: "INJECTED_FROM_CONFIG", #PROJECT_MODIFY_FLAG_appcenter_api_token
#PROJECT_MODIFY_FLAG_appcenter_api_token
owner_name: "INJECTED_FROM_CONFIG", #PROJECT_MODIFY_FLAG_appcenter_owner_name
app_name: "INJECTED_FROM_CONFIG" #PROJECT_MODIFY_FLAG_appcenter_app_name_ios
)
Expand Down
4 changes: 2 additions & 2 deletions packages/flagship/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@brandingbrand/flagship",
"sideEffects": false,
"version": "7.5.4",
"version": "7.7.1",
"main": "dist/index.js",
"types": "./dist/index.d.ts",
"license": "MIT",
Expand Down Expand Up @@ -31,7 +31,7 @@
}
},
"devDependencies": {
"@brandingbrand/fsengage": "^7.5.4",
"@brandingbrand/fsengage": "^7.7.1",
"@types/yargs": "^12.0.1",
"true-case-path": "^1.0.3"
},
Expand Down
9 changes: 6 additions & 3 deletions packages/flagship/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export interface BuilderArgs {
export interface HandlerArgs {
platform: string;
env: string;
onlyDefault: boolean;
}

const TEMPLATE_ANDROID_PACKAGE = 'com.brandingbrand.reactnative.and.flagship';
Expand Down Expand Up @@ -59,7 +60,7 @@ export function handler(argv: HandlerArgs): void {
helpers.logInfo(`Flagship ${platform} init`);

const projectPackageJSON = require(path.project.resolve('package.json'));
const configuration = initEnvironment(argv.env, projectPackageJSON);
const configuration = initEnvironment(argv.env, projectPackageJSON, argv.onlyDefault);

if (doAndroid) {
initAndroid(projectPackageJSON, configuration, projectPackageJSON.version, argv.env);
Expand Down Expand Up @@ -96,16 +97,18 @@ export function handler(argv: HandlerArgs): void {
*
* @param {string} environmentIdentifier The environment identifier for which to initialize.
* @param {object} packageJSON The project's package.json.
* @param {boolean} onlyDefault Set if you want only the default environment added to the project
* @returns {object} The project configuration.
*/
function initEnvironment(
environmentIdentifier: string,
packageJSON: NPMPackageConfig
packageJSON: NPMPackageConfig,
onlyDefault?: boolean
): Config {
const configuration = env.configuration(environmentIdentifier, packageJSON);

env.write(configuration); // Replace env.js with the current environment
env.createEnvIndex();
env.createEnvIndex(onlyDefault ? environmentIdentifier : undefined);

return configuration;
}
Expand Down
14 changes: 11 additions & 3 deletions packages/flagship/src/lib/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,21 @@ export function configuration(env: string, projectPackageJson: NPMPackageConfig)

/**
* Create a index file for project envs
*
* @param {string} singleEnv Set if you want only a single environment added to the file
*/
export function createEnvIndex(): void {
helpers.logInfo('Creating index file for project envs');
export function createEnvIndex(singleEnv?: string): void {
let envMatch = /env.[\w]+.js/;
if (singleEnv) {
envMatch = new RegExp('env\.' + singleEnv + '\.js');
helpers.logInfo('Creating index file for default env');
} else {
helpers.logInfo('Creating index file for project envs');
}

const envs = fs
.readdirSync(project.resolve('env'))
.filter((f: string) => f.match(/env.[\w]+.js/));
.filter((f: string) => f.match(envMatch));

const envIndexFile = `module.exports = {\n${envs
.map((env: string) => {
Expand Down
19 changes: 13 additions & 6 deletions packages/flagship/src/lib/fastlane.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Config } from '../types';
import * as fs from './fs';
import { logInfo } from '../helpers';
import { logInfo, logWarn } from '../helpers';

/**
* Configures the project Fastfile from the project configuration.
Expand Down Expand Up @@ -67,11 +67,18 @@ export function configure(path: string, configuration: Config): void {
if (configuration && configuration.appCenter) {
const { apiToken, organization, distribute } = configuration.appCenter;

fs.update(
path,
/.+#PROJECT_MODIFY_FLAG_appcenter_api_token/g,
`api_token: "${apiToken}", #PROJECT_MODIFY_FLAG_appcenter_api_token`
);
if (apiToken) {
logWarn(
'appCenter.apiToken is deprecated and will be removed in a future release;'
+ ' use APPCENTER_API_TOKEN environment variable instead'
);

fs.update(
path,
/.+#PROJECT_MODIFY_FLAG_appcenter_api_token/g,
`api_token: "${apiToken}", #PROJECT_MODIFY_FLAG_appcenter_api_token`
);
}

fs.update(
path,
Expand Down
50 changes: 38 additions & 12 deletions packages/flagship/src/lib/ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,20 +250,46 @@ export function usageDescription(configuration: Config): void {
configuration.usageDescriptionIOS.forEach(usage => {
if (fs.doesKeywordExist(infoPlist, usage.key)) {
// Replace the existing usage description for this key
fs.update(
infoPlist,
new RegExp(`<key>${usage.key}<\\/key>\\s+<string>[^<]+<\\/string>`),
`<key>${usage.key}</key><string>${usage.string}</string>`
);
if (usage.array) {
const stringArray = usage.array.map(res => {
return `<string>${res}</string>`;
});
fs.update(
infoPlist,
new RegExp(
`<key>${usage.key}<\\/key>\\s+<array>\\s+(<string>[^<]+<\\/string>\\s+){0,}<\\/array>`
),
`<key>${usage.key}</key><array>${stringArray}</array>`
);
} else {
fs.update(
infoPlist,
new RegExp(`<key>${usage.key}<\\/key>\\s+<string>[^<]+<\\/string>`),
`<key>${usage.key}</key><string>${usage.string}</string>`
);
}
} else {
// This key doesn't exist so add it to the file
fs.update(
infoPlist,
'<key>UIRequiredDeviceCapabilities</key>',
`<key>${usage.key}</key><string>${
usage.string
}</string><key>UIRequiredDeviceCapabilities</key>`
);
if (usage.array) {
const stringArray = usage.array.map(res => {
return `<string>${res}</string>`;
});
fs.update(
infoPlist,
'<key>UIRequiredDeviceCapabilities</key>',
`<key>${usage.key}</key>`
+ `<array>${stringArray.join('')}</array>`
+ `<key>UIRequiredDeviceCapabilities</key>`
);
} else {
fs.update(
infoPlist,
'<key>UIRequiredDeviceCapabilities</key>',
`<key>${usage.key}</key><string>${
usage.string
}</string><key>UIRequiredDeviceCapabilities</key>`
);
}
}
});
}
Expand Down
5 changes: 3 additions & 2 deletions packages/flagship/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface Config {
};

appCenter?: {
apiToken: string;
apiToken?: string; // deprecated; will be removed in a future release
organization: string;
distribute?: {
appNameIOS?: string;
Expand Down Expand Up @@ -78,7 +78,8 @@ export interface Config {
entitlementsFileIOS?: string;
usageDescriptionIOS?: {
key: string;
string: string;
string?: string;
array?: string[];
}[];

UIBackgroundModes?: {
Expand Down
Loading