Skip to content

Commit 6444ec4

Browse files
authored
Merge pull request #1 from noxify/refactor
refactor
2 parents 49b4511 + 0df1950 commit 6444ec4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+4481
-919
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"privatePackages": false,
11+
"ignore": []
12+
}

.changeset/major-experts-glow.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@noxify/gitlab-ci-builder": patch
3+
---
4+
5+
Refactor the whole package
6+
7+
- renamed `gitlab-yml` to `gitlab-ci-builder`
8+
- Re-implements some missing methods
9+
- Added tests
10+
- Introduces an export function ( beta )
11+
- Introduces an import function ( beta )

.github/copilot-instructions.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# GitHub Copilot Instructions
2+
3+
## Development Philosophy
4+
5+
- **Quality over quantity**: Write clean, maintainable, and well-structured code
6+
- **Senior-level TypeScript**: Leverage advanced TypeScript features for type safety
7+
- **Minimal and focused**: Every line of code should serve a clear purpose
8+
- **Performance-conscious**: Consider efficiency and avoid unnecessary complexity
9+
10+
## TypeScript & ESLint Rules
11+
12+
- **No console.log**: Use proper logging or remove debug statements
13+
- **Consistent type imports**: Use `import type` for type-only imports
14+
- **No unused vars**: Prefix with `_` if intentionally unused
15+
- **No unnecessary conditions**: Avoid redundant null checks
16+
- **No non-null assertions**: Use proper type guards instead of `!`
17+
- **Prefer top-level type imports**: Keep type imports at the top
18+
- **Array type syntax**: Use `readonly T[]` instead of `ReadonlyArray<T>`
19+
- **Prefer nullish coalescing**: Use `??` instead of `||` for safer null/undefined checks
20+
- **Prefer optional chaining**: Use `?.` for more concise and readable property access
21+
- **No import extensions**: Never use `.js`, `.ts` extensions in imports
22+
- **No useless path segments**: Avoid `/index` in import paths when possible
23+
- **Prefer directory imports**: Use `../src` instead of `../src/index` for cleaner imports
24+
25+
## Prettier Configuration
26+
27+
- **Print width**: 100 characters max
28+
- **No semicolons**: Use semicolon-free style
29+
- **Import order**: Follow the specified import grouping:
30+
1. Types first
31+
2. React/Next.js/Expo (if applicable)
32+
3. Third-party modules
33+
4. @vorsteh-queue packages
34+
5. Relative imports (~/,../, ./)
35+
36+
## Code Generation Guidelines
37+
38+
- Remove all `console.log` statements from generated code
39+
- Use proper TypeScript types instead of `any` when possible
40+
- **Use type-fest when available** - Prefer battle-tested utility types from type-fest over custom implementations
41+
- Add ESLint disable comments only when absolutely necessary
42+
- Follow the import order specified in prettier config
43+
- Use consistent naming conventions (camelCase for variables, PascalCase for types)
44+
- **Generic type parameters**: Always prefix with `T` (e.g., `TJobPayload`, `TResult`, `TEventData`)
45+
- Prefer explicit return types for functions
46+
- Use proper error handling instead of throwing generic errors
47+
- Write self-documenting code that doesn't need excessive comments
48+
- Prefer functional programming patterns where appropriate
49+
- Use advanced TypeScript features (generics, utility types, conditional types)
50+
- Optimize for readability and maintainability
51+
52+
## File Structure
53+
54+
- Keep imports organized according to prettier rules
55+
- Use meaningful variable and function names
56+
- Add proper JSDoc comments for public APIs
57+
- Prefer composition over inheritance
58+
- Use readonly arrays and objects where appropriate

.github/setup/action.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: "Setup and install"
2+
description: "Common setup steps for Actions"
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- uses: pnpm/action-setup@v4
8+
- uses: actions/setup-node@v4
9+
with:
10+
node-version-file: ".nvmrc"
11+
cache: "pnpm"
12+
13+
- shell: bash
14+
run: pnpm install

.github/workflows/ci.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: ["*"]
6+
push:
7+
branches: ["main", "changesets/release"]
8+
merge_group:
9+
workflow_dispatch:
10+
inputs:
11+
pr_number:
12+
description: "PR number to run CI for"
13+
required: false
14+
type: string
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
19+
20+
permissions:
21+
contents: read
22+
pull-requests: read
23+
checks: write
24+
statuses: write
25+
26+
# You can leverage Vercel Remote Caching with Turbo to speed up your builds
27+
# @link https://turborepo.org/docs/core-concepts/remote-caching#remote-caching-on-vercel-builds
28+
env:
29+
FORCE_COLOR: 3
30+
31+
jobs:
32+
lint:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
37+
- name: Setup
38+
uses: ./.github/setup
39+
40+
- name: Lint
41+
run: pnpm lint
42+
43+
format:
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
48+
- name: Setup
49+
uses: ./.github/setup
50+
51+
- name: Format
52+
run: pnpm format
53+
54+
typecheck:
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v4
58+
59+
- name: Setup
60+
uses: ./.github/setup
61+
62+
- name: Typecheck
63+
run: pnpm typecheck
64+
65+
test:
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@v4
69+
70+
- name: Setup
71+
uses: ./.github/setup
72+
73+
- name: Typecheck
74+
run: pnpm test
75+
76+
pkg-new-release:
77+
needs: [lint, format, typecheck]
78+
if: github.event_name == 'pull_request'
79+
runs-on: ubuntu-latest
80+
steps:
81+
- uses: actions/checkout@v4
82+
83+
- name: Setup
84+
uses: ./.github/setup
85+
86+
- name: Build
87+
run: pnpm build
88+
89+
- run: pnpx pkg-pr-new publish ./*

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# https://github.com/changesets/action/issues/70
2+
name: Release
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
concurrency: ${{ github.workflow }}-${{ github.ref }}
10+
11+
jobs:
12+
release:
13+
name: Release
14+
runs-on: ubuntu-latest
15+
permissions:
16+
pull-requests: write
17+
contents: write
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
persist-credentials: false
22+
23+
- name: Setup
24+
uses: ./.github/setup
25+
26+
- name: Create Release Pull Request or Publish to npm
27+
id: changesets
28+
uses: changesets/action@v1
29+
with:
30+
version: pnpm ci:version
31+
publish: pnpm ci:publish
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.CHANGESETS_TOKEN }}
34+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 26 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,37 @@
1-
package-lock.json
2-
.gitlab-ci.ts.yml
3-
lib/
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
42

5-
# Logs
6-
logs
7-
*.log
8-
npm-debug.log*
9-
yarn-debug.log*
10-
yarn-error.log*
11-
12-
# Runtime data
13-
pids
14-
*.pid
15-
*.seed
16-
*.pid.lock
17-
18-
# Directory for instrumented libs generated by jscoverage/JSCover
19-
lib-cov
3+
# dependencies
4+
node_modules
5+
.pnp
6+
.pnp.js
207

21-
# Coverage directory used by tools like istanbul
8+
# testing
229
coverage
2310

24-
# nyc test coverage
25-
.nyc_output
26-
27-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
28-
.grunt
29-
30-
# Bower dependency directory (https://bower.io/)
31-
bower_components
32-
33-
# node-waf configuration
34-
.lock-wscript
35-
36-
# Compiled binary addons (https://nodejs.org/api/addons.html)
37-
build/Release
11+
# production
12+
dist
3813

39-
# Dependency directories
40-
node_modules/
41-
jspm_packages/
14+
# misc
15+
.DS_Store
16+
*.pem
4217

43-
# TypeScript v1 declaration files
44-
typings/
45-
46-
# Optional npm cache directory
47-
.npm
48-
49-
# Optional eslint cache
50-
.eslintcache
51-
52-
# Optional REPL history
53-
.node_repl_history
54-
55-
# Output of 'npm pack'
56-
*.tgz
57-
58-
# Yarn Integrity file
59-
.yarn-integrity
18+
# debug
19+
npm-debug.log*
20+
yarn-debug.log*
21+
yarn-error.log*
22+
.pnpm-debug.log*
6023

61-
# dotenv environment variables file
24+
# local env files
6225
.env
26+
.env*.local
27+
.env.bizhubo
6328

64-
# next.js build output
65-
.next
29+
# vercel
30+
.vercel
6631

67-
.idea
32+
# typescript
33+
dist/
34+
.cache
6835

69-
.cache
36+
# turbo
37+
.turbo

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
lib/
1+
dist/
2+
pnpm-lock.yaml

0 commit comments

Comments
 (0)