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

Commit ad7ec5f

Browse files
authored
Merge pull request #29 from SqueezerIO/v1.1.13
V1.1.13
2 parents f7d1948 + 1e2bc9a commit ad7ec5f

56 files changed

Lines changed: 287 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,

CONTRIBUTING.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Contributing
2+
3+
When contributing to this repository, please first discuss the change you wish to make via issue,
4+
email, or any other method with the owners of this repository before making a change.
5+
6+
Please note we have a code of conduct, please follow it in all your interactions with the project.
7+
8+
## Pull Request Process
9+
10+
1. Lock down dependency versions `npm shrinkwrap`
11+
2. TravisCI will trigger linter check, js duplicate code scan and integration tests
12+
13+
## Code of Conduct
14+
15+
### Our Pledge
16+
17+
In the interest of fostering an open and welcoming environment, we as
18+
contributors and maintainers pledge to making participation in our project and
19+
our community a harassment-free experience for everyone, regardless of age, body
20+
size, disability, ethnicity, gender identity and expression, level of experience,
21+
nationality, personal appearance, race, religion, or sexual identity and
22+
orientation.
23+
24+
### Our Standards
25+
26+
Examples of behavior that contributes to creating a positive environment
27+
include:
28+
29+
* Using welcoming and inclusive language
30+
* Being respectful of differing viewpoints and experiences
31+
* Gracefully accepting constructive criticism
32+
* Focusing on what is best for the community
33+
* Showing empathy towards other community members
34+
35+
Examples of unacceptable behavior by participants include:
36+
37+
* The use of sexualized language or imagery and unwelcome sexual attention or
38+
advances
39+
* Trolling, insulting/derogatory comments, and personal or political attacks
40+
* Public or private harassment
41+
* Publishing others' private information, such as a physical or electronic
42+
address, without explicit permission
43+
* Other conduct which could reasonably be considered inappropriate in a
44+
professional setting
45+
46+
### Our Responsibilities
47+
48+
Project maintainers are responsible for clarifying the standards of acceptable
49+
behavior and are expected to take appropriate and fair corrective action in
50+
response to any instances of unacceptable behavior.
51+
52+
Project maintainers have the right and responsibility to remove, edit, or
53+
reject comments, commits, code, wiki edits, issues, and other contributions
54+
that are not aligned to this Code of Conduct, or to ban temporarily or
55+
permanently any contributor for other behaviors that they deem inappropriate,
56+
threatening, offensive, or harmful.
57+
58+
### Scope
59+
60+
This Code of Conduct applies both within project spaces and in public spaces
61+
when an individual is representing the project or its community. Examples of
62+
representing a project or community include using an official project e-mail
63+
address, posting via an official social media account, or acting as an appointed
64+
representative at an online or offline event. Representation of a project may be
65+
further defined and clarified by project maintainers.
66+
67+
### Enforcement
68+
69+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
70+
reported by contacting the project team at nick@squeezer.io . All
71+
complaints will be reviewed and investigated and will result in a response that
72+
is deemed necessary and appropriate to the circumstances. The project team is
73+
obligated to maintain confidentiality with regard to the reporter of an incident.
74+
Further details of specific enforcement policies may be posted separately.
75+
76+
Project maintainers who do not follow or enforce the Code of Conduct in good
77+
faith may face temporary or permanent repercussions as determined by other
78+
members of the project's leadership.
79+
80+
### Attribution
81+
82+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
83+
available at [http://contributor-covenant.org/version/1/4][version]
84+
85+
[homepage]: http://contributor-covenant.org
86+
[version]: http://contributor-covenant.org/version/1/4/

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Squeezer Framework [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)
2+
13
![Squeezer Intro](docs/gitbook/images/introduction.png)
24

35
## [Watch video](https://www.youtube.com/watch?v=DfRnJOZvtJg&t=3s)
@@ -104,3 +106,7 @@ NOTE: **Windows** users should [enable symlinks](http://answers.perforce.com/art
104106
├── node_modules Node NPM packages
105107
└── plugins Project's plugins
106108
```
109+
110+
### Contributing
111+
112+
See [contributing.md](CONTRIBUTING.md) for contribution guidelines.

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)