Skip to content
This repository was archived by the owner on Jan 29, 2026. It is now read-only.

Commit e1ca801

Browse files
committed
fixed code linter issues
1 parent 7a08860 commit e1ca801

54 files changed

Lines changed: 195 additions & 1992 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
/_book
44
public/
55
test-projects/
6+
/docs
7+
/lib/plugins/templates/

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
"strict": 0,
5151
"import/no-extraneous-dependencies": "off",
5252
"import/no-dynamic-require": "off",
53-
"react/require-extension": "off"
53+
"react/require-extension": "off",
54+
"import/no-unresolved" : "off"
5455
},
5556
"globals": {
5657
"AnalysisView": true,

bin/Squeezer.js

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const CommonCliLog = require(`${appRoot}/lib/common/cli/log`);
1414
const CommonCliParams = require(`${appRoot}/lib/common/cli/params`);
1515
const CommonCliHelp = require(`${appRoot}/lib/common/cli/help`);
1616
const CommonUtils = require(`${appRoot}/lib/common/utils`);
17-
const CommonCloudsInfo = require(`${appRoot}/lib/common/clouds/info`);
1817
const CommonLifecycle = require(`${appRoot}/lib/common/lifecycle`);
1918
const CommonVariables = require(`${appRoot}/lib/common/variables`);
2019
const CommonVersion = require(`${appRoot}/lib/common/version`);
@@ -24,41 +23,40 @@ const CommonChecksums = require(`${appRoot}/lib/common/checksums`);
2423

2524
class Squeezer {
2625
init() {
27-
this.cli = {};
28-
this.cli.params = new CommonCliParams(this);
29-
this.cli.error = new CommonCliError(this);
30-
this.cli.loader = new CommonCliLoader(this);
31-
this.cli.log = new CommonCliLog(this);
32-
this.cli.help = new CommonCliHelp(this);
33-
this.utils = new CommonUtils(this);
34-
this.yaml = new CommonYaml(this);
35-
this.lifecycle = new CommonLifecycle(this);
36-
this.command = new CommonCommand(this);
37-
this.variables = new CommonVariables(this);
38-
this.archive = new CommonArchiver(this);
39-
this.version = new CommonVersion(this);
40-
this.config = new CommonConfig(this);
41-
this.validate = new CommonValidate(this);
42-
this.checksums = new CommonChecksums(this);
26+
this.cli = {
27+
params : new CommonCliParams(this),
28+
error : new CommonCliError(this),
29+
loader : new CommonCliLoader(this),
30+
log : new CommonCliLog(this),
31+
help : new CommonCliHelp(this)
32+
};
33+
this.utils = new CommonUtils(this);
34+
this.yaml = new CommonYaml(this);
35+
this.lifecycle = new CommonLifecycle(this);
36+
this.command = new CommonCommand(this);
37+
this.variables = new CommonVariables(this);
38+
this.archive = new CommonArchiver(this);
39+
this.version = new CommonVersion(this);
40+
this.config = new CommonConfig(this);
41+
this.validate = new CommonValidate(this);
42+
this.checksums = new CommonChecksums(this);
4343

4444
this.deploy = {};
4545

46-
this.clouds = {};
47-
this.clouds.info = new CommonCloudsInfo(this);
48-
49-
this.vars = {};
50-
this.vars.project = {};
51-
this.vars.microservices = {};
52-
this.vars.hooks = [];
53-
this.vars.apiBaseUrl = 'https://api.squeezer.io';
54-
this.vars.stage = 'dev';
55-
this.vars.assets = {
56-
main : {
57-
previousChecksum : null,
58-
currentChecksum : null
59-
},
60-
microservices : [],
61-
uploadPaths : []
46+
this.vars = {
47+
project : {},
48+
microservices : {},
49+
hooks : [],
50+
apiBaseUrl : 'https://api.squeezer.io',
51+
stage : 'dev',
52+
assets : {
53+
main : {
54+
previousChecksum : null,
55+
currentChecksum : null
56+
},
57+
microservices : [],
58+
uploadPaths : []
59+
}
6260
};
6361

6462
if (process.argv[2] === 'deploy') {
@@ -99,7 +97,7 @@ class Squeezer {
9997
}, splitPath.length);
10098

10199
if (this.vars.project.isValid === true) {
102-
const buildPath = `${this.vars.project.path}/.build`;
100+
const buildPath = `${this.vars.project.path}/.build`;
103101
this.vars.project.buildPath = buildPath;
104102
if (!fs.existsSync(buildPath)) {
105103
fs.mkdirSync(buildPath);

bin/interface.js

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ module.exports = (() => {
2424

2525
load() {
2626
const frameworkCmdsPaths = walkSync(`${appRoot}`, { globs : ['lib/plugins/*/index.js'] })
27-
.map((val) => (`${appRoot}/${val}`));
27+
.map(val => (`${appRoot}/${val}`));
2828

2929
let pluginsCmdsPaths = [];
3030

3131
if (sqz.vars.project.isValid && sqz.vars.project.plugins
3232
&& sqz.vars.project.plugins.length > 0) {
3333
pluginsCmdsPaths = sqz.vars.project.plugins
34-
.map((val) => (`${sqz.vars.project.path}/${val.path}/${val.name}/index.js`));
34+
.map(val => (`${sqz.vars.project.path}/${val.path}/${val.name}/index.js`));
3535
}
3636

3737
const paths = _.concat(frameworkCmdsPaths, pluginsCmdsPaths);
@@ -79,36 +79,50 @@ module.exports = (() => {
7979

8080
const helpCmdMsg = colors.yellow(`\n\n$ ${bin} ${colors.blue.bold('help')} ${args.names.join(':')}`);
8181

82-
_.forEach(cmdData.options, (value, key) => {
83-
if (_.has(args.flags, value.flag)) {
84-
sqz.cli.params.setOption(key, args.flags[value.flag]);
85-
}
82+
const check = (value, key) => {
8683
if (value.required === true) {
87-
8884
if (!_.has(args.options, key) && !_.has(args.flags, value.flag)) {
8985
sqz.cli.log.error(`Missing option ${colors.green(`--${key}`)} ${helpCmdMsg}`);
9086
} else if (!args.options[key] && !args.flags[value.flag]) {
9187
sqz.cli.log.error(`Missing option ${colors.green(`--${key}`)} ` +
9288
`${colors.red('value')} ${helpCmdMsg}`);
9389
}
94-
} else {
95-
if (!args.options[key] && value.defaultValue !== null) { // eslint-disable-line no-lonely-if
96-
args.options[key] = value.defaultValue;
97-
}
90+
} else if (!args.options[key] && value.defaultValue !== null) {
91+
args.options[key] = value.defaultValue;
9892
}
93+
};
9994

95+
_.forEach(cmdData.options, (value, key) => {
96+
if (_.has(args.flags, value.flag)) {
97+
sqz.cli.params.setOption(key, args.flags[value.flag]);
98+
}
10099
if (value.boolean && args.options[key]) {
101100
args.options[key] = JSON.parse(args.options[key]);
102101
}
103-
104102
if (_.has(value, 'validate')) {
105103
if (!value.validate.fn(args.options[key])) {
106104
sqz.cli.log.error(`${colors.blue.bold(`--${key}`)} : ${value.validate.error}`);
107105
}
108106
}
107+
check(value, key);
109108
});
110109
}
111110

111+
index(args, logo) {
112+
if (args.names.length === 0) {
113+
const msg =
114+
`${logo}\n` +
115+
`* Lists all commands ${colors.green('`sqz list`')}.\n` +
116+
`* Get help for a command ${colors.green('`sqz help [command]`')}.\n` +
117+
`* Add ${colors.green('--debug')} to any command for debugging\n` +
118+
`* Squeezer framework documentation: ${colors.cyan('docs.squeezer.io')}\n`;
119+
120+
sqz.cli.log.console(msg.replace(/^/gm, ' '.repeat(1)));
121+
122+
process.exit(0);
123+
}
124+
}
125+
112126
run() {
113127
const args = this.args;
114128
const command = this.commands[args.names.join(':')];
@@ -129,22 +143,11 @@ module.exports = (() => {
129143
let errorMsg = `Command "${colors.green(hintCmd)}" not found ... \n`;
130144
const availableHelpCmds = [];
131145

132-
if (args.names.length === 0) {
133-
const msg =
134-
`${logo}\n` +
135-
`* Lists all commands ${colors.green('`sqz list`')}.\n` +
136-
`* Get help for a command ${colors.green('`sqz help [command]`')}.\n` +
137-
`* Add ${colors.green('--debug')} to any command for debugging\n` +
138-
`* Squeezer framework documentation: ${colors.cyan('docs.squeezer.io')}\n`;
139-
140-
sqz.cli.log.console(msg.replace(/^/gm, ' '.repeat(1)));
141-
142-
process.exit(0);
143-
}
146+
this.index(args, logo);
144147

145148
if (args.names[0] === 'help' && args.args.length === 0) {
146149
sqz.cli.log.error(
147-
`Missing help command argument , please use ` +
150+
'Missing help command argument , please use ' +
148151
`${colors.blue.bold(`\`${bin} help [command]\``)}` +
149152
`\n\n... or ${colors.blue.bold(`\`${bin} list\``)} to get all available commands\n`
150153
);
@@ -155,10 +158,11 @@ module.exports = (() => {
155158
if (cmd.indexOf(hintCmd) >= 0) {
156159
availableHelpCmds.push(cmd);
157160
}
161+
return availableHelpCmds;
158162
});
159163

160164
if (availableHelpCmds.length > 0) {
161-
errorMsg += colors.green(`\nDid you mean one of these commands?\n\n`);
165+
errorMsg += colors.green('\nDid you mean one of these commands?\n\n');
162166
errorMsg += `${' '.repeat(3)}${colors.blue.bold(availableHelpCmds.join(`\n${' '.repeat(3)}`))}`;
163167
}
164168

docs/gitbook/js/framework.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

2-
window.frameworkVersion = '1.1.11';
2+
window.frameworkVersion = '1.1.12';
33
window.frameworkVersionReleaseDate = '2017-05-12';

0 commit comments

Comments
 (0)