generator-vovanmozg 1.0.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.
@@ -0,0 +1,11 @@
1
+ const Generator = require('yeoman-generator');
2
+
3
+ module.exports = class extends Generator {
4
+ initializing() {
5
+ this.log('Available templates:');
6
+ this.log(' - ruby: Ruby project with Docker');
7
+ this.log(' - node: Node.js project with Docker');
8
+ this.log('');
9
+ this.log('Usage: yo vovanmozg:ruby or yo vovanmozg:node');
10
+ }
11
+ };
@@ -0,0 +1,26 @@
1
+ const Generator = require('yeoman-generator');
2
+
3
+ module.exports = class extends Generator {
4
+ prompting() {
5
+ return this.prompt([{
6
+ type: 'input',
7
+ name: 'projectName',
8
+ message: 'Project name:',
9
+ default: this.appname
10
+ }]).then(answers => {
11
+ this.answers = answers;
12
+ });
13
+ }
14
+
15
+ writing() {
16
+ this.fs.copyTpl(
17
+ this.templatePath('**/*'),
18
+ this.destinationPath(this.answers.projectName),
19
+ this.answers
20
+ );
21
+ }
22
+
23
+ install() {
24
+ this.npmInstall();
25
+ }
26
+ };
@@ -0,0 +1,10 @@
1
+ FROM node:alpine
2
+
3
+ WORKDIR /app
4
+
5
+ COPY package*.json ./
6
+ RUN npm install
7
+
8
+ COPY . .
9
+
10
+ CMD ["npm", "start"]
@@ -0,0 +1 @@
1
+ console.log('Hello, world!');
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "<%= projectName %>",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "start": "node index.js"
8
+ }
9
+ }
@@ -0,0 +1,27 @@
1
+ const Generator = require('yeoman-generator');
2
+
3
+ module.exports = class extends Generator {
4
+ prompting() {
5
+ return this.prompt([{
6
+ type: 'input',
7
+ name: 'projectName',
8
+ message: 'Project name:',
9
+ default: this.appname
10
+ }]).then(answers => {
11
+ this.answers = answers;
12
+ });
13
+ }
14
+
15
+ writing() {
16
+ // Copy all template files
17
+ this.fs.copyTpl(
18
+ this.templatePath('**/*'),
19
+ this.destinationPath(this.answers.projectName),
20
+ this.answers
21
+ );
22
+ }
23
+
24
+ install() {
25
+ // No npm install needed for Ruby projects
26
+ }
27
+ };
@@ -0,0 +1,8 @@
1
+ FROM ruby:alpine
2
+
3
+ WORKDIR /app
4
+
5
+ # Do not copy if entire application mounted in docker-compose volumes
6
+ # COPY run.rb .
7
+
8
+ CMD ["ruby", "run.rb"]
File without changes
@@ -0,0 +1,7 @@
1
+ services:
2
+ small-template:
3
+ build: .
4
+ environment:
5
+ - SOME_ENV=xxx
6
+ volumes:
7
+ - .:/app
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ puts 'Hello, world!'
package/package.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "generator-vovanmozg",
3
+ "version": "1.0.0",
4
+ "description": "vovanmozg's stack generators",
5
+ "files": [
6
+ "generators"
7
+ ],
8
+ "keywords": [
9
+ "yeoman-generator"
10
+ ],
11
+ "dependencies": {
12
+ "yeoman-generator": "^5.7.0"
13
+ }
14
+ }