Skip to content

Commit

Permalink
✨ feat(all): add feats
Browse files Browse the repository at this point in the history
  • Loading branch information
Ángel Albiñana Espejo authored and Ángel Albiñana Espejo committed Aug 25, 2024
1 parent 3a5d806 commit 471b85c
Show file tree
Hide file tree
Showing 362 changed files with 19,898 additions and 11,403 deletions.
38 changes: 8 additions & 30 deletions .dev/cz-config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* @description Cz-customizable config.
* @see https://github.com/leoforfree/cz-customizable
*/
const { extra } = require( '../package.json' )

module.exports = {
types : [
Expand Down Expand Up @@ -57,44 +58,21 @@ module.exports = {
},
],

scopes : [
{
name : 'config',
},
{
name : 'lib',
},
{
name : 'docs',
},
{
name : 'all',
},
],
scopes : extra.scopes,

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

allowCustomScopes : true,
allowBreakingChanges : [
'feat', 'fix',
],
allowBreakingChanges : [ 'feat', 'fix' ],
// skip any questions you want
// skipQuestions: ['body'],
subjectLimit : 100,
subjectLimit : 100,
}

7 changes: 7 additions & 0 deletions .dev/docs/main.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { nav } from './nav.mjs'
import { sidebar } from './sidebar.mjs'

export {
nav,
sidebar,
}
25 changes: 25 additions & 0 deletions .dev/docs/nav.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { joinPath } from '@clippo/config/core'

import {
extra,
funding,
} from '../../package.json'

export const nav = [
{
text : 'Home',
link : '/',
},
{
text : 'Guide',
link : joinPath( extra.docsPath.guide, 'index.md' ),
},
{
text : 'Articles',
link : joinPath( extra.docsPath.posts ),
},
{
text : 'Donate',
link : funding.url,
},
]
78 changes: 78 additions & 0 deletions .dev/docs/sidebar.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import {
joinPath,
joinUrl,
} from '@clippo/config/core'

import {
extra,
bugs,
repository,
} from '../../package.json'
import { getSidebarUtils } from '../typedoc/get-sidebar.mjs'

const sidebarConstructor = [
{
text : 'Introduction',
items : [ {
text : 'What is CLIPPO?',
link : joinPath( extra.docsPath.guide, '/' ),
} ],
},
{
text : 'Reference',
items : [
{
text : '📚 Library',
collapsed : true,
items : [ {
text : '🏁 Get started',
link : joinPath( extra.docsPath.lib, 'index.md' ),
} ],

},
{
text : '🛠️ Utils',
collapsed : true,
items : await getSidebarUtils(),

},
{
text : '🎉 Create (setup)',
link : joinPath( extra.docsPath.create, 'index.md' ),
},
{
text : '🖼️ Themes',
link : joinPath( extra.docsPath.themes, 'index.md' ),
},
],
},
{
text : 'Contribute',
items : [ {
text : 'Report issues',
link : bugs.url,
}, {
text : 'Todo',
link : joinPath( extra.docsPath.todo, '/v1' ),
} ],
},
{
text : 'Articles, tutorials etc',
link : joinPath( extra.docsPath.posts ),
},
{
text : 'About',
items : [ {
text : 'License',
link : joinUrl( repository.url, 'blob/main/LICENSE' ),
}, {
text : 'More projects',
link : extra.collective.web,
} ],
},
]

export const sidebar = {
'/guide/' : sidebarConstructor,
'/todo/' : sidebarConstructor,
}
4 changes: 0 additions & 4 deletions .dev/husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#!/usr/bin/env sh

. "$(dirname -- "$0")/_/husky.sh"

###############################################################################
# COMMIT MESSAGE
#
Expand Down
9 changes: 1 addition & 8 deletions .dev/husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#!/usr/bin/env sh

. "$(dirname -- "$0")/_/husky.sh"

###############################################################################
# PRE COMMIT
#
Expand All @@ -11,7 +7,4 @@
# @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
# pnpm exec lint-staged
82 changes: 82 additions & 0 deletions .dev/push.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/**
* TODO prompt.
*
* @description Add prompt for edit project TODO List.
*/

import {
exec,
execProcess,
joinUrl,
paths,
prompt,
readJSON,
initCache,
} from '@clippo/config/core'

await execProcess( {
name : 'PUSH REPO',
on : async ( { log } ) => {

const data = {
update : 'update',
add : 'add',
origin : 'origin',
workflow : 'workflow',
}

const cache = await initCache( {
id : 'push',
values : {
[ data.update ] : false,
[ data.add ] : '.',
[ data.origin ] : 'main',
[ data.workflow ] : false,
},
} )

const getRepoUrl = async () => {

const packageJsonPath = paths.workspacePkg
const packageJson = await readJSON( packageJsonPath )
return joinUrl( packageJson.repository.url )

}
const preAnswer = await prompt( [ {
type : 'confirm',
name : data.update,
default : cache.get( data.update ),
message : 'Do yo want update version?',
} ] )

if( preAnswer.update ) await import( './update-version.mjs' )

const answers = await prompt( [ {
type : 'input',
name : data.add,
default : cache.get( data.add ),
message : 'Git add',
}, {
type : 'input',
name : data.origin,
default : cache.get( data.origin ),
message : 'Add origin branch',
} ] )

await exec( `git add ${answers.add} && pnpm cm && git push -f origin ${answers.origin}` )

log.success( `Successfully commit to ${await getRepoUrl()}\n` )

const answersAfter = await prompt( [ {
type : 'confirm',
name : data.workflow,
default : cache.get( data.workflow ),
message : 'Run workflow',
} ] )

cache.set( answers )
if( answersAfter.workflow ) await import( './workflow.mjs' )

},
} )

59 changes: 28 additions & 31 deletions .dev/readme.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,41 @@
* @description Readme.
*/

import { readme } from './templates/readme.mjs'
import {
pkg, addTextBetweenAMark,
} from './core/main.mjs'
pkg,
addTextBetweenAMark,
execProcess,
} from '@clippo/config/core'

const dynamicReadme = async () => {
import { readme } from './templates/readme.mjs'

try{
await execProcess( {
name : 'CHANGE README',
on : async ( ) => {

const readmeTemp = readme( pkg )
const convertReadme = async filePath => {
// const readmeTemp = readme( pkg.data )
// const convertReadme = async filePath => {

await addTextBetweenAMark( filePath, '<!-- PIGEONPOSSE START MARK -->', '<!-- PIGEONPOSSE END MARK -->', readmeTemp.mark )
await addTextBetweenAMark( filePath, '<!-- PIGEONPOSSE START CONTENT -->', '<!-- PIGEONPOSSE END CONTENT -->', readmeTemp.content )
await addTextBetweenAMark( filePath, '<!-- PIGEONPOSSE START INDEX -->', '<!-- PIGEONPOSSE END INDEX -->', readmeTemp.index )
await addTextBetweenAMark( filePath, '<!-- PIGEONPOSSE START ORG -->', '<!-- PIGEONPOSSE END ORG -->', readmeTemp.org )
await addTextBetweenAMark( filePath, '<!-- PIGEONPOSSE START HEADER -->', '<!-- PIGEONPOSSE END HEADER -->', readmeTemp.header )
// await addTextBetweenAMark( filePath, '<!-- PIGEONPOSSE START MARK -->', '<!-- PIGEONPOSSE END MARK -->', readmeTemp.mark )
// await addTextBetweenAMark( filePath, '<!-- PIGEONPOSSE START CONTENT -->', '<!-- PIGEONPOSSE END CONTENT -->', readmeTemp.content )
// await addTextBetweenAMark( filePath, '<!-- PIGEONPOSSE START INDEX -->', '<!-- PIGEONPOSSE END INDEX -->', readmeTemp.index )
// await addTextBetweenAMark( filePath, '<!-- PIGEONPOSSE START ORG -->', '<!-- PIGEONPOSSE END ORG -->', readmeTemp.org )
// await addTextBetweenAMark( filePath, '<!-- PIGEONPOSSE START HEADER -->', '<!-- PIGEONPOSSE END HEADER -->', readmeTemp.header )

}
await convertReadme( 'README.md' )
await convertReadme( 'packages/_config/README.md' )
await convertReadme( 'packages/lib/README.md' )
await convertReadme( 'packages/docs/README.md' )

}catch( e ){

throw '📝 ' + e
// }

}
// const readmePaths = [
// 'README.md',
// 'packages/_config/README.md',
// 'packages/lib/README.md',
// 'packages/docs/README.md',
// ]

}
// for ( const path of readmePaths ) {

try {
// await convertReadme( path )

// }

dynamicReadme()

}catch( e ){

console.log( '❌ ' + e )

}
},
} )
5 changes: 5 additions & 0 deletions .dev/templates/info.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { joinUrl } from '@clippo/config/core'

export const info = pkg => `- [Documentation](${pkg.homepage})
- [Installation](${joinUrl( pkg.homepage, 'guide/getting-started#installation' )})`

Loading

0 comments on commit 471b85c

Please sign in to comment.