Skip to content

Commit

Permalink
💚 ci(all): update release
Browse files Browse the repository at this point in the history
  • Loading branch information
angelespejo committed Jul 30, 2024
1 parent 4086ca2 commit cfe4d1c
Show file tree
Hide file tree
Showing 14 changed files with 8,147 additions and 4,782 deletions.
93 changes: 93 additions & 0 deletions .dev/cz-config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/**
* Cz-customizable config..
*
* @description Cz-customizable config.
* @see https://github.com/leoforfree/cz-customizable
*/

module.exports = {
types : [
{
value : ':sparkles: feat',
name : '✨ feat:\tAdding a new feature',
},
{
value : ':bug: fix',
name : '🐛 fix:\tFixing a bug',
},
{
value : ':memo: docs',
name : '📝 docs:\tAdd or update documentation',
},
{
value : ':lipstick: style',
name : '💄 style:\tAdd or update styles, ui or ux',
},
{
value : ':recycle: refactor',
name : '♻️ refactor:\tCode change that neither fixes a bug nor adds a feature',
},
{
value : ':zap: perf',
name : '⚡️ perf:\tCode change that improves performance',
},
{
value : ':white_check_mark: test',
name : '✅ test:\tAdding tests cases',
},
{
value : ':truck: chore',
name : '🚚 chore:\tChanges to the build process or auxiliary tools\n\t\tand libraries such as documentation generation',
},
{
value : ':rewind: revert',
name : '⏪️ revert:\tRevert to a commit',
},
{
value : ':construction: wip',
name : '🚧 wip:\tWork in progress',
},
{
value : ':construction_worker: build',
name : '👷 build:\tAdd or update regards to build process',
},
{
value : ':green_heart: ci',
name : '💚 ci:\tAdd or update regards to build process',
},
],

scopes : [
{
name : 'lib',
},
{
name : 'all',
},
],

scopeOverrides : {
fix : [
{
name : 'merge',
},
{
name : 'style',
},
{
name : 'test',
},
{
name : 'hotfix',
},
],
},

allowCustomScopes : true,
allowBreakingChanges : [
'feat', 'fix',
],
// skip any questions you want
// skipQuestions: ['body'],
subjectLimit : 100,
}
59 changes: 59 additions & 0 deletions .dev/gh-update.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/**
* Change GH Data.
*
* @description Change GH Data.
*/
const { exec } = require( 'child_process' )
const { promisify } = require( 'util' )
const { join } = require( 'path' )
const fs = require( 'fs' )
const execPromise = promisify( exec )

const tempFilePath = join( __dirname, 'topics.json' );

( async () => {

try {

const pkg = await require( '../package.json' )
pkg.keywords = Array.isArray( pkg.keywords ) ? pkg.keywords.slice( 0, 19 ) : []

const repoOwner = 'pigeonposse'
const topicData = {
names : pkg.keywords,
}
fs.writeFileSync( tempFilePath, JSON.stringify( topicData ) )

const cmds = [
`gh repo edit ${pkg.repository.url} -d "${pkg.description}" -h "${pkg.homepage}"`,
`gh api -X PUT /repos/${repoOwner}/${pkg.name}/topics --input '${tempFilePath}'`,
]

for ( const cmd of cmds ) {

try {

const { stdout, stderr } = await execPromise( cmd )
if ( stderr ) throw Error( stderr )
console.log( `✅ Successfully exec "${cmd}".\n\tstdout: ${stdout || 'Nothing'}` )

} catch ( error ) {

throw Error( `CMD "${cmd}":` + error.message )

}

}

} catch ( error ) {

console.error( 'Error in gh update.', error )
process.exit()

}finally{

fs.unlinkSync( tempFilePath )

}

} )()
9 changes: 9 additions & 0 deletions .dev/husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
###############################################################################
# COMMIT MESSAGE
#
# @description runs after creating the COMMIT message
# @see https://typicode.github.io/husky/
# @see https://git-scm.com/docs/git-commit#_hooks
###############################################################################

pnpm commitlint --edit $1
13 changes: 13 additions & 0 deletions .dev/husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
###############################################################################
# PRE COMMIT
#
# @description runs before creating the COMMIT message
# @see https://typicode.github.io/husky/
# @see https://git-scm.com/docs/git-commit#_hooks
# @see https://www.npmjs.com/package/lint-staged
###############################################################################

# Run linters against staged git files and don't let 💩 slip into your code base!
pnpm exec lint-staged

# exec < /dev/tty && node_modules/.bin/cz --hook || true
23 changes: 23 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# #############################################################################
# EditorConfig config.
# #############################################################################
#
# @description Used to maintain consistent code formatting across different code editors and IDEs in a software project.
# @see https://EditorConfig.org
#
# #############################################################################

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
indent_style = tab
indent_size = 4

# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,cjs,mjs,ts,html,svelte}]
charset = utf-8
Loading

0 comments on commit cfe4d1c

Please sign in to comment.