Skip to content

Commit

Permalink
feat: ci (#10)
Browse files Browse the repository at this point in the history
* fix(android): add try/catch handling to `appendWavHeader` to avoid any possible I/O exceptions

* docs: update readme

* chore: add lint & ts checks to CI

* chore: add prettier CI workflow

* fix: add build folder to prettierignore

* remove prettier workflow

---------

Co-authored-by: jamsch <jamsch@users.noreply.github.com>
  • Loading branch information
jamsch and jamsch authored Aug 31, 2024
1 parent c45e512 commit df2e425
Show file tree
Hide file tree
Showing 12 changed files with 172 additions and 390 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Check ESLint

on:
pull_request:

jobs:
eslint:
name: ESLint
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v4

- name: 📦 Install dependencies
run: npm install

- name: 🤓 Run ESLint
run: npm run lint
18 changes: 18 additions & 0 deletions .github/workflows/typescript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Run Typescript

on:
pull_request:

jobs:
typescript-check:
name: Typescript check
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v4

- name: 📦 Install dependencies
run: npm install

- name: 🔍 Run Typescript check
run: npm run ts:check
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
example/android/
example/ios/
android/
ios/
.expo/
build/
2 changes: 1 addition & 1 deletion example/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default function App() {
// When a final result is received, any following recognized transcripts will omit the previous final result
const transcriptTally = ev.isFinal
? (current?.transcriptTally ?? "") + transcript
: current?.transcriptTally ?? "";
: (current?.transcriptTally ?? "");

return {
transcriptTally,
Expand Down
4 changes: 2 additions & 2 deletions example/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"expo-speech-recognition": ["../src/index"],
"expo-speech-recognition/*": ["../src/*"]
},
"types": ["@types/dom-speech-recognition"],
},
"types": ["@types/dom-speech-recognition"]
}
}
12 changes: 6 additions & 6 deletions example/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
const createConfigAsync = require('@expo/webpack-config');
const path = require('path');
const createConfigAsync = require("@expo/webpack-config");
const path = require("path");

module.exports = async (env, argv) => {
const config = await createConfigAsync(
{
...env,
babel: {
dangerouslyAddModulePathsToTranspile: ['expo-speech-recognition'],
dangerouslyAddModulePathsToTranspile: ["expo-speech-recognition"],
},
},
argv
argv,
);
config.resolve.modules = [
path.resolve(__dirname, './node_modules'),
path.resolve(__dirname, '../node_modules'),
path.resolve(__dirname, "./node_modules"),
path.resolve(__dirname, "../node_modules"),
];

return config;
Expand Down
Loading

0 comments on commit df2e425

Please sign in to comment.