aberlaas 2.12.0 → 2.14.0
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/lib/main.js +41 -15
- package/package.json +21 -19
package/lib/main.js
CHANGED
|
@@ -1,25 +1,33 @@
|
|
|
1
|
-
import path from 'path';
|
|
1
|
+
import path from 'node:path';
|
|
2
2
|
import minimist from 'minimist';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
absolute,
|
|
5
|
+
consoleError,
|
|
6
|
+
consoleInfo,
|
|
7
|
+
env,
|
|
8
|
+
exit,
|
|
9
|
+
firostImport,
|
|
10
|
+
packageRoot,
|
|
11
|
+
readJson,
|
|
12
|
+
} from 'firost';
|
|
4
13
|
import { _ } from 'golgoth';
|
|
5
14
|
|
|
6
15
|
export default {
|
|
16
|
+
availableCommands: {
|
|
17
|
+
ci: 'aberlaas-ci',
|
|
18
|
+
compress: 'aberlaas-compress',
|
|
19
|
+
init: 'aberlaas-init',
|
|
20
|
+
lint: 'aberlaas-lint',
|
|
21
|
+
precommit: 'aberlaas-precommit',
|
|
22
|
+
readme: 'aberlaas-readme',
|
|
23
|
+
setup: 'aberlaas-setup',
|
|
24
|
+
test: 'aberlaas-test',
|
|
25
|
+
},
|
|
7
26
|
async getCommand(commandName) {
|
|
8
|
-
const
|
|
9
|
-
ci: 'aberlaas-ci',
|
|
10
|
-
compress: 'aberlaas-compress',
|
|
11
|
-
init: 'aberlaas-init',
|
|
12
|
-
lint: 'aberlaas-lint',
|
|
13
|
-
precommit: 'aberlaas-precommit',
|
|
14
|
-
readme: 'aberlaas-readme',
|
|
15
|
-
setup: 'aberlaas-setup',
|
|
16
|
-
test: 'aberlaas-test',
|
|
17
|
-
};
|
|
18
|
-
const commandModuleName = mapping[commandName];
|
|
27
|
+
const commandModuleName = this.availableCommands[commandName];
|
|
19
28
|
if (!commandModuleName) {
|
|
20
29
|
return false;
|
|
21
30
|
}
|
|
22
|
-
|
|
23
31
|
return await firostImport(commandModuleName);
|
|
24
32
|
},
|
|
25
33
|
/**
|
|
@@ -57,11 +65,15 @@ export default {
|
|
|
57
65
|
boolean: true,
|
|
58
66
|
});
|
|
59
67
|
|
|
60
|
-
const commandName = args._[0];
|
|
68
|
+
const commandName = args._[0] || '';
|
|
61
69
|
const command = await this.getCommand(commandName);
|
|
62
70
|
|
|
63
71
|
if (!command) {
|
|
64
72
|
this.__consoleError(`Unknown command ${commandName}`);
|
|
73
|
+
this.__consoleInfo('Available commands:');
|
|
74
|
+
_.each(this.availableCommands, (value, key) => {
|
|
75
|
+
this.__consoleInfo(`- ${key}`);
|
|
76
|
+
});
|
|
65
77
|
this.__exit(1);
|
|
66
78
|
return;
|
|
67
79
|
}
|
|
@@ -73,6 +85,16 @@ export default {
|
|
|
73
85
|
args._ = this.convertFilepathsToAbsolute(args._);
|
|
74
86
|
|
|
75
87
|
try {
|
|
88
|
+
// We need to set ABERLAAS_VERSION for "aberlaas init" as we need to
|
|
89
|
+
// hardcode the currently used aberlaas version in the package.json and
|
|
90
|
+
// there is no reliable way to get it from the init command
|
|
91
|
+
if (commandName == 'init') {
|
|
92
|
+
const packagePath = absolute(packageRoot(), './package.json');
|
|
93
|
+
const packageContent = await readJson(packagePath);
|
|
94
|
+
const packageVersion = packageContent.version;
|
|
95
|
+
this.__setEnv('ABERLAAS_VERSION', packageVersion);
|
|
96
|
+
}
|
|
97
|
+
|
|
76
98
|
await command.run(args);
|
|
77
99
|
} catch (err) {
|
|
78
100
|
this.__consoleError(err.message);
|
|
@@ -80,6 +102,10 @@ export default {
|
|
|
80
102
|
}
|
|
81
103
|
},
|
|
82
104
|
__env: env,
|
|
105
|
+
__setEnv(key, value) {
|
|
106
|
+
process.env[key] = value;
|
|
107
|
+
},
|
|
83
108
|
__consoleError: consoleError,
|
|
109
|
+
__consoleInfo: consoleInfo,
|
|
84
110
|
__exit: exit,
|
|
85
111
|
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aberlaas",
|
|
3
|
-
"
|
|
3
|
+
"version": "2.14.0",
|
|
4
|
+
"author": "Tim Carry (@pixelastic)",
|
|
4
5
|
"description": "Scaffold your JavaScript projects with tests, lint and release scripts",
|
|
5
|
-
"
|
|
6
|
+
"keywords": [],
|
|
6
7
|
"repository": "pixelastic/aberlaas",
|
|
7
8
|
"homepage": "https://projects.pixelastic.com/aberlaas/",
|
|
8
|
-
"
|
|
9
|
+
"type": "module",
|
|
10
|
+
"sideEffects": false,
|
|
9
11
|
"license": "MIT",
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=18.18.0"
|
|
14
|
+
},
|
|
10
15
|
"files": [
|
|
11
16
|
"bin/",
|
|
12
17
|
"commands/ci/*.js",
|
|
@@ -35,26 +40,23 @@
|
|
|
35
40
|
"main": "./lib/main.js",
|
|
36
41
|
"bin": "bin/aberlaas.js",
|
|
37
42
|
"dependencies": {
|
|
38
|
-
"aberlaas-ci": "^2.
|
|
39
|
-
"aberlaas-compress": "^2.
|
|
40
|
-
"aberlaas-helper": "^2.
|
|
41
|
-
"aberlaas-init": "^2.
|
|
42
|
-
"aberlaas-lint": "^2.
|
|
43
|
-
"aberlaas-precommit": "^2.
|
|
44
|
-
"aberlaas-readme": "^2.
|
|
45
|
-
"aberlaas-setup": "^2.
|
|
46
|
-
"aberlaas-test": "^2.
|
|
47
|
-
"aberlaas-versions": "^2.
|
|
43
|
+
"aberlaas-ci": "^2.14.0",
|
|
44
|
+
"aberlaas-compress": "^2.14.0",
|
|
45
|
+
"aberlaas-helper": "^2.14.0",
|
|
46
|
+
"aberlaas-init": "^2.14.0",
|
|
47
|
+
"aberlaas-lint": "^2.14.0",
|
|
48
|
+
"aberlaas-precommit": "^2.14.0",
|
|
49
|
+
"aberlaas-readme": "^2.14.0",
|
|
50
|
+
"aberlaas-setup": "^2.14.0",
|
|
51
|
+
"aberlaas-test": "^2.14.0",
|
|
52
|
+
"aberlaas-versions": "^2.14.0",
|
|
48
53
|
"dedent": "1.5.3",
|
|
49
|
-
"firost": "
|
|
54
|
+
"firost": "5.0.0",
|
|
50
55
|
"gilmore": "1.0.0",
|
|
51
56
|
"golgoth": "2.4.0",
|
|
52
57
|
"minimist": "1.2.8",
|
|
53
58
|
"std-mocks": "2.0.0"
|
|
54
59
|
},
|
|
55
|
-
"engines": {
|
|
56
|
-
"node": ">=18.18.0"
|
|
57
|
-
},
|
|
58
60
|
"scripts": {
|
|
59
61
|
"build": "../../scripts/local/build",
|
|
60
62
|
"build:prod": "../../scripts/local/build-prod",
|
|
@@ -62,7 +64,7 @@
|
|
|
62
64
|
"serve": "../../scripts/local/serve",
|
|
63
65
|
"ci": "../../scripts/local/ci",
|
|
64
66
|
"release": "../../scripts/local/release",
|
|
65
|
-
"update": "node ../../scripts/meta/update.js",
|
|
67
|
+
"update-dependencies": "node ../../scripts/meta/update-dependencies.js",
|
|
66
68
|
"test:meta": "../../scripts/local/test-meta",
|
|
67
69
|
"test": "../../scripts/local/test",
|
|
68
70
|
"test:watch": "../../scripts/local/test-watch",
|
|
@@ -70,5 +72,5 @@
|
|
|
70
72
|
"lint": "../../scripts/local/lint",
|
|
71
73
|
"lint:fix": "../../scripts/local/lint-fix"
|
|
72
74
|
},
|
|
73
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "b11b18726a6b600b33161e5d3fee313565a2a214"
|
|
74
76
|
}
|