Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
21 changes: 21 additions & 0 deletions .changeset/bitter-hornets-beg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
"prettier-config-custom": minor
"@mincho-js/css-additional-types": minor
"@mincho-js/transform-to-vanilla": minor
"eslint-config-custom": minor
"vite-config-custom": minor
"tsconfig-custom": minor
"react-babel": minor
"@mincho-js/integration": minor
"react-swc": minor
"@mincho-js/debug-log": minor
"@mincho-js/esbuild": minor
"@mincho-js/babel": minor
"@mincho-js/react": minor
"@mincho-js/vite": minor
"@mincho-js/css": minor
---

**Big Changes**
- co-location: [@sangkukbae](https://github.com/sangkukbae)'s work, It's still experimental.
- packages: `node16` supports
27 changes: 27 additions & 0 deletions .github/actions/cache-dir/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Cache Dir
description: Caching for **/.cache

inputs:
key:
description: Additional key to be added to the cache key
required: true
paths:
description: Paths to cache
required: false
default: "**/.cache"

runs:
using: composite
steps:
- name: Get current day
id: cache-time
run: echo "time=$(date +%Y-%j)" >> $GITHUB_OUTPUT
shell: bash

- uses: actions/cache@v4
id: cache
with:
path: ${{ inputs.paths }}
key: ${{ runner.os }}-cache-${{ inputs.key }}-${{ hashFiles('**/yarn.lock') }}-${{ steps.cache-time.outputs.time }}
restore-keys: |
${{ runner.os }}-cache-${{ inputs.key }}-${{ hashFiles('**/yarn.lock') }}-
15 changes: 14 additions & 1 deletion .github/actions/node-setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
name: Setup
description: Node.js setup for CI/CD

inputs:
strict:
description: Paths to cache
required: false
default: "true"

runs:
using: composite
Expand All @@ -19,5 +26,11 @@ runs:
${{ runner.os }}-yarn-

- name: Package Install
run: yarn install --immutable
run: |
if [ "${{ inputs.strict }}" = "true" ]; then
yarn install --immutable --check-resolutions --refresh-lockfile
yarn constraints
else
yarn install
fi
shell: bash
1 change: 1 addition & 0 deletions .github/actions/skip-action/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Check skip action
description: Skip action if the same content was already run

# https://github.com/fkirc/skip-duplicate-actions
runs:
Expand Down
39 changes: 36 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,35 @@ jobs:
skip_after_successful_duplicate: "true"
paths_ignore: '["**/README.md"]'

checks:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/node-setup

- name: More setup cache
uses: ./.github/actions/cache-dir
with:
key: checker

- name: Typechecker
run: yarn build:type

- name: Lint & format
run: |
## Workflow lint
yarn lint:action

## Require type build
# https://typescript-eslint.io/getting-started/typed-linting/
yarn lint

build:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
Expand All @@ -31,9 +60,13 @@ jobs:

- name: Setup
uses: ./.github/actions/node-setup
with:
strict: false

- name: Workflow lint
run: yarn lint:action
- name: More setup cache
uses: ./.github/actions/cache-dir
with:
key: build-and-test

- name: Test
run: yarn test:all
run: yarn test
1 change: 1 addition & 0 deletions .github/workflows/fast-forward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ jobs:
setupGitUser: true
createGithubReleases: true
env:
PACKAGE_PUBLISH: "true"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

Expand Down
14 changes: 14 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp

// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"dbaeumer.vscode-eslint",
"rvest.vs-code-prettier-eslint",
"augustocdias.tasks-shell-input",
"vitest.explorer"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
}
62 changes: 62 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
// From https://vitest.dev/guide/debugging#vs-code
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Current Test File",
"autoAttachChildProcesses": true,
"skipFiles": ["<node_internals>/**", "**/node_modules/**"],
"program": "${input:GIT_ROOT}/node_modules/vitest/vitest.mjs",
"args": [
"watch", "${relativeFile}",

// https://vitest.dev/guide/improving-performance
"--no-isolate", "--no-file-parallelism",
"--pool", "threads", "--poolOptions.threads.singleThread"
// "--pool", "forks", "--poolOptions.forks.singleFork"
],
"smartStep": true,
"outFiles": ["${workspaceRoot}/dist/**/*.js"],
"console": "integratedTerminal",
"cwd": "${workspaceRoot}",
},

// https://www.builder.io/blog/debug-nodejs
{
"type": "node",
"request": "launch",
"name": "Debug Current Test File with Remote Debugger",
"autoAttachChildProcesses": true,
"skipFiles": ["<node_internals>/**", "**/node_modules/**"],
"program": "${input:GIT_ROOT}/node_modules/vitest/vitest.mjs",
"args": [
"watch", "${relativeFile}",
"--inspect-brk", "--inspect",
"--no-isolate", "--no-file-parallelism",
"--pool", "threads", "--poolOptions.threads.singleThread"
// "--pool", "forks", "--poolOptions.forks.singleFork"
],
"smartStep": true,
"outFiles": ["${workspaceRoot}/dist/**/*.js"],
"console": "integratedTerminal",
"cwd": "${workspaceRoot}",
}
],

// Need to install `augustocdias.tasks-shell-input` extension
"inputs": [
{
"id": "GIT_ROOT",
"type": "command",
"command": "shellCommand.execute",
"args": {
"command": "git rev-parse --show-toplevel",
"useSingleResult": true,
"useFirstResult": true
}
}
]
}
33 changes: 33 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"git.openRepositoryInParentFolders": "always",
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.tsdk": "./node_modules/typescript/lib",
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
"editor.formatOnPaste": false, // required
"editor.formatOnType": false, // required
"editor.formatOnSave": true, // optional
"editor.formatOnSaveMode": "file", // required to format on save
"files.autoSave": "onFocusChange", // optional but recommended
"vs-code-prettier-eslint.prettierLast": false, // set as "true" to run 'prettier' last not first
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"vscode-color-picker.languages": [
"html",
"css",
"python",
"jsonc",
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue"
],
"cSpell.words": [
"codegen",
"forallpackages",
"mincho"
]
}
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ compressionLevel: mixed

enableGlobalCache: true

enableHardenedMode: false

globalFolder: ./.yarn/cache

nodeLinker: pnpm
Expand Down
3 changes: 2 additions & 1 deletion configs/eslint-config-custom/eslint.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export default tseslint.config(
"_release/**",
"node_modules/**",
"coverage/**",
"vite.config.ts.timestamp*.mjs"
"vite.config.ts.timestamp*.mjs",
".cache"
]
}
);
12 changes: 6 additions & 6 deletions configs/eslint-config-custom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
}
},
"devDependencies": {
"@eslint/js": "^9.23.0",
"@typescript-eslint/parser": "^8.28.0",
"eslint-config-prettier": "^10.1.1",
"eslint-plugin-prettier": "^5.2.5",
"@eslint/js": "^9.24.0",
"@typescript-eslint/parser": "^8.29.1",
"eslint-config-prettier": "^10.1.2",
"eslint-plugin-prettier": "^5.2.6",
"eslint-plugin-yml": "^1.17.0",
"globals": "^15.14.0",
"globals": "^16.0.0",
"prettier-config-custom": "workspace:^",
"typescript-eslint": "^8.28.0",
"typescript-eslint": "^8.29.1",
"yaml-eslint-parser": "^1.3.0"
},
"peerDependencies": {
Expand Down
26 changes: 21 additions & 5 deletions configs/prettier-config-custom/prettier.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
export default {
$schema: "https://json.schemastore.org/prettierrc",
parser: "typescript",
trailingComma: "none",
tabWidth: 2,
semi: true,
bracketSpacing: true,
arrowParens: "always"

overrides: [
{
files: [
"*.js",
"*.cjs",
"*.mjs",
"*.ts",
"*.cts",
"*.mts",
"*.jsx",
"*.tsx"
],
options: {
trailingComma: "none",
semi: true,
bracketSpacing: true,
arrowParens: "always"
}
}
]
};
3 changes: 2 additions & 1 deletion configs/tsconfig-custom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.0",
"private": true,
"files": [
"tsconfig.json"
"tsconfig.base.json",
"tsconfig.node.json"
]
}
Loading