Skip to content

Commit

Permalink
Merge pull request #1 from mincho-js/setup
Browse files Browse the repository at this point in the history
Environment and Structure setup
  • Loading branch information
black7375 authored Nov 12, 2023
2 parents f2ef6cb + ff79fae commit 5a08411
Show file tree
Hide file tree
Showing 42 changed files with 7,015 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true

[*.{js,json,yml}]
charset = utf-8
indent_style = space
indent_size = 2
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.yarn/** linguist-vendored
/.yarn/releases/* binary
/.yarn/plugins/**/* binary
/.pnp.* binary linguist-generated
23 changes: 23 additions & 0 deletions .github/actions/node-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Setup

runs:
using: composite
steps:
# https://github.com/actions/cache/blob/main/examples.md#node---yarn
# https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
shell: bash

- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Package Install
run: yarn install --immutable
shell: bash
11 changes: 11 additions & 0 deletions .github/actions/skip-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Check skip action

# https://github.com/fkirc/skip-duplicate-actions
runs:
using: composite
steps:
- uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: same_content_newer
skip_after_successful_duplicate: "true"
paths_ignore: '["**/README.md"]'
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

# This action works with pull requests and pushes
on: [push, pull_request]

jobs:
pre_job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Check SkipAction
id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: same_content_newer
skip_after_successful_duplicate: "true"
paths_ignore: '["**/README.md"]'

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

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

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

- name: Workflow lint
run: yarn lint:action

- name: Test
run: yarn test:all
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,6 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# Turborepo
.turbo
541 changes: 541 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-outdated.cjs

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-typescript.cjs

Large diffs are not rendered by default.

874 changes: 874 additions & 0 deletions .yarn/releases/yarn-3.6.4.cjs

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
nodeLinker: pnpm

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
- path: .yarn/plugins/@yarnpkg/plugin-outdated.cjs
spec: "https://mskelton.dev/yarn-outdated/v3"
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
spec: "@yarnpkg/plugin-typescript"

yarnPath: .yarn/releases/yarn-3.6.4.cjs
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# mincho
Natural CSS in the Typescript

This project is in its initial stage and is guided by the [RFC of the working group](https://github.com/mincho-js/working-group), so if you want to add a feature rather than a bug fix, you can create an RFC or open a discussion.
28 changes: 28 additions & 0 deletions configs/eslint-config-custom/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const { defineConfig } = require('eslint-define-config');

module.exports = defineConfig({
$schema: "https://json.schemastore.org/eslintrc.json",
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
EXPERIMENTAL_useProjectService: true
},
plugins: [
"@typescript-eslint",
"prettier"
],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:prettier/recommended"
],
rules: {
"prettier/prettier": ["error", { "endOfLine": "auto" }]
},
env: {
node: true
},
ignorePatterns: ["dist/**", "node_modules/**", "coverage/**"]
});
14 changes: 14 additions & 0 deletions configs/eslint-config-custom/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "eslint-config-custom",
"version": "0.0.0",
"private": true,
"main": "index.js",
"license": "MIT",
"devDependencies": {
"@typescript-eslint/parser": "^6.10.0",
"eslint-define-config": "^1.24.1"
},
"peerDependencies": {
"eslint": "*"
}
}
23 changes: 23 additions & 0 deletions configs/eslint-conifg-yaml/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const { defineConfig } = require('eslint-define-config');

module.exports = defineConfig({
$schema: "https://json.schemastore.org/eslintrc.json",
parser: "yaml-eslint-parser",
parserOptions: {
defaultYAMLVersion: "1.2"
},
extends: [
"eslint:recommended",
"plugin:yml/standard",
"plugin:yml/prettier",
"prettier",
"plugin:prettier/recommended"
],
rules: {
"prettier/prettier": ["error", { "endOfLine": "auto" }]
},
env: {
node: true
},
ignorePatterns: ["dist/**", "node_modules/**", "coverage/**"]
});
14 changes: 14 additions & 0 deletions configs/eslint-conifg-yaml/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "eslint-config-yaml",
"version": "0.0.0",
"private": true,
"main": "index.js",
"license": "MIT",
"devDependencies": {
"eslint-define-config": "^1.24.1",
"yaml-eslint-parser": "^1.2.2"
},
"peerDependencies": {
"eslint": "*"
}
}
10 changes: 10 additions & 0 deletions configs/prettier-config-custom/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "prettier-config-custom",
"version": "0.0.0",
"private": true,
"type": "module",
"main": "prettier.config.js",
"files": [
"prettier.config.js"
]
}
9 changes: 9 additions & 0 deletions configs/prettier-config-custom/prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default {
"$schema": "https://json.schemastore.org/prettierrc",
"parser": "typescript",
"trailingComma": "none",
"tabWidth": 2,
"semi": true,
"bracketSpacing": true,
"arrowParens": "always"
}
8 changes: 8 additions & 0 deletions configs/tsconfig-custom/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "tsconfig-custom",
"version": "0.0.0",
"private": true,
"files": [
"tsconfig.json"
]
}
109 changes: 109 additions & 0 deletions configs/tsconfig-custom/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */

/* Projects */
"incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
"composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */

/* Language and Environment */
"target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
// "lib": ["ES2020", "dom"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
"useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */

/* Modules */
"module": "ESNext", /* Specify what module code is generated. */
// "rootDir": ".", /* Specify the root folder within your source files. */
"moduleResolution": "bundler", /* Specify how TypeScript looks up a file from a given module specifier. */
"baseUrl": ".", /* Specify the base directory to resolve non-relative module names. */
"paths": { /* Specify a set of entries that re-map imports to additional lookup locations. */
"@/*": ["src/*"]
},
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
"types": [ /* Specify type package names to be included without being referenced in a source file. */
"vitest/importMeta",
"vite/client"
],
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
// "resolveJsonModule": true, /* Enable importing .json files. */
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */

/* JavaScript Support */
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */

/* Emit */
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "outFile": "./dist", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */
"importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
// "newLine": "crlf", /* Set the newline character for emitting files. */
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */

/* Interop Constraints */
"isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
"allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
// "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */

/* Type Checking */
"strict": true, /* Enable all strict type-checking options. */
// "noImplicitAny": false, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
"strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
"noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
"noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
"noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */

/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true
}
}
13 changes: 13 additions & 0 deletions configs/vite-config-custom/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { ConfigEnv, mergeConfig } from "vite";
import type { defineConfig } from "vitest/config";

type TInputConfig = Parameters<typeof defineConfig>;
type TOutputConfig = ReturnType<typeof mergeConfig>;

declare function UserConfig(
viteConfigEnv: ConfigEnv,
extendConfigs?: TInputConfig = {}
): TOutputConfig;

export declare const NodeConfig = UserConfig;
export declare const ReactConfig = UserConfig;
Loading

0 comments on commit 5a08411

Please sign in to comment.