Skip to content

Commit

Permalink
chore: init
Browse files Browse the repository at this point in the history
  • Loading branch information
pipinet committed Sep 19, 2024
1 parent 70d1d79 commit f3f0a0f
Show file tree
Hide file tree
Showing 24 changed files with 622 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

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
quote_type = single
30 changes: 30 additions & 0 deletions .github/workflows/commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Commit check

on:
push:
branches:
- master

env:
COMMIT_OWNER: ${{ github.event.pusher.name }}
COMMIT_SHA: ${{ github.sha }}
PIPELINE_ID: ${{ github.run_number }}
APP_BRANCH_NAME: ${{ github.ref_name }}
DOCKER_REGISTRY: registry.cn-hangzhou.aliyuncs.com
FORCE_COLOR: 1

jobs:
commit:
name: commit
runs-on: [linux-64]
steps:
- uses: actions/checkout@v4
- name: Check
run: |
earthly --ci --allow-privileged +ci-check \
--PIPELINE_ID=${{ env.PIPELINE_ID }}
- name: Release
run: |
earthly --ci --allow-privileged --push +ci-release \
--PIPELINE_ID=${{ env.PIPELINE_ID }} \
--NPM_ACCESS_TOKEN=${{ secrets.NPM_ACCESS_TOKEN }}
175 changes: 175 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore

# Logs

logs
_.log
npm-debug.log_
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Caches

.cache

# Diagnostic reports (https://nodejs.org/api/report.html)

report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# Runtime data

pids
_.pid
_.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover

lib-cov

# Coverage directory used by tools like istanbul

coverage
*.lcov

# nyc test coverage

.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)

.grunt

# Bower dependency directory (https://bower.io/)

bower_components

# node-waf configuration

.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)

build/Release

# Dependency directories

node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)

web_modules/

# TypeScript cache

*.tsbuildinfo

# Optional npm cache directory

.npm

# Optional eslint cache

.eslintcache

# Optional stylelint cache

.stylelintcache

# Microbundle cache

.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history

.node_repl_history

# Output of 'npm pack'

*.tgz

# Yarn Integrity file

.yarn-integrity

# dotenv environment variable files

.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)

.parcel-cache

# Next.js build output

.next
out

# Nuxt.js build / generate output

.nuxt
dist

# Gatsby files

# Comment in the public line in if your project uses Gatsby and not Next.js

# https://nextjs.org/blog/next-9-1#public-directory-support

# public

# vuepress build output

.vuepress/dist

# vuepress v2.x temp and cache directory

.temp

# Docusaurus cache and generated files

.docusaurus

# Serverless directories

.serverless/

# FuseBox cache

.fusebox/

# DynamoDB Local files

.dynamodb/

# TernJS port file

.tern-port

# Stores VSCode versions used for testing VSCode extensions

.vscode-test

# yarn v2

.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# IntelliJ based IDEs
.idea

# Finder (MacOS) folder config
.DS_Store
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
shamefully-hoist=true
registry=https://registry.npmmirror.com
auto-install-peers=true
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.17.0
13 changes: 13 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Ignore artifacts:
build
coverage
dist
public
styles
node_modules
.vscode
dist
.nuxt
.output
.yaml
.github/*
12 changes: 12 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"printWidth": 250,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "always",
"vueIndentScriptAndStyle": false
}
42 changes: 42 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
VERSION 0.8
ARG --global BASE_IMAGE=earthly/dind:alpine
ARG --global NODE_IMAGE=node:20.17.0

FROM ${BASE_IMAGE}
WORKDIR /app
COPY .version .
ARG --global PIPELINE_ID
ARG --global APP_BASE_VERSION=$(cat .version | head -1)
ARG --global APP_VERSION=${APP_BASE_VERSION}.${PIPELINE_ID}
ARG --global NPM_ACCESS_TOKEN

build-base:
FROM ${NODE_IMAGE}
WORKDIR /app
COPY bun.lockb \
package.json \
.npmrc \
.
RUN npm install -g bun --registry=https://registry.npmmirror.com
RUN bun install --frozen-lockfile
SAVE ARTIFACT node_modules AS LOCAL node_modules

check:
FROM +build-base
COPY . .
RUN bun run build:check

release:
FROM +build-base
COPY . .
RUN npm config set //registry.npmjs.org/:_authToken=${NPM_ACCESS_TOKEN}
RUN npm version ${APP_VERSION} --no-commit-hooks --no-git-tag-version --allow-same-version
RUN bun run build
RUN bun run release

ci-check:
BUILD +check

ci-release:
BUILD +release

File renamed without changes.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# mesh

To install dependencies:

```bash
bun install
```

To run:

```bash
bun run index.ts
```

This project was created using `bun init` in bun v1.1.27. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
Binary file added bun.lockb
Binary file not shown.
68 changes: 68 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import antfu from '@antfu/eslint-config';

export default antfu(
{
stylistic: {
indent: 2, // 4, or 'tab'
quotes: 'single', // or 'double'
},
lessOpinionated: true,
typescript: true,
javascript: false,
vue: {
overrides: {
'vue/component-tags-order': ['error', { order: ['template', 'script', 'style'] }],
'vue/block-order': ['error', { order: ['template', 'script', 'style'] }],
'vue/component-name-in-template-casing': [
'error',
'kebab-case',
{
registeredComponentsOnly: true,
ignores: [],
},
],
'vue/no-unused-refs': 'off',
'vue/no-template-shadow': 'off',
'vue/valid-define-emits': 'off',
'vue/attribute-hyphenation': 'error',
'vue/html-closing-bracket-spacing': 'off',
'vue/require-explicit-emits': ['error', { allowProps: true }],
'vue/define-emits-declaration': ['error', 'type-based'],
'vue/custom-event-name-casing': ['error', 'camelCase'],
'vue/prop-name-casing': ['error', 'camelCase'],
'vue/singleline-html-element-content-newline': 'off',
},
},
// unocss: true,
jsonc: false,
yaml: false,
jsx: false,
},
{
rules: {
'no-console': 'off',
'import/no-absolute-path': ['error'],
'import/no-relative-packages': ['error'],
'import/no-self-import': ['error'],
'style/brace-style': ['error', '1tbs'],
'style/comma-dangle': ['error', 'only-multiline'],
'style/semi': ['error', 'always'],
'style/quote-props': ['error', 'as-needed'],
'style/arrow-parens': ['error', 'always'],
'style/nonblock-statement-body-position': ['error', 'below'],
'style/member-delimiter-style': [
'error',
{
multiline: { delimiter: 'semi', requireLast: true },
singleline: { delimiter: 'semi', requireLast: false },
},
],
'ts/ban-ts-comment': 'off',
'ts/ban-ts-ignore': 'off',
'ts/prefer-ts-expect-error': 'off',
'ts/ban-types': 'off',
'unused-imports/no-unused-vars': 'off',
'ts/no-use-before-define': 'off',
},
}
);
Loading

0 comments on commit f3f0a0f

Please sign in to comment.