Skip to content

Commit

Permalink
Eject wes-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
WesSouza committed Dec 16, 2023
1 parent b6882ef commit 52cf546
Show file tree
Hide file tree
Showing 17 changed files with 3,108 additions and 103 deletions.
29 changes: 29 additions & 0 deletions .config/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"parser": "@typescript-eslint/parser",
"extends": ["plugin:@typescript-eslint/recommended"],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_\\d*$"
}
]
},
"ignorePatterns": ["**/dist/**"],
"overrides": [
{
"files": ["examples/**/*"],
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
}
]
}
4 changes: 4 additions & 0 deletions .config/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
34 changes: 34 additions & 0 deletions .config/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import typescript from '@rollup/plugin-typescript';
import esbuild from 'rollup-plugin-esbuild';

export default [
{
input: './src/index.ts',
output: [
{
dir: './dist',
format: 'cjs',
entryFileNames: '[name].cjs',
exports: 'auto',
preserveModules: true,
sourcemap: true,
},
{
dir: './dist',
exports: 'auto',
format: 'es',
preserveModules: true,
sourcemap: true,
},
],
external: (id) => !/^[./]/.test(id),
plugins: [
esbuild(),
typescript({
tsconfig: '.config/tsconfig.build.json',
declaration: true,
declarationDir: 'dist',
}),
],
},
];
8 changes: 8 additions & 0 deletions .config/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../dist",
"rootDir": "../src"
},
"include": ["../src/**/*.ts"]
}
32 changes: 32 additions & 0 deletions .config/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"compilerOptions": {
"allowJs": true,
"alwaysStrict": true,
"declaration": true,
"declarationMap": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"importHelpers": true,
"lib": ["ESNext"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"outDir": "dist",
"resolveJsonModule": true,
"rootDir": "../",
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"target": "ES2017"
},
"exclude": ["dist", "node_modules"],
"include": ["../**/*.ts"]
}
10 changes: 10 additions & 0 deletions .config/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/// <reference types="vitest" />

import { defineConfig } from 'vite';

// https://vitejs.dev/config/
export default defineConfig({
test: {
globals: true,
},
});
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# top-most EditorConfig file
root = true

# global preferences
[*]
indent_style = space
indent_size = 2

# Other preferences
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
41 changes: 0 additions & 41 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

29 changes: 15 additions & 14 deletions .github/workflows/lint-typecheck-test-build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# ⚠️ WARNING
# This file is auto-generated by https://github.com/WesSouza/wes-cli

name: Lint, Type Check, Test, Build

on:
pull_request:
push:
branches:
- "main"

jobs:
check:
Expand All @@ -14,29 +13,31 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ['16.x', '18.x']
node: ['18.x', '20.x']
os: [ubuntu-latest, macOS-latest]

steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Install wes-cli
run: |
npm i -g [email protected]
wes install
uses: actions/checkout@v4

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'yarn'

- name: Lint
run: yarn lint
- name: Install
run: yarn install --frozen-lockfile

- name: Check Types
- name: Check formatting
run: yarn check:format

- name: Check types
run: yarn check:types

- name: Lint
run: yarn lint

- name: Test
run: yarn test:ci

Expand Down
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Node & Yarn
node_modules
*.log*

/dist
/coverage

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"eslint.options": { "overrideConfigFile": ".config/.eslintrc" },
"prettier.configPath": ".config/.prettierrc"
}
12 changes: 0 additions & 12 deletions .wes-defaults/local/.eslintrc

This file was deleted.

20 changes: 0 additions & 20 deletions .wes-defaults/local/package.json

This file was deleted.

71 changes: 71 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"name": "calendar-base",
"description": "Base methods for generating calendars using JavaScript.",
"version": "2.0.1",
"author": "Wes Souza <[email protected]> (https://wes.dev/)",
"license": "MIT",
"keywords": [
"calendar",
"generation",
"base",
"core"
],
"repository": {
"type": "git",
"url": "https://github.com/WesSouza/calendar-base"
},
"files": [
"dist"
],
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
"scripts": {
"build": "rollup -c .config/rollup.config.js",
"check:format": "prettier --config .config/.prettierrc --check ./src ./test",
"check:types": "tsc -p .config/tsconfig.json --noEmit",
"coverage": "vitest run -c .config/vite.config.ts --coverage",
"format": "prettier --config .config/.prettierrc --write ./src ./test",
"lint": "eslint -c .config/.eslintrc .",
"prepare": "yarn run build",
"test:ci": "vitest run -c .config/vite.config.ts --coverage",
"test:ui": "vitest watch -c .config/vite.config.ts --ui",
"test:watch": "vitest watch -c .config/vite.config.ts",
"test": "vitest run -c .config/vite.config.ts"
},
"devDependencies": {
"@rollup/plugin-typescript": "^11.1.5",
"@types/node": "^18.19.3",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@vitest/coverage-c8": "^0.28.5",
"@vitest/ui": "^0.28.5",
"esbuild": "^0.17.19",
"eslint": "^8.56.0",
"import-sort-style-wes": "^3.0.2",
"prettier": "2.8.4",
"prettier-plugin-import-sort": "^0.0.7",
"rollup": "^3.29.4",
"rollup-plugin-esbuild": "^5.0.0",
"rollup-plugin-replace": "^2.2.0",
"ts-node-dev": "^2.0.0",
"typescript": "^4.9.5",
"vite": "^4.5.1",
"vitest": "^0.28.5"
},
"importSort": {
".js, .jsx": {
"parser": "babylon",
"style": "wes"
},
".ts, .tsx": {
"parser": "typescript",
"style": "wes"
}
}
}
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ".config/tsconfig.json"
}
16 changes: 0 additions & 16 deletions wes-config.json

This file was deleted.

Loading

0 comments on commit 52cf546

Please sign in to comment.