create-juisy 2.0.0-beta.9 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -0
- package/index.js +45 -17
- package/package.json +57 -59
- package/template/.env.example +1 -1
- package/template/COMMIT_CONVENTION.md +116 -0
- package/template/CONTRIBUTING.md +61 -0
- package/template/bin/cli/cli.js +11 -14
- package/template/bin/cli/cmds/index.js +4 -6
- package/template/bin/cli/cmds/private/docs/{generate-api.js → GenerateAPI.js} +43 -22
- package/template/bin/cli/cmds/private/docs/index.js +30 -11
- package/template/bin/cli/cmds/private/test.js +40 -25
- package/template/bin/cli/index.js +4 -2
- package/template/bin/scripts/commit-msg.js +13 -18
- package/template/bin/scripts/pre-commit.js +13 -11
- package/template/dev.config.js +37 -5
- package/template/dev.config.json +19 -1
- package/template/dev.config.ts +40 -1
- package/template/docs/.markdownlint-cli2.mjs +21 -0
- package/template/docs/cli/private/config.js +37 -0
- package/template/docs/cli/private/data.js +14 -0
- package/template/docs/cli/private/partials/child-command.md +26 -0
- package/template/docs/cli/private/template.md +26 -0
- package/template/docs/cli/public/config.js +21 -0
- package/template/docs/cli/public/template.md +19 -0
- package/template/docs/readme/config.js +24 -13
- package/template/docs/readme/data.js +45 -0
- package/template/docs/readme/template.md +37 -9
- package/template/eslint.config.js +47 -0
- package/template/package.json +9 -6
- package/template/project.globals.js +20 -29
- package/template/tests/unit/example.spec.ts +13 -0
- package/template/tests/unit/setup.unit.ts +14 -0
- package/template/tests/vitest.d.ts +16 -0
- package/template/tsconfig.json +18 -0
- package/template/vite.config.ts +22 -0
- package/template/bin/cli/cmds/private/changelog.js +0 -44
- package/template/bin/cli/cmds/private/docs/generate-cli.js +0 -11
- package/template/bin/cli/cmds/private/docs/generate-readme.js +0 -11
- package/template/bin/cli/cmds/private/docs/lint.js +0 -42
- package/template/bin/cli/cmds/private/git-hooks/index.js +0 -20
- package/template/bin/cli/cmds/private/git-hooks/reset.js +0 -48
- package/template/bin/cli/cmds/private/git-hooks/sync.js +0 -19
- package/template/bin/cli/cmds/private/release.js +0 -223
- package/template/bin/cli/lib/docs/generate-api-doc.js +0 -33
- package/template/bin/cli/lib/release/generate-release-note.js +0 -3
- package/template/bin/cli/lib/version/update-version.js +0 -51
- package/template/docs/readme/readme.js +0 -70
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
const fs = require('fs')
|
|
2
|
-
const path = require('path')
|
|
3
|
-
const juisy = require('@hperchec/juisy')
|
|
4
|
-
|
|
5
|
-
const {
|
|
6
|
-
rootDir,
|
|
7
|
-
$style,
|
|
8
|
-
error,
|
|
9
|
-
step,
|
|
10
|
-
substep,
|
|
11
|
-
run,
|
|
12
|
-
wait
|
|
13
|
-
} = juisy.utils
|
|
14
|
-
|
|
15
|
-
// File paths
|
|
16
|
-
const filePaths = {
|
|
17
|
-
packageJson: path.resolve(rootDir, './package.json')
|
|
18
|
-
}
|
|
19
|
-
// Get package.json content
|
|
20
|
-
const packageJson = require(filePaths.packageJson)
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Update version in necessary files
|
|
24
|
-
* @param {string} version - The version
|
|
25
|
-
* @return {void}
|
|
26
|
-
*/
|
|
27
|
-
module.exports = async function updateVersion (version) {
|
|
28
|
-
// Update version for each file
|
|
29
|
-
packageJson.version = version
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Update files
|
|
33
|
-
*/
|
|
34
|
-
step('Updating version in necessary files')
|
|
35
|
-
// Update package.json
|
|
36
|
-
try {
|
|
37
|
-
fs.writeFileSync(filePaths.packageJson, JSON.stringify(packageJson, null, 4), 'utf8')
|
|
38
|
-
} catch (e) {
|
|
39
|
-
error('Unable to update package.json file', e)
|
|
40
|
-
}
|
|
41
|
-
substep($style.green('✔ package.json successfuly updated'))
|
|
42
|
-
// Updating package-lock
|
|
43
|
-
await wait('Updating package-lock.json', async () => {
|
|
44
|
-
try {
|
|
45
|
-
await run('npm', [ 'install', '--prefer-offline' ], { stdio: 'pipe' })
|
|
46
|
-
} catch (e) {
|
|
47
|
-
error('Unable to update package-lock.json file', e)
|
|
48
|
-
}
|
|
49
|
-
})
|
|
50
|
-
substep($style.green('✔ package-lock.json successfuly updated'), { last: true })
|
|
51
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @hperchec/readme-generator Template EJS data example file
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
const markdownTable = require('markdown-table') // ! v3 not compatible, use v2
|
|
6
|
-
|
|
7
|
-
// Based on the package.json file, get some data and informations
|
|
8
|
-
const pkg = require('../../package.json')
|
|
9
|
-
const packageName = pkg.name
|
|
10
|
-
const packageUrl = `https://www.npmjs.com/package/${packageName}`
|
|
11
|
-
const dependencies = pkg.dependencies || {}
|
|
12
|
-
const devDependencies = pkg.devDependencies || {}
|
|
13
|
-
const peerDependencies = pkg.peerDependencies || {}
|
|
14
|
-
const author = pkg.author
|
|
15
|
-
const contributors = pkg.contributors || []
|
|
16
|
-
const license = pkg.license || 'Unknown'
|
|
17
|
-
const homepage = pkg.homepage
|
|
18
|
-
const projectUrl = pkg.repository.url
|
|
19
|
-
const issuesUrl = pkg.bugs.url
|
|
20
|
-
|
|
21
|
-
// Output a markdown formatted table from a js object
|
|
22
|
-
// Like:
|
|
23
|
-
// |name|version|
|
|
24
|
-
// |----|-------|
|
|
25
|
-
// | | |
|
|
26
|
-
function getMdDependencies (deps) {
|
|
27
|
-
return markdownTable([
|
|
28
|
-
[ 'name', 'version' ],
|
|
29
|
-
...(Object.entries(deps))
|
|
30
|
-
])
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Return author link
|
|
35
|
-
* @param {Object} author
|
|
36
|
-
* @return {string}
|
|
37
|
-
*/
|
|
38
|
-
function getMdAuthor (author) {
|
|
39
|
-
return '[' + author.name + '](' + author.url + ')'
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Return markdown list of persons
|
|
44
|
-
* @param {Array} contributors
|
|
45
|
-
* @return {String}
|
|
46
|
-
*/
|
|
47
|
-
function getMdContributors (contributors) {
|
|
48
|
-
let mdString = ''
|
|
49
|
-
contributors.forEach((person) => {
|
|
50
|
-
mdString += '- [' + person.name + '](' + person.url + ')\n'
|
|
51
|
-
})
|
|
52
|
-
return mdString
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Export data for readme file templating
|
|
57
|
-
*/
|
|
58
|
-
module.exports = {
|
|
59
|
-
packageName,
|
|
60
|
-
packageUrl,
|
|
61
|
-
projectUrl,
|
|
62
|
-
homepage,
|
|
63
|
-
issuesUrl,
|
|
64
|
-
dependencies: getMdDependencies(dependencies),
|
|
65
|
-
devDependencies: getMdDependencies(devDependencies),
|
|
66
|
-
peerDependencies: getMdDependencies(peerDependencies),
|
|
67
|
-
author: getMdAuthor(author),
|
|
68
|
-
contributors: getMdContributors(contributors),
|
|
69
|
-
license
|
|
70
|
-
}
|