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

Add ci workflow & update react template #31

Merged
merged 6 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from 3 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
26 changes: 26 additions & 0 deletions .github/workflows/code-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Check code health
Copy link
Contributor Author

@shogo0421 shogo0421 Oct 28, 2024

Choose a reason for hiding this comment

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

ref: workflow in line/liff-inspector

This workflow is not currently running in this repository.
However, it is running in my forked repository, and there are no errors.
https://github.com/shogo0421/create-liff-app/actions/runs/11549522724

github docs (about-workflow-runs-from-public-forks)

workflows on pull requests to public repositories from some outside contributors will not run automatically, and might need to be approved first. By default, all first-time contributors require approval to run workflows.


on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --immutable --immutable-cache --check-cache
- name: Run lint
run: yarn run lint
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
run: yarn run lint
run: yarn run lint:eslint

- name: Run build
run: yarn run build
- name: Run test
run: yarn run test
3 changes: 3 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
"watch": "tsc -w",
"start": "yarn build && node dist/index.js",
"test": "yarn build && jest",
"lint:eslint": "eslint '**/*.{ts,js}'",
"fix:eslint": "yarn lint:eslint --fix"
"lint": "eslint '**/*.{ts,js}'",
"fix:lint": "yarn lint --fix",
"format": "prettier --check '**/*.{ts,js,json,md}'",
"fix:format": "prettier --write .",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can I format all files and commit in this PR?

"code-check": "yarn run lint && yarn run build && yarn run test",
"publish": "yarn run code-check && yarn run build && yarn npm publish --access public"
},
"keywords": [
"LINE",
Expand Down Expand Up @@ -57,4 +61,4 @@
"access": "public",
"registry": "https://registry.npmjs.org/"
}
}
}
13 changes: 6 additions & 7 deletions templates/react-ts/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import App from './App';

ReactDOM.render(
Copy link
Contributor Author

@shogo0421 shogo0421 Oct 28, 2024

Choose a reason for hiding this comment

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

ReactDOM.render is deprecated.

ref : react template in create-vite

Copy link
Member

Choose a reason for hiding this comment

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

Thank you for your suggestion.

We would like to avoid making multiple changes to a single pull request.
Could you create a separate pull request for React?

<React.StrictMode>
createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />
</React.StrictMode>,
document.getElementById("root")
</StrictMode>
);
13 changes: 6 additions & 7 deletions templates/react/src/main.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import App from './App';

ReactDOM.render(
<React.StrictMode>
createRoot(document.getElementById('root')).render(
<StrictMode>
<App />
</React.StrictMode>,
document.getElementById("root")
</StrictMode>
);