-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Timo Glastra <[email protected]>
- Loading branch information
1 parent
a929826
commit 658365f
Showing
19 changed files
with
308 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: Pipeline | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
pull_request: | ||
|
||
workflow_dispatch: | ||
inputs: | ||
release-type: | ||
description: "Type of release (major, minor, patch, alpha)" | ||
required: true | ||
default: alpha | ||
type: choice | ||
options: | ||
- major | ||
- minor | ||
- patch | ||
- alpha | ||
|
||
jobs: | ||
continuous-integration: | ||
name: "Continuous Integration" | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9 | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Style | ||
run: pnpm style:check | ||
|
||
- name: Build | ||
run: pnpm build | ||
|
||
- name: Check types | ||
run: pnpm types:check | ||
|
||
continuous-deployment: | ||
if: github.event_name == 'workflow_dispatch' | ||
|
||
name: 'Continuous Deployment' | ||
runs-on: ubuntu-latest | ||
needs: ['continuous-integration'] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9 | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Build | ||
run: pnpm build | ||
|
||
- name: Set git configuration | ||
run: | | ||
git config user.name "Animo Solutions" | ||
git config user.email "[email protected]" | ||
- name: Publish | ||
id: publish | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN | ||
if [ ${{ inputs.release-type }} == 'alpha' ]; then | ||
pnpm release --preRelease=alpha | ||
else | ||
pnpm release -i=${{ inputs.release-type }} | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,6 @@ __tests__ | |
/android/build/ | ||
/ausweis-example/ | ||
|
||
./src | ||
src | ||
plugin/src | ||
tsconfig.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"github": { | ||
"release": true | ||
}, | ||
"npm": { | ||
"skipChecks": true, | ||
"tag": "latest" | ||
}, | ||
"git": { | ||
"push": false, | ||
"commit": false, | ||
"requireCommits": true, | ||
"tagAnnotation": "${version}", | ||
"requireBranch": "main" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
module.exports = require('./plugin/build'); | ||
module.exports = require('./plugin/build') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,9 @@ | ||
import { View, Text, StyleSheet } from "react-native"; | ||
import { StyleSheet, Text, View } from 'react-native' | ||
|
||
export default function App() { | ||
return ( | ||
<View | ||
style={[ | ||
StyleSheet.absoluteFill, | ||
{ flex: 1, alignContent: "center", justifyContent: "center" }, | ||
]} | ||
> | ||
<Text>Hello</Text> | ||
</View> | ||
); | ||
return ( | ||
<View style={[StyleSheet.absoluteFill, { flex: 1, alignContent: 'center', justifyContent: 'center' }]}> | ||
<Text>Hello</Text> | ||
</View> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module.exports = (api) => { | ||
api.cache(true); | ||
return { | ||
presets: ["babel-preset-expo"], | ||
}; | ||
}; | ||
api.cache(true) | ||
return { | ||
presets: ['babel-preset-expo'], | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.8.1/schema.json", | ||
"formatter": { | ||
"lineWidth": 120, | ||
"indentStyle": "space" | ||
}, | ||
"javascript": { | ||
"parser": { | ||
"unsafeParameterDecoratorsEnabled": true | ||
}, | ||
"formatter": { | ||
"semicolons": "asNeeded", | ||
"quoteStyle": "single", | ||
"trailingCommas": "es5", | ||
"lineWidth": 120, | ||
"indentStyle": "space" | ||
} | ||
}, | ||
"json": { | ||
"parser": { | ||
"allowComments": true | ||
} | ||
}, | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true | ||
}, | ||
"vcs": { | ||
"useIgnoreFile": true, | ||
"clientKind": "git", | ||
"enabled": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,10 @@ | ||
import { | ||
createRunOncePlugin, | ||
type ConfigPlugin, | ||
withPlugins, | ||
} from "@expo/config-plugins"; | ||
import { type ConfigPlugin, createRunOncePlugin, withPlugins } from '@expo/config-plugins' | ||
|
||
import { withAndroidAusweisSdk } from "./withAndroidAusweisSdk"; | ||
import { withIosAusweisSdk } from "./withIosAusweisSdk"; | ||
import { withAndroidAusweisSdk } from './withAndroidAusweisSdk' | ||
import { withIosAusweisSdk } from './withIosAusweisSdk' | ||
|
||
const withAusweisSdk: ConfigPlugin = (config) => { | ||
return withPlugins(config, [withAndroidAusweisSdk, withIosAusweisSdk]); | ||
}; | ||
return withPlugins(config, [withAndroidAusweisSdk, withIosAusweisSdk]) | ||
} | ||
|
||
export default createRunOncePlugin( | ||
withAusweisSdk, | ||
"@animo-id/expo-ausweis-sdk", | ||
); | ||
export default createRunOncePlugin(withAusweisSdk, '@animo-id/expo-ausweis-sdk') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,46 @@ | ||
import type { ConfigPlugin } from "@expo/config-plugins"; | ||
import type { ConfigPlugin } from '@expo/config-plugins' | ||
|
||
import path from "node:path"; | ||
import fs from "node:fs/promises"; | ||
import { withDangerousMod } from "@expo/config-plugins"; | ||
import { | ||
mergeContents, | ||
MergeResults, | ||
} from "@expo/config-plugins/build/utils/generateCode"; | ||
import fs from 'node:fs/promises' | ||
import path from 'node:path' | ||
import { withDangerousMod } from '@expo/config-plugins' | ||
import { type MergeResults, mergeContents } from '@expo/config-plugins/build/utils/generateCode' | ||
|
||
const podSource = `pod 'AusweisApp2', :path => File.join(File.dirname(\`node --print "require.resolve('@animo-id/expo-ausweis-sdk/package.json')"\`), "ios/Specs")`; | ||
const podSource = `pod 'AusweisApp2', :path => File.join(File.dirname(\`node --print "require.resolve('@animo-id/expo-ausweis-sdk/package.json')"\`), "ios/Specs")` | ||
|
||
export function addAusweisApp2Pod(src: string): MergeResults { | ||
return mergeContents({ | ||
tag: "@animo-id/expo-ausweis-sdk", | ||
src, | ||
newSrc: podSource, | ||
anchor: /use_native_modules/, | ||
offset: 0, | ||
comment: "#", | ||
}); | ||
return mergeContents({ | ||
tag: '@animo-id/expo-ausweis-sdk', | ||
src, | ||
newSrc: podSource, | ||
anchor: /use_native_modules/, | ||
offset: 0, | ||
comment: '#', | ||
}) | ||
} | ||
|
||
const withIosAusweisApp2Pod: ConfigPlugin = (config) => { | ||
return withDangerousMod(config, [ | ||
"ios", | ||
async (config) => { | ||
const filePath = path.join( | ||
config.modRequest.platformProjectRoot, | ||
"Podfile", | ||
); | ||
const contents = await fs.readFile(filePath, "utf-8"); | ||
const results = addAusweisApp2Pod(contents); | ||
|
||
if (!results.didMerge) { | ||
console.log( | ||
"ERROR: Cannot add AusweisApp2 to the project's ios/Podfile because it's malformed. Please report this with a copy of your project Podfile.", | ||
); | ||
return config; | ||
} | ||
|
||
await fs.writeFile(filePath, results.contents); | ||
return config; | ||
}, | ||
]); | ||
}; | ||
return withDangerousMod(config, [ | ||
'ios', | ||
async (config) => { | ||
const filePath = path.join(config.modRequest.platformProjectRoot, 'Podfile') | ||
const contents = await fs.readFile(filePath, 'utf-8') | ||
const results = addAusweisApp2Pod(contents) | ||
|
||
if (!results.didMerge) { | ||
console.log( | ||
"ERROR: Cannot add AusweisApp2 to the project's ios/Podfile because it's malformed. Please report this with a copy of your project Podfile." | ||
) | ||
return config | ||
} | ||
|
||
await fs.writeFile(filePath, results.contents) | ||
return config | ||
}, | ||
]) | ||
} | ||
|
||
const withIosAusweisSdk: ConfigPlugin = (config) => { | ||
return withIosAusweisApp2Pod(config); | ||
}; | ||
return withIosAusweisApp2Pod(config) | ||
} | ||
|
||
export { withIosAusweisSdk }; | ||
export { withIosAusweisSdk } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
}, | ||
"include": ["./src"], | ||
"exclude": ["**/__mocks__/*", "**/__tests__/*"] | ||
} | ||
} |
Oops, something went wrong.