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

EPD-572 Setup CLI repo #1

Merged
merged 33 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add script for fixing ink types
  • Loading branch information
Nicole White committed Feb 18, 2024
commit 4a375d8e9515b13c1a44b68f40ace2c07a180da9
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Fixup ink types
run: bash ./tools/fixup-ink-types.sh

- name: Run type checks
run: npm run type-check

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Fixup ink types
run: bash ./tools/fixup-ink-types.sh

- name: Set version in package.json
run: npm version ${{ inputs.version }} --no-git-tag-version

Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.prettierignore
*.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: i don't think you need this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was going to add e2e tests for both the python and ts sdks so will just leave it

CODEOWNERS
*.sh
26 changes: 1 addition & 25 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,4 @@ See:
They suggest updating `tsconfig.json`'s `module` and `moduleResolution` fields to `node16`, but this breaks
the types for other packages (like `hono`), so we patch the `ink*` packages instead.

After running `npm install`, go to each `ink*` package in `node_modules/` and update their `package.json`:

[`ink`](./node_modules/ink/package.json):

```json
{
"types": "build/"
}
```

[`ink-link`](./node_modules/ink-link/package.json):

```json
{
"types": "dist/"
}
```

[`ink-spinner`](./node_modules/ink-link/package.json):

```json
{
"types": "build/"
}
```
After running `npm install`, run `bash ./tools/fixup-ink-types.sh` to fix the types.
14 changes: 14 additions & 0 deletions tools/fixup-ink-types.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# Fixes the types field in package.json
modify_package_json() {
local module_name=$1
local types_dir=$2

jq ".types = \"$types_dir\"" node_modules/${module_name}/package.json > node_modules/${module_name}/package.json.tmp
mv node_modules/${module_name}/package.json.tmp node_modules/${module_name}/package.json
}

modify_package_json "ink" "build/"
modify_package_json "ink-link" "dist/"
modify_package_json "ink-spinner" "build/"