create-feli 0.1.11 → 0.1.13

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/README.md CHANGED
@@ -1,48 +1,78 @@
1
- create-vag
2
- ==========
1
+ create-feli
2
+ ===========
3
3
 
4
4
 
5
5
  Presentation
6
6
  ------------
7
7
 
8
- *create-vag* is the *initializer* used by *npm* for creating a new [vag](https://github.com/charlyoleg2/vag) repository. It contains the *command line interface* application called by `npm create vag@latest`.
8
+ *create-feli* is the *initializer* used by *npm* for creating a *mini-server* package, usually within a mono-repo. It contains the *command line interface* application called by `npm create feli@latest`.
9
+ The *mini-server* package aims at installing locally *your* webUI. The *mini-server* package should be named according to your project-name (e.g. webAppAbc-uis).
9
10
 
10
11
 
11
12
  Links
12
13
  -----
13
14
 
14
- - [sources](https://github.com/charlyoleg2/create-vag)
15
- - [pkg](https://www.npmjs.com/package/create-vag)
15
+ - [sources](https://github.com/charlyoleg2/feli_mono)
16
+ - [pkg](https://www.npmjs.com/package/create-feli)
17
+ - [pages](https://charlyoleg2.github.io/feli_mono/)
16
18
 
17
19
 
18
20
  Requirements
19
21
  ------------
20
22
 
21
- - [node](https://nodejs.org) > 20.10.0
22
- - [npm](https://docs.npmjs.com/cli) > 10.5.0
23
+ - [node](https://nodejs.org) > 22.0.0
24
+ - [npm](https://docs.npmjs.com/cli) > 11.0.0
25
+
26
+
27
+ Getting started
28
+ ---------------
29
+
30
+ ```bash
31
+ cd XYZ_mono/pkg/
32
+ npm create feli@latest
33
+ # adjust the script copy_ui for the exact path of copy-from
34
+ vim webAppAbc-uis/package.json
35
+ # integrate the scripts of webAppAbc-uis into the mono-repo top-level scripts
36
+ vim ../package.json
37
+ # install the webAppAbc-uis dependencies
38
+ npm i
39
+ npm run ci
40
+ npm run publish
41
+ ```
23
42
 
24
43
 
25
44
  Usage
26
45
  -----
27
46
 
28
- *create-vag* is not intended to be installed directly but rather used via one of the following commands:
47
+ *create-feli* is not intended to be installed directly but rather used via one of the following commands:
29
48
 
30
49
  ```bash
31
- npm create vag@latest
32
- npm create vag@latest projAbc
33
- npm init vag@latest projAbc
34
- npm exec create-vag@latest projAbc
35
- npx create-vag@latest projAbc
50
+ npm create feli@latest
51
+ npm create feli@latest webAppAbc-uis
52
+ npm init feli@latest webAppAbc-uis
53
+ npm exec create-feli@latest webAppAbc-uis
54
+ npx create-feli@latest webAppAbc-uis
36
55
  ```
37
56
 
38
57
  Dev
39
58
  ---
40
59
 
41
60
  ```bash
42
- git clone https://github.com/charlyoleg2/create-vag
43
- cd create-vag
61
+ git clone https://github.com/charlyoleg2/feli_mono
62
+ cd feli_mono
44
63
  npm install
45
- npm run ci
46
- npm run run
64
+ npm -w create-feli run ci
65
+ cd pkg/create-feli
66
+ npm run clean && npm i && npm run ci && npm run run
47
67
  ```
48
68
 
69
+ Rocket stages:
70
+ 1. npm clean # start from a clean environment
71
+ 2. npm i # install the dependencies of create-feli and in particular those inside feli\_mono/pkg/create-feli/node\_modules
72
+ 3. npm run ci # compile create-feli.ts into javascript and copy the directory template
73
+ 4. npm run run # execute the javascript create-feli.js that generates the directory tmp/webAppAbc-uis
74
+ 5. cd tmp/webAppAbc-uis # move to the generated package
75
+ 6. npm i # install the dependencies of the generated package
76
+ 7. npm run ci # compile the generated mini-server
77
+ 8. npm run run # run the mini-server
78
+
@@ -7,7 +7,7 @@ import chalk from "chalk";
7
7
  // package.json
8
8
  var package_default = {
9
9
  name: "create-feli",
10
- version: "0.1.11",
10
+ version: "0.1.13",
11
11
  description: "The npm-initializer for creating a new feli package",
12
12
  private: false,
13
13
  repository: {
@@ -89,16 +89,16 @@ var package_default = {
89
89
  devDependencies: {
90
90
  "@eslint/js": "^9.28.0",
91
91
  "@types/eslint__js": "^8.42.3",
92
- "@types/node": "^24.0.7",
93
- eslint: "^9.28.0",
92
+ "@types/node": "^24.0.10",
93
+ eslint: "^9.30.1",
94
94
  "eslint-config-prettier": "^10.1.5",
95
- "npm-run-all": "^4.1.5",
96
- prettier: "^3.5.3",
95
+ "npm-run-all2": "^8.0.4",
96
+ prettier: "^3.6.2",
97
97
  shx: "^0.4.0",
98
98
  tsup: "^8.5.0",
99
99
  typescript: "^5.8.3",
100
- "typescript-eslint": "^8.33.1",
101
- vitest: "^3.2.2"
100
+ "typescript-eslint": "^8.35.1",
101
+ vitest: "^3.2.4"
102
102
  }
103
103
  };
104
104
 
@@ -133,11 +133,14 @@ function prefixOutputPath() {
133
133
 
134
134
  // src/create-feli-list.ts
135
135
  var template_file_list = [
136
- ".editorconfig",
137
136
  ".gitignore",
138
- "package.json",
137
+ ".prettierignore",
139
138
  "README.md",
140
- "{{projName}}_repos.yml"
139
+ "eslint.config.js",
140
+ "package.json",
141
+ "tsconfig.json",
142
+ "src/{{pkgName}}.test.ts",
143
+ "src/{{pkgName}}.ts"
141
144
  ];
142
145
 
143
146
  // src/create-feli-api.ts
@@ -160,15 +163,14 @@ function isFileBinary(fpath) {
160
163
  async function oneFile(onePath, cfg2, preDir2) {
161
164
  try {
162
165
  const onePathIn = Handlebars.compile(onePath)({
163
- projName: "projAbc",
164
- repoName: "projAbc-uis"
166
+ pkgName: "webAppAbc-uis"
165
167
  });
166
168
  const onePathOut = Handlebars.compile(onePath)(cfg2);
167
169
  const fileIn1 = new URL(`./template/${onePathIn}.handlebars`, import.meta.url);
168
170
  const fileIn2 = new URL(`./template/${onePathIn}`, import.meta.url);
169
171
  let fileBin = false;
170
172
  let fileStr2 = "";
171
- const outPath = `${preDir2}/${cfg2.repoName}/${onePathOut}`;
173
+ const outPath = `${preDir2}/${cfg2.pkgName}/${onePathOut}`;
172
174
  try {
173
175
  await access(fileIn1);
174
176
  try {
@@ -203,47 +205,38 @@ async function oneFile(onePath, cfg2, preDir2) {
203
205
  }
204
206
  async function generate_boirlerplate(cfg12, preDir2) {
205
207
  console.log(`Boilerplate with:
206
- project name : ${cfg12.projName}
207
- repository name : ${cfg12.repoName}`);
208
+ package name : ${cfg12.pkgName}`);
208
209
  const cfg2 = {
209
- projName: cfg12.projName,
210
- ProjName: firstLetterCapital(cfg12.projName),
211
- ProjNameUnderline: underline(cfg12.projName),
212
- repoName: cfg12.repoName,
213
- RepoName: firstLetterCapital(cfg12.repoName),
214
- RepoNameUnderline: underline(cfg12.repoName)
210
+ pkgName: cfg12.pkgName,
211
+ PkgName: firstLetterCapital(cfg12.pkgName),
212
+ PkgNameUnderline: underline(cfg12.pkgName)
215
213
  };
216
214
  for (const fpath of template_file_list) {
217
215
  await oneFile(fpath, cfg2, preDir2);
218
216
  }
219
- console.log(`generate ${template_file_list.length} files in ${preDir2}/${cfg12.repoName}/`);
217
+ console.log(`generate ${template_file_list.length} files in ${preDir2}/${cfg12.pkgName}/`);
220
218
  await sleep(100);
221
219
  const rResp = {
222
- vim: `vim ${cfg12.projName}_repos.yml`
220
+ vim: `vim ${cfg12.pkgName}/package.json`
223
221
  };
224
222
  return rResp;
225
223
  }
226
224
 
227
225
  // src/create-feli-cli.ts
228
- var firstMsg = `Create a new ${chalk.italic("feli-top-repo")} with ${chalk.italic(package_default.name)} version ${chalk.italic(package_default.version)}`;
226
+ var firstMsg = `Create a new ${chalk.italic("feli-package")} with ${chalk.italic(package_default.name)} version ${chalk.italic(package_default.version)}`;
229
227
  console.log(firstMsg);
230
- var projName = process.argv[2] || "blabla";
228
+ var pkgNameInit = process.argv[2] || "webAppAbc-uis";
231
229
  var argN = process.argv.length - 2;
232
230
  if (argN > 1) {
233
231
  console.log(`warn376: ${argN} arguments provided but only one supported!`);
234
232
  }
235
- prom.intro(chalk.inverse(" Your new feli-top-repo "));
233
+ prom.intro(chalk.inverse(" Your new feli-package "));
236
234
  var pCfg = await prom.group(
237
235
  {
238
- projName: () => prom.text({
239
- message: "Name of the project?",
240
- initialValue: `${projName}`
241
- //placeholder: `${projName}`
242
- }),
243
- repoName: () => prom.text({
244
- message: "Name of the top-repository?",
245
- initialValue: `${projName}_uis`
246
- //placeholder: `${projName}_uis`
236
+ pkgName: () => prom.text({
237
+ message: "Name of the package?",
238
+ initialValue: `${pkgNameInit}`
239
+ //placeholder: `${pkgNameInit}`
247
240
  })
248
241
  },
249
242
  {
@@ -253,10 +246,9 @@ var pCfg = await prom.group(
253
246
  }
254
247
  }
255
248
  );
256
- prom.outro("Your new feli-top-repository will be boilerplated!");
249
+ prom.outro(`Your package ${pCfg.pkgName} will be boilerplated!`);
257
250
  var cfg1 = {
258
- projName: pCfg.projName,
259
- repoName: pCfg.repoName
251
+ pkgName: pCfg.pkgName
260
252
  };
261
253
  var preDir = prefixOutputPath();
262
254
  var resp = await generate_boirlerplate(cfg1, preDir);
@@ -267,15 +259,11 @@ function styl(str) {
267
259
  }
268
260
  var lastMsg = `
269
261
  Next steps:
270
- 1: ${styl(`cd ${pCfg.repoName}`)}
271
- 2: ${styl(`npm install`)}
272
- 3: ${styl('git init && git add -A && git commit -m "Initial commit"')} (optional)
273
- 4: ${styl(`${resp.vim}`)} (optional)
274
- 5: ${styl(`npm run`)}
275
- 6: ${styl(`npm run vag-list`)}
276
- 7: ${styl(`npm run vag-clone`)}
277
- 8: ${styl(`npm run vag-pull`)}
278
- 9: ${styl(`npm run vag-status`)}
279
- 10: ${styl(`npm run vag-diff`)}
262
+ 1: ${styl(`# adapt the path of copy-from`)}
263
+ ${resp.vim}
264
+ 2: ${styl(`# integrate ${pCfg.pkgName} in the mono-repo scripts`)}
265
+ vim ../package.json
266
+ 3: ${styl(`# install the dependencies of ${pCfg.pkgName}`)}
267
+ npm install
280
268
  `;
281
269
  console.log(lastMsg);
@@ -1,6 +1,5 @@
1
- # .gitignore of vag-root
2
- node_modules
3
- build
4
- dist
5
- tmp
6
- /repos/
1
+ # .gitignore of the package {{pkgName}}
2
+ dist/
3
+ dist2/
4
+ # vitest creates node_modules for the results.json
5
+ node_modules/
@@ -0,0 +1,7 @@
1
+ # .prettierignore
2
+
3
+ node_modules
4
+ build
5
+ dist
6
+ tmp
7
+ README.md
@@ -1,30 +1,45 @@
1
- {{ProjName}}\_vag
2
- {{{ProjNameUnderline}}}=====
1
+ {{PkgName}}
2
+ {{{PkgNameUnderline}}}
3
3
 
4
4
 
5
5
  Presentation
6
6
  ------------
7
7
 
8
- *{{projName}}\_vag* is the top-repo of the *{{ProjName}}* ecosystem. It just points to other repositories.
8
+ *{{pkgName}}* is the mini-server package for enabling the local installation of the web-ui.
9
9
 
10
- Using [vag\_tools](https://www.npmjs.com/package/vag_tools), it clones the following repositories:
10
+ Usually, this mini-server package {{pkgName}} is part of a mono-repo containing an other package for the web-ui and potentially an *universal* library backing the web-ui.
11
11
 
12
- - {{projName}}
13
- - create-{{projName}}
14
- - {{projName}}\_vag
12
+
13
+ Requirements
14
+ ------------
15
+
16
+ - [node](https://nodejs.org) > 22.0.0
17
+ - [npm](https://docs.npmjs.com/cli) > 11.0.0
18
+
19
+
20
+ Installation
21
+ ------------
22
+
23
+ ```bash
24
+ npm i -D {{pkgName}}
25
+ ```
26
+
27
+
28
+ Usage
29
+ -----
30
+
31
+ ```bash
32
+ npx {{pkgName}}
33
+ npx {{pkgName}} --help
34
+ ```
15
35
 
16
36
 
17
- Getting started
18
- ---------------
37
+ Usage without installation
38
+ --------------------------
19
39
 
20
40
  ```bash
21
- git clone https://github.com/MYNAME/{{projName}}_vag
22
- cd {{projName}}_vag
23
- npm i
24
- npm run
25
- npm run vag-clone
26
- npm run vag-pull
27
- ls -la repos
28
- npx vag --help
41
+ npx {{pkgName}}
42
+ npx --package={{pkgName}} {{pkgName}}
43
+ npx --package={{pkgName}} {{pkgName}} --help
29
44
  ```
30
45
 
@@ -0,0 +1,16 @@
1
+ // @ts-check
2
+
3
+ import eslint from '@eslint/js';
4
+ import tseslint from 'typescript-eslint';
5
+ import prettier from 'eslint-config-prettier';
6
+
7
+ export default tseslint.config(
8
+ {
9
+ ignores: ['dist/', 'tmp/', 'build/', 'node_modules/']
10
+ },
11
+ eslint.configs.recommended,
12
+ //...tseslint.configs.recommended,
13
+ ...tseslint.configs.strict,
14
+ ...tseslint.configs.stylistic,
15
+ prettier
16
+ );
@@ -1,35 +1,91 @@
1
1
  {
2
- "name": "{{projName}}_vag",
3
- "version": "0.0.1",
4
- "description": "top-repo that points to the other {{projName}} repositories",
5
- "private": true,
2
+ "name": "{{pkgName}}",
3
+ "description": "feli-package {{pkgName}} for installing locally the web-ui webAppAbc",
4
+ "version": "0.1.0",
5
+ "private": false,
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "git+https://github.com/MYNAME/{{projName}}_vag.git"
8
+ "url": "git+https://github.com/MYNAME/XYZ_mono.git"
9
9
  },
10
- "homepage": "https://github.com/MYNAME/{{projName}}_vag#readme",
10
+ "homepage": "https://MYNAME.github.io/XYZ_mono/",
11
11
  "author": "MYNAME",
12
12
  "license": "ISC",
13
13
  "keywords": [
14
- "{{projName}}",
15
- "vag"
14
+ "feli",
15
+ "front-end locally installed"
16
16
  ],
17
17
  "type": "module",
18
- "main": "index.js",
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/{{pkgName}}.d.ts",
21
+ "default": "./dist/{{pkgName}}.js"
22
+ }
23
+ },
24
+ "bin": {
25
+ "{{pkgName}}": "dist/{{pkgName}}.js"
26
+ },
27
+ "files": [
28
+ "dist/",
29
+ "!dist/**/*.d.ts",
30
+ "!dist/**/*.map",
31
+ "!dist/**/*.test.*",
32
+ "!dist/**/*.spec.*"
33
+ ],
34
+ "engines": {
35
+ "node": ">=22.0.0"
36
+ },
37
+ "tsup": {
38
+ "entry": [
39
+ "src/{{pkgName}}.ts"
40
+ ],
41
+ "format": "esm",
42
+ "splitting": false,
43
+ "dts": false,
44
+ "sourcemap": false,
45
+ "clean": true
46
+ },
47
+ "prettier": {
48
+ "useTabs": true,
49
+ "singleQuote": true,
50
+ "trailingComma": "none",
51
+ "printWidth": 100,
52
+ "plugins": [],
53
+ "overrides": []
54
+ },
19
55
  "scripts": {
20
- "vag-list": "vag --importYaml={{projName}}_repos.yml list",
21
- "vag-clone": "vag --importYaml={{projName}}_repos.yml clone",
22
- "vag-status": "vag --importYaml={{projName}}_repos.yml --only_configured status",
23
- "vag-diff": "vag --importYaml={{projName}}_repos.yml --only_configured diff",
24
- "vag-branch": "vag branch",
25
- "vag-remote": "vag remote",
26
- "vag-pull": "vag pull",
27
- "vag-push": "vag push",
28
- "vag-verify": "vag verify --importYaml={{projName}}_repos.yml",
29
- "vag-versions": "vag versions",
30
- "test": "echo \"Error: no test specified\" && exit 1"
56
+ "dev": "tsup --watch",
57
+ "build": "tsup",
58
+ "check": "tsc --noEmit",
59
+ "pretty": "prettier --check .",
60
+ "format": "prettier --write .",
61
+ "lint": "eslint .",
62
+ "test:unit": "vitest",
63
+ "test:unit:once": "vitest --run",
64
+ "clean_public": "rimraf dist/public",
65
+ "copy_ui": "shx cp -r ../myWebUI/build dist/public",
66
+ "checkCopy": "ls -l dist/public/index.html",
67
+ "copy_public": "run-s clean_public copy_ui checkCopy",
68
+ "ci": "run-s check build pretty lint test:unit:once copy_public",
69
+ "run": "node dist/{{pkgName}}.js",
70
+ "run-help": "node dist/{{pkgName}}.js --help",
71
+ "clean": "rimraf node_modules build dist tmp"
72
+ },
73
+ "dependencies": {
74
+ "feli": "^0.5.3"
31
75
  },
32
76
  "devDependencies": {
33
- "vag_tools": "^0.1.0"
77
+ "@eslint/js": "^9.10.0",
78
+ "@types/eslint__js": "^8.42.3",
79
+ "@types/node": "^24.0.10",
80
+ "eslint": "^9.30.1",
81
+ "eslint-config-prettier": "^10.1.5",
82
+ "npm-run-all2": "^8.0.4",
83
+ "prettier": "^3.6.2",
84
+ "rimraf": "^6.0.1",
85
+ "shx": "^0.4.0",
86
+ "tsup": "^8.5.0",
87
+ "typescript": "^5.8.3",
88
+ "typescript-eslint": "^8.35.1",
89
+ "vitest": "^3.2.4"
34
90
  }
35
91
  }
@@ -0,0 +1,8 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ //import * from './{{pkgName}}'
3
+
4
+ describe('sum test', () => {
5
+ it('adds 1 + 2 to equal 3', () => {
6
+ expect(1 + 2).toBe(3);
7
+ });
8
+ });
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ // {{pkgName}}.ts
3
+
4
+ import { feli_cli } from 'feli';
5
+ import process from 'node:process';
6
+ import path from 'node:path';
7
+
8
+ const scrDir = import.meta.dirname;
9
+ const defaultPublicDir = path.join(scrDir, 'public');
10
+
11
+ //console.log('{{pkgName}}.ts says Hello!');
12
+ try {
13
+ await feli_cli(defaultPublicDir, process.argv);
14
+ } catch (err) {
15
+ console.error(`Error from feli: ${err}`);
16
+ }
17
+ //console.log('{{pkgName}}.ts says Bye!');
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "esnext",
4
+ "module": "esnext",
5
+ "outDir": "./build",
6
+ "esModuleInterop": true,
7
+ "resolveJsonModule": true,
8
+ "moduleResolution": "bundler",
9
+ "skipLibCheck": true,
10
+ "declaration": true,
11
+ "sourceMap": true,
12
+ "strict": true
13
+ },
14
+ "include": ["./src"]
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-feli",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "The npm-initializer for creating a new feli package",
5
5
  "private": false,
6
6
  "repository": {
@@ -82,15 +82,15 @@
82
82
  "devDependencies": {
83
83
  "@eslint/js": "^9.28.0",
84
84
  "@types/eslint__js": "^8.42.3",
85
- "@types/node": "^24.0.7",
86
- "eslint": "^9.28.0",
85
+ "@types/node": "^24.0.10",
86
+ "eslint": "^9.30.1",
87
87
  "eslint-config-prettier": "^10.1.5",
88
- "npm-run-all": "^4.1.5",
89
- "prettier": "^3.5.3",
88
+ "npm-run-all2": "^8.0.4",
89
+ "prettier": "^3.6.2",
90
90
  "shx": "^0.4.0",
91
91
  "tsup": "^8.5.0",
92
92
  "typescript": "^5.8.3",
93
- "typescript-eslint": "^8.33.1",
94
- "vitest": "^3.2.2"
93
+ "typescript-eslint": "^8.35.1",
94
+ "vitest": "^3.2.4"
95
95
  }
96
96
  }
@@ -1,23 +0,0 @@
1
- # .editorconfig of vag-root
2
- # EditorConfig is awesome: https://EditorConfig.org
3
- # don't forget the vim-plugin for it
4
-
5
- # top-most EditorConfig file
6
- root = true
7
-
8
- # Unix-style newlines with a newline ending every file
9
- [*]
10
- indent_style = tab
11
- indent_size = 4
12
- end_of_line = lf
13
- charset = utf-8
14
- trim_trailing_whitespace = true
15
- insert_final_newline = true
16
-
17
- # Tab indentation (no size specified)
18
- [Makefile]
19
- indent_style = tab
20
-
21
- # yaml indentation with spaces
22
- [*.{yml,yaml}]
23
- indent_style = space
@@ -1,13 +0,0 @@
1
- # {{projName}}_repos.yml
2
-
3
- repositories:
4
- repos/{{projName}}:
5
- type: git
6
- url: git@github.com:MYNAME/{{projName}}.git
7
- version: main
8
- repos/create-{{projName}}:
9
- url: git@github.com:MYNAME/create-{{projName}}.git
10
- version: main
11
- repos/{{projName}}_vag:
12
- url: git@github.com:MYNAME/{{projName}}_vag.git
13
- version: main