@ceylar/ada 0.0.9 → 0.0.11
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/.github/workflows/publish.yml +32 -29
- package/.github/workflows/test-version-on-pr.yml +38 -38
- package/babel.config.json +9 -9
- package/bin/index.js +8784 -0
- package/bin/resources/eslint.config.mjs +8 -0
- package/{prettier.config.mjs → bin/resources/prettier.config.mjs} +12 -12
- package/bin/resources/stylelint.config.mjs +7 -0
- package/bin/resources/tsconfig.json +37 -0
- package/eslint.config.ts +14 -0
- package/package.json +45 -51
- package/readme.md +3 -3
- package/resources/eslint.config.mjs +8 -67
- package/resources/prettier.config.mjs +12 -12
- package/resources/stylelint.config.mjs +7 -7
- package/resources/tsconfig.json +37 -37
- package/rollup.config.ts +56 -55
- package/src/cli/commands/get.ts +21 -21
- package/src/cli/commands/index.ts +3 -3
- package/src/cli/commands/init.ts +107 -108
- package/src/cli/commands/set.ts +13 -13
- package/src/cli/type.ts +12 -12
- package/src/cli/util.ts +23 -23
- package/src/config/get.ts +38 -38
- package/src/config/index.ts +4 -4
- package/src/config/schema.ts +19 -19
- package/src/config/set.ts +14 -14
- package/src/config/type.ts +8 -8
- package/src/entities/manager/index.ts +2 -2
- package/src/entities/manager/schema.ts +5 -5
- package/src/entities/manager/type.ts +7 -7
- package/src/index.ts +53 -52
- package/src/util/index.ts +3 -3
- package/src/util/isEmpty.ts +11 -11
- package/src/util/logger.ts +15 -15
- package/src/util/resolveCurrentDir.ts +7 -7
- package/tsconfig.json +34 -32
- package/eslint.config.mjs +0 -63
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/** @type {import('prettier').Config} */
|
|
2
|
-
export default {
|
|
3
|
-
printWidth: 120,
|
|
4
|
-
singleQuote: true,
|
|
5
|
-
jsxSingleQuote: true,
|
|
6
|
-
trailingComma: 'none',
|
|
7
|
-
semi: true,
|
|
8
|
-
tabWidth: 2,
|
|
9
|
-
useTabs: false,
|
|
10
|
-
endOfLine: 'crlf',
|
|
11
|
-
arrowParens: 'always'
|
|
12
|
-
}
|
|
1
|
+
/** @type {import('prettier').Config} */
|
|
2
|
+
export default {
|
|
3
|
+
printWidth: 120,
|
|
4
|
+
singleQuote: true,
|
|
5
|
+
jsxSingleQuote: true,
|
|
6
|
+
trailingComma: 'none',
|
|
7
|
+
semi: true,
|
|
8
|
+
tabWidth: 2,
|
|
9
|
+
useTabs: false,
|
|
10
|
+
endOfLine: 'crlf',
|
|
11
|
+
arrowParens: 'always',
|
|
12
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "esnext",
|
|
4
|
+
"jsx": "react-jsx",
|
|
5
|
+
"lib": [
|
|
6
|
+
"dom",
|
|
7
|
+
"dom.iterable",
|
|
8
|
+
"esnext"
|
|
9
|
+
],
|
|
10
|
+
"baseUrl": ".",
|
|
11
|
+
"module": "esnext",
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"paths": {
|
|
14
|
+
"@/*": [
|
|
15
|
+
"./src/*"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"resolveJsonModule": true,
|
|
19
|
+
"allowJs": true,
|
|
20
|
+
"strict": true,
|
|
21
|
+
"noFallthroughCasesInSwitch": true,
|
|
22
|
+
"noUnusedLocals": true,
|
|
23
|
+
"noUnusedParameters": true,
|
|
24
|
+
"newLine": "lf",
|
|
25
|
+
"noEmit": true,
|
|
26
|
+
"sourceMap": true,
|
|
27
|
+
"allowSyntheticDefaultImports": true,
|
|
28
|
+
"esModuleInterop": true,
|
|
29
|
+
"forceConsistentCasingInFileNames": true,
|
|
30
|
+
"isolatedModules": true,
|
|
31
|
+
"skipLibCheck": true
|
|
32
|
+
},
|
|
33
|
+
"exclude": [
|
|
34
|
+
"dist",
|
|
35
|
+
"node_modules"
|
|
36
|
+
]
|
|
37
|
+
}
|
package/eslint.config.ts
ADDED
package/package.json
CHANGED
|
@@ -1,51 +1,45 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@ceylar/ada",
|
|
3
|
-
"
|
|
4
|
-
"version": "0.0.
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"@
|
|
26
|
-
"@
|
|
27
|
-
"@
|
|
28
|
-
"@
|
|
29
|
-
"@rollup/plugin-
|
|
30
|
-
"@
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"rollup
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"typescript
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
"commander": "^13.1.0",
|
|
47
|
-
"zod": "^3.24.2"
|
|
48
|
-
},
|
|
49
|
-
"repository": "https://github.com/Ceylar37/ada.git",
|
|
50
|
-
"author": "ceylar37 <ceylar37@gmail.com>"
|
|
51
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@ceylar/ada",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.11",
|
|
5
|
+
"description": "CLI to help you initialize projects",
|
|
6
|
+
"author": "ceylar37 <ceylar37@gmail.com>",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"repository": "https://github.com/Ceylar37/ada.git",
|
|
9
|
+
"bin": {
|
|
10
|
+
"ada": "bin/index.js"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "shx rm -rf dist && cross-env NODE_ENV=production rollup -c --bundleConfigAsCjs",
|
|
14
|
+
"dev": "shx rm -rf dist && cross-env NODE_ENV=development rollup -c --bundleConfigAsCjs --watch",
|
|
15
|
+
"lint": "eslint -c eslint.config.ts .",
|
|
16
|
+
"lint:fix": "eslint -c eslint.config.ts --fix .",
|
|
17
|
+
"format": "prettier --check src --ignore-path .gitignore",
|
|
18
|
+
"format:fix": "prettier --write src --ignore-path .gitignore"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"commander": "^13.1.0",
|
|
22
|
+
"zod": "^3.24.2"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@antfu/eslint-config": "^8.0.0",
|
|
26
|
+
"@babel/core": "^7.26.9",
|
|
27
|
+
"@babel/preset-env": "^7.26.9",
|
|
28
|
+
"@babel/preset-typescript": "^7.26.0",
|
|
29
|
+
"@rollup/plugin-alias": "^5.1.1",
|
|
30
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
31
|
+
"@rollup/plugin-commonjs": "^28.0.2",
|
|
32
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
33
|
+
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
34
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
35
|
+
"@types/node": "^25.5.0",
|
|
36
|
+
"cross-env": "^7.0.3",
|
|
37
|
+
"eslint": "^10.1.0",
|
|
38
|
+
"jiti": "^2.6.1",
|
|
39
|
+
"rollup": "^4.34.8",
|
|
40
|
+
"rollup-plugin-copy": "^3.5.0",
|
|
41
|
+
"shx": "^0.3.4",
|
|
42
|
+
"tslib": "^2.8.1",
|
|
43
|
+
"typescript": "^5.7.3"
|
|
44
|
+
}
|
|
45
|
+
}
|
package/readme.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
### ada
|
|
2
|
-
|
|
3
|
-
CLI to help you initialize your javascript projects
|
|
1
|
+
### ada
|
|
2
|
+
|
|
3
|
+
CLI to help you initialize your javascript projects
|
|
@@ -1,67 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export default ts.config(
|
|
10
|
-
js.configs.recommended,
|
|
11
|
-
...ts.configs.recommended,
|
|
12
|
-
{
|
|
13
|
-
plugins: {
|
|
14
|
-
react: react,
|
|
15
|
-
'react-hooks': reactHooks,
|
|
16
|
-
'simple-import-sort': simpleImportSort,
|
|
17
|
-
ts: ts.plugin
|
|
18
|
-
},
|
|
19
|
-
rules: {
|
|
20
|
-
'prefer-const': 'error',
|
|
21
|
-
'no-else-return': 'error',
|
|
22
|
-
|
|
23
|
-
'react-hooks/exhaustive-deps': 'off',
|
|
24
|
-
|
|
25
|
-
'no-console': 'warn',
|
|
26
|
-
|
|
27
|
-
'simple-import-sort/exports': 'error',
|
|
28
|
-
'simple-import-sort/imports': [
|
|
29
|
-
'error',
|
|
30
|
-
{
|
|
31
|
-
groups: [
|
|
32
|
-
['^react', '^@?\\w'],
|
|
33
|
-
['^@(([\\/.]?\\w)|assets|test-utils)'],
|
|
34
|
-
['^\\u0000'],
|
|
35
|
-
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
|
|
36
|
-
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
|
|
37
|
-
['^.+\\.s?css$']
|
|
38
|
-
]
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
},
|
|
42
|
-
languageOptions: {
|
|
43
|
-
globals: {
|
|
44
|
-
...globals.node,
|
|
45
|
-
...globals.browser,
|
|
46
|
-
...globals.es2022
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
languageOptions: {
|
|
52
|
-
parserOptions: {
|
|
53
|
-
project: ['tsconfig.json']
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
files: ['/src/**/*.ts', '/src/**/*.tsx']
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
languageOptions: {
|
|
60
|
-
parserOptions: react.configs.recommended.parserOptions
|
|
61
|
-
},
|
|
62
|
-
files: ['/src/**/*.js', '/src/**/*.jsx']
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
ignores: ['node_modules', 'build', 'dist']
|
|
66
|
-
}
|
|
67
|
-
);
|
|
1
|
+
import antfuConfig from '@antfu/eslint-config'
|
|
2
|
+
|
|
3
|
+
export default antfuConfig(
|
|
4
|
+
{
|
|
5
|
+
typescript: true,
|
|
6
|
+
e18e: false,
|
|
7
|
+
},
|
|
8
|
+
)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/** @type {import('prettier').Config} */
|
|
2
|
-
export default {
|
|
3
|
-
printWidth: 120,
|
|
4
|
-
singleQuote: true,
|
|
5
|
-
jsxSingleQuote: true,
|
|
6
|
-
trailingComma: 'none',
|
|
7
|
-
semi: true,
|
|
8
|
-
tabWidth: 2,
|
|
9
|
-
useTabs: false,
|
|
10
|
-
endOfLine: 'crlf',
|
|
11
|
-
arrowParens: 'always'
|
|
12
|
-
}
|
|
1
|
+
/** @type {import('prettier').Config} */
|
|
2
|
+
export default {
|
|
3
|
+
printWidth: 120,
|
|
4
|
+
singleQuote: true,
|
|
5
|
+
jsxSingleQuote: true,
|
|
6
|
+
trailingComma: 'none',
|
|
7
|
+
semi: true,
|
|
8
|
+
tabWidth: 2,
|
|
9
|
+
useTabs: false,
|
|
10
|
+
endOfLine: 'crlf',
|
|
11
|
+
arrowParens: 'always',
|
|
12
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/** @type {import('stylelint').Config} */
|
|
2
|
-
export default {
|
|
3
|
-
extends: 'stylelint-config-standard-scss',
|
|
4
|
-
rules: {
|
|
5
|
-
'selector-class-pattern': ['^[a-z][a-zA-Z0-9]*$', { message: 'Selector should be in camelCase' }]
|
|
6
|
-
}
|
|
7
|
-
}
|
|
1
|
+
/** @type {import('stylelint').Config} */
|
|
2
|
+
export default {
|
|
3
|
+
extends: 'stylelint-config-standard-scss',
|
|
4
|
+
rules: {
|
|
5
|
+
'selector-class-pattern': ['^[a-z][a-zA-Z0-9]*$', { message: 'Selector should be in camelCase' }],
|
|
6
|
+
},
|
|
7
|
+
}
|
package/resources/tsconfig.json
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "esnext",
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
"dom
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
"exclude": [
|
|
34
|
-
"dist",
|
|
35
|
-
"node_modules"
|
|
36
|
-
]
|
|
37
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "esnext",
|
|
4
|
+
"jsx": "react-jsx",
|
|
5
|
+
"lib": [
|
|
6
|
+
"dom",
|
|
7
|
+
"dom.iterable",
|
|
8
|
+
"esnext"
|
|
9
|
+
],
|
|
10
|
+
"baseUrl": ".",
|
|
11
|
+
"module": "esnext",
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"paths": {
|
|
14
|
+
"@/*": [
|
|
15
|
+
"./src/*"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"resolveJsonModule": true,
|
|
19
|
+
"allowJs": true,
|
|
20
|
+
"strict": true,
|
|
21
|
+
"noFallthroughCasesInSwitch": true,
|
|
22
|
+
"noUnusedLocals": true,
|
|
23
|
+
"noUnusedParameters": true,
|
|
24
|
+
"newLine": "lf",
|
|
25
|
+
"noEmit": true,
|
|
26
|
+
"sourceMap": true,
|
|
27
|
+
"allowSyntheticDefaultImports": true,
|
|
28
|
+
"esModuleInterop": true,
|
|
29
|
+
"forceConsistentCasingInFileNames": true,
|
|
30
|
+
"isolatedModules": true,
|
|
31
|
+
"skipLibCheck": true
|
|
32
|
+
},
|
|
33
|
+
"exclude": [
|
|
34
|
+
"dist",
|
|
35
|
+
"node_modules"
|
|
36
|
+
]
|
|
37
|
+
}
|
package/rollup.config.ts
CHANGED
|
@@ -1,55 +1,56 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
import
|
|
11
|
-
import copy from 'rollup-plugin-copy'
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
import { resolve as resolvePath } from 'node:path'
|
|
2
|
+
import process from 'node:process'
|
|
3
|
+
import alias from '@rollup/plugin-alias'
|
|
4
|
+
import babel from '@rollup/plugin-babel'
|
|
5
|
+
import commonjs from '@rollup/plugin-commonjs'
|
|
6
|
+
import json from '@rollup/plugin-json'
|
|
7
|
+
|
|
8
|
+
import resolve from '@rollup/plugin-node-resolve'
|
|
9
|
+
|
|
10
|
+
import typescript from '@rollup/plugin-typescript'
|
|
11
|
+
import copy from 'rollup-plugin-copy'
|
|
12
|
+
import packageJSON from './package.json'
|
|
13
|
+
|
|
14
|
+
const sourcemap = false
|
|
15
|
+
const input = 'src/index.ts'
|
|
16
|
+
const banner = `/* @license ${packageJSON.name} v${packageJSON.version} */`
|
|
17
|
+
|
|
18
|
+
const isDev = process.env.NODE_ENV === 'development'
|
|
19
|
+
|
|
20
|
+
/** @type {import('rollup').RollupOptions[]} */
|
|
21
|
+
export default [
|
|
22
|
+
{
|
|
23
|
+
input,
|
|
24
|
+
output: Object.values(packageJSON.bin).map(bin => ({
|
|
25
|
+
format: 'esm',
|
|
26
|
+
file: bin,
|
|
27
|
+
sourcemap,
|
|
28
|
+
banner,
|
|
29
|
+
})),
|
|
30
|
+
plugins: [
|
|
31
|
+
alias({
|
|
32
|
+
entries: [{ find: '@', replacement: resolvePath(__dirname, './src') }],
|
|
33
|
+
}),
|
|
34
|
+
resolve({
|
|
35
|
+
extensions: ['.js', '.ts'],
|
|
36
|
+
}),
|
|
37
|
+
commonjs({
|
|
38
|
+
include: /node_modules/,
|
|
39
|
+
ignoreDynamicRequires: true,
|
|
40
|
+
}),
|
|
41
|
+
typescript({
|
|
42
|
+
tsconfig: './tsconfig.json',
|
|
43
|
+
compilerOptions: { noCheck: isDev },
|
|
44
|
+
noForceEmit: true,
|
|
45
|
+
}),
|
|
46
|
+
babel({
|
|
47
|
+
exclude: /node_modules/,
|
|
48
|
+
extensions: ['.js', '.ts'],
|
|
49
|
+
}),
|
|
50
|
+
json(),
|
|
51
|
+
copy({
|
|
52
|
+
targets: [{ src: 'resources/*', dest: 'bin/resources' }],
|
|
53
|
+
}),
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
]
|
package/src/cli/commands/get.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const get: AppCommand<typeof selectConfigSchema> = {
|
|
8
|
-
name: 'get',
|
|
9
|
-
description: 'get variables from config',
|
|
10
|
-
options: [['-m, --manager', 'package manager that will be used to install dependencies']],
|
|
11
|
-
schema: selectConfigSchema,
|
|
12
|
-
action: (options) => {
|
|
13
|
-
if (isEmpty(options)) {
|
|
14
|
-
console.log(getConfig())
|
|
15
|
-
return
|
|
16
|
-
}
|
|
17
|
-
console.log(getConfig(options))
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export { get }
|
|
1
|
+
import type { AppCommand } from '../type'
|
|
2
|
+
import { get as getConfig } from '@/config'
|
|
3
|
+
import { selectConfigSchema } from '@/config/schema'
|
|
4
|
+
|
|
5
|
+
import { isEmpty } from '@/util'
|
|
6
|
+
|
|
7
|
+
const get: AppCommand<typeof selectConfigSchema> = {
|
|
8
|
+
name: 'get',
|
|
9
|
+
description: 'get variables from config',
|
|
10
|
+
options: [['-m, --manager', 'package manager that will be used to install dependencies']],
|
|
11
|
+
schema: selectConfigSchema,
|
|
12
|
+
action: (options) => {
|
|
13
|
+
if (isEmpty(options)) {
|
|
14
|
+
console.log(getConfig())
|
|
15
|
+
return
|
|
16
|
+
}
|
|
17
|
+
console.log(getConfig(options))
|
|
18
|
+
},
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { get }
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { get } from './get'
|
|
2
|
-
export { init } from './init'
|
|
3
|
-
export { set } from './set'
|
|
1
|
+
export { get } from './get'
|
|
2
|
+
export { init } from './init'
|
|
3
|
+
export { set } from './set'
|