Skip to content

Commit

Permalink
feat(fsapp): add fsapp plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
crherman7 committed Dec 31, 2024
1 parent 76cda37 commit 7c03580
Show file tree
Hide file tree
Showing 52 changed files with 649 additions and 1,047 deletions.
81 changes: 81 additions & 0 deletions apps/docs/src/content/docs/packages/plugin-fsapp.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
title: plugin-fsapp
---

The "plugin-fsapp"

## Install

Add `@brandingbrand/code-plugin-fsapp` as a development dependency to your React Native project.

import {Tabs, TabItem} from '@astrojs/starlight/components';

<Tabs>
<TabItem label="yarn">

```sh
yarn add --dev @brandingbrand/code-plugin-fsapp
```

</TabItem>
<TabItem label="npm">

```sh
npm install --save-dev @brandingbrand/code-plugin-fsapp
```

</TabItem>
<TabItem label="pnpm">

```sh
pnpm add --save-dev @brandingbrand/code-plugin-fsapp
```

</TabItem>
<TabItem label="bun">

```sh
bun add --dev @brandingbrand/code-plugin-fsapp
```

</TabItem>
</Tabs>

Your package.json should now be updated, `@brandingbrand/code-plugin-fsapp` should be listed as a `devDependency`.

```json title="package.json" ins={10}
{
"name": "my-awesome-app",
"version": "1.0.0",
"author": "Your Name <[email protected]>",
"dependencies": {
"react": "^18.2.0",
"react-native": "~0.72.0"
},
"devDependencies": {
"@brandingbrand/code-plugin-fsapp": "1.0.0"
}
}
```

## Configure

### Flagship Code Configuration

Upon installing the dependency, it is imperative to update the `flagship-code.config.ts` file. Specifically, ensure that the `plugins` array includes the newly installed dependency. This step is crucial, as Flagship Code will only invoke the plugin if it is listed within this array. By including the dependency in the `plugins` array, you enable Flagship Code to recognize and utilize the functionality provided by the plugin during project execution.

```ts title="flagship-code.config.ts" ins={9}
import {defineConfig} from '@brandingbrand/code-cli-kit';

export default defineConfig({
buildPath: './coderc/build',
envPath: './coderc/env',
pluginPath: './coderc/plugins',
plugins: [
// other plugins
'@brandingbrand/code-plugin-fsapp',
],
});
```

For more detailed guidance and information, please refer to the [Flagship Code Configuration](/guides/config) guide. This resource offers comprehensive instructions and insights to assist you in configuring Flagship Code effectively.
1 change: 1 addition & 0 deletions apps/example/flagship-code.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default defineConfig({
* An array of plugin names.
*/
plugins: [
'@brandingbrand/code-plugin-fsapp',
'@brandingbrand/code-plugin-native-navigation',
'@brandingbrand/code-plugin-asset',
'@brandingbrand/code-plugin-app-icon',
Expand Down
1 change: 1 addition & 0 deletions apps/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@brandingbrand/code-jest-config": "*",
"@brandingbrand/code-plugin-app-icon": "*",
"@brandingbrand/code-plugin-asset": "*",
"@brandingbrand/code-plugin-fsapp": "*",
"@brandingbrand/code-plugin-native-navigation": "*",
"@brandingbrand/code-plugin-permissions": "*",
"@brandingbrand/code-plugin-splash-screen": "*",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
"@types/babel__core": "^7.20.5",
"@types/node": "^22.3.0",
"@types/react": "18.2.6",
"react": "18.2.0",
"react-native": "0.73.11",
"react-native-sensitive-info": "^5.5.8",
"react": "18.2.0",
"typescript": "^5.5.4"
}
}
4 changes: 2 additions & 2 deletions packages/app-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"@repo/typescript-config": "*",
"@types/eslint": "^8.56.1",
"@types/url-parse": "^1.4.11",
"typescript": "^5.3.3",
"react": "18.2.0",
"react-native": "0.73.11",
"react-native-navigation": "^7.40.1"
"react-native-navigation": "^7.40.1",
"typescript": "^5.3.3"
}
}
2 changes: 0 additions & 2 deletions packages/cli-kit/src/@types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ export type PrebuildOptions = {
build: string;
/** The cli command. */
command: string;
/** The environment version. */
env: string;
/** Indicates whether it's a release build. */
release: boolean;
/** Indicates whether to display verbose output. */
Expand Down
1 change: 0 additions & 1 deletion packages/cli/__tests__/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ describe('config object', () => {
it('should be able to update options configuration', () => {
const optionsConfig: PrebuildOptions = {
build: 'internal',
env: 'prod',
release: false,
verbose: false,
platform: 'ios',
Expand Down
31 changes: 0 additions & 31 deletions packages/cli/__tests__/env-switcher-java.ts

This file was deleted.

26 changes: 0 additions & 26 deletions packages/cli/__tests__/env-switcher-m.ts

This file was deleted.

32 changes: 0 additions & 32 deletions packages/cli/__tests__/main-application-java.ts

This file was deleted.

31 changes: 0 additions & 31 deletions packages/cli/__tests__/native-constants-java.ts

This file was deleted.

26 changes: 0 additions & 26 deletions packages/cli/__tests__/native-constants-m.ts

This file was deleted.

6 changes: 0 additions & 6 deletions packages/cli/__tests__/project-pbxproj.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ describe('ios project.pbxproj transformers', () => {
expect(content).toContain(
'/* app.entitlements */ = {isa = PBXFileReference; name = "app.entitlements"; path = "app/app.entitlements"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; explicitFileType = undefined; includeInIndex = 0; };',
);
expect(content).toContain(
'/* NativeConstants.m */ = {isa = PBXFileReference; name = "NativeConstants.m"; path = "app/NativeConstants.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };',
);
expect(content).toContain(
'/* EnvSwitcher.m */ = {isa = PBXFileReference; name = "EnvSwitcher.m"; path = "app/EnvSwitcher.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };',
);
expect(content).toContain(
'/* app.swift */ = {isa = PBXFileReference; name = "app.swift"; path = "app/app.swift"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.swift; explicitFileType = undefined; includeInIndex = 0; };',
);
Expand Down
32 changes: 0 additions & 32 deletions packages/cli/__tests__/react-native-0.73/main-application-kt.ts

This file was deleted.

6 changes: 0 additions & 6 deletions packages/cli/__tests__/react-native-0.73/project-pbxproj.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ describe('ios project.pbxproj transformers', () => {
expect(content).toContain(
'/* app.entitlements */ = {isa = PBXFileReference; name = "app.entitlements"; path = "app/app.entitlements"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; explicitFileType = undefined; includeInIndex = 0; };',
);
expect(content).toContain(
'/* NativeConstants.m */ = {isa = PBXFileReference; name = "NativeConstants.m"; path = "app/NativeConstants.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };',
);
expect(content).toContain(
'/* EnvSwitcher.m */ = {isa = PBXFileReference; name = "EnvSwitcher.m"; path = "app/EnvSwitcher.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };',
);
expect(content).toContain(
'/* app.swift */ = {isa = PBXFileReference; name = "app.swift"; path = "app/app.swift"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.swift; explicitFileType = undefined; includeInIndex = 0; };',
);
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/actions/dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default defineAction(
* @param {string} dependency - The name of the dependency.
* @param {Profile} profile - The profile specifying the version and other details for the dependency.
*/
function verifyDependency(dependency: string, profile: Profile) {
function verifyDependency(dependency: string, profile: Profile): any {
if (executedProfiles.includes(dependency)) return;

executedProfiles.push(dependency);
Expand Down
Loading

0 comments on commit 7c03580

Please sign in to comment.