-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4fe7858
commit d5ec555
Showing
12 changed files
with
379 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
'use strict'; | ||
const Base = require('yeoman-generator'); | ||
const pluginTypes = ['lib', 'slib', 'lib-slib', 'lib-service', 'service', 'app', 'app-slib',] | ||
|
||
class ChangeTypeGenerator extends Base { | ||
|
||
constructor(args, options) { | ||
super(args, options); | ||
} | ||
|
||
prompting() { | ||
const type = this.config.get('type'); | ||
return this.prompt([{ | ||
type: 'checkbox', | ||
name: 'type', | ||
message: 'New Type', | ||
default: ['slib'], | ||
choices: pluginTypes | ||
}]).then(({type}) => { | ||
this.old = this.config.get('type') | ||
this.log(type) | ||
this.config.set('type', type[0]); | ||
|
||
}) | ||
} | ||
default() { | ||
const type = this.config.get('type') | ||
this.composeWith(`phovea:to-${type}-type`, {currentType: this.old, newType: this.config.get('type')}) | ||
} | ||
} | ||
|
||
module.exports = ChangeTypeGenerator; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
'use strict'; | ||
const Base = require('yeoman-generator'); | ||
|
||
const diff = [ | ||
'buildPython.js', | ||
'deploy/docker-compose.partial.yml', | ||
'docker_packages.txt', | ||
'docs/.gitignore', | ||
'docs/_static/touch.txt', | ||
'docs/_templates/touch.txt', | ||
'docs/conf.py', | ||
'docs/index.rst', | ||
'requirements.txt', | ||
'requirements_dev.txt', | ||
'setup.cfg', | ||
'setup.py', | ||
'test/__init__.py', | ||
'test/config.json', | ||
'tox.ini', | ||
] | ||
const prefix = '../../'; | ||
|
||
class DowngradeLib extends Base { | ||
|
||
constructor(args, options) { | ||
super(args, options); | ||
} | ||
|
||
initializing() { | ||
this.gitIgnorePath = this.templatePath(`${prefix}_init-web/templates/_gitignore`) | ||
this.pathToConfigYml = this.templatePath(`${prefix}_init-web/templates/plain/.circleci/config.yml`) | ||
this.pathToPackageJSON = this.templatePath(`${prefix}_init-web/templates/package.tmpl.json`) | ||
} | ||
_reversePackageJSON() { | ||
const pkg = this.fs.readJSON(this.destinationPath('package.json')); | ||
const {scripts, files} = this.fs.readJSON(this.pathToPackageJSON); | ||
pkg.scripts = scripts; | ||
pkg.files = files; | ||
this.fs.writeJSON(this.destinationPath('package.json'), pkg); | ||
} | ||
writing() { | ||
diff.forEach((file) => this.fs.delete(this.destinationPath(file))) | ||
this.fs.copyTpl(this.gitIgnorePath, this.destinationPath('.gitignore')); | ||
this.fs.copyTpl(this.pathToConfigYml, this.destinationPath('.circleci/config.yml')); | ||
this._reversePackageJSON(); | ||
} | ||
} | ||
|
||
module.exports = DowngradeLib; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
'use strict'; | ||
const Base = require('yeoman-generator'); | ||
const {merge, omit, extend, template} = require('lodash'); | ||
|
||
const diff = [ | ||
'buildInfo.js', | ||
'index.js', | ||
'jest.config.js', | ||
'phovea_registry.js', | ||
'src/index.ts', | ||
'src/phovea.ts', | ||
'tests.webpack.js', | ||
'tests/index.test.ts', | ||
'tsconfig.json', | ||
'tsconfig_dev.json', | ||
'tsd.d.ts', | ||
'tslint.json', | ||
'typedoc.json', | ||
'webpack.config.js' | ||
] | ||
const prefix = '../../'; | ||
|
||
class DowngradeSlib extends Base { | ||
|
||
constructor(args, options) { | ||
super(args, options); | ||
} | ||
|
||
initializing() { | ||
this.gitIgnorePath = this.templatePath(`${prefix}_init-python/templates/_gitignore`) | ||
this.pathToConfigYml = this.templatePath(`${prefix}_init-python/templates/plain/.circleci/config.yml`) | ||
this.pathToPackageJSON = this.templatePath(`${prefix}_init-python/templates/package.tmpl.json`) | ||
} | ||
|
||
_reversePackageJSON() { | ||
const config = this.config.getAll(); | ||
let pkg = this.fs.readJSON(this.destinationPath('package.json')); | ||
const pkgPatch = JSON.parse(template(this.fs.read(this.pathToPackageJSON))(config)); | ||
pkg = omit(pkg, ['engines', 'dependencies', 'devDependencies']); | ||
pkg = Object.assign(pkg, pkgPatch); | ||
this.fs.writeJSON(this.destinationPath('package.json'), pkg); | ||
} | ||
_downgrade() { | ||
diff.forEach((file) => this.fs.delete(this.destinationPath(file))) | ||
this.fs.copyTpl(this.gitIgnorePath, this.destinationPath('.gitignore')); | ||
this.fs.copyTpl(this.pathToConfigYml, this.destinationPath('.circleci/config.yml')); | ||
this._reversePackageJSON(); | ||
} | ||
|
||
_upgrade(){ | ||
|
||
} | ||
|
||
writing() { | ||
this._downgrade(); | ||
} | ||
} | ||
|
||
module.exports = DowngradeSlib; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
.circleci/config.yml | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.yo-rc.json | ||
ISSUE_TEMPLATE.md | ||
LICENSE | ||
README.md | ||
buildInfo.js | ||
deploy/Dockerfile | ||
deploy/nginx-default.conf | ||
jest.config.js | ||
package.json | ||
phovea_registry.js | ||
src/404.html | ||
src/app.ts | ||
src/index.html | ||
src/index.ts | ||
src/language.ts | ||
src/phovea.ts | ||
src/robots.txt | ||
src/style.scss | ||
src/styles/_base.scss | ||
tests.webpack.js | ||
tests/app.test.ts | ||
tsconfig.json | ||
tsconfig_dev.json | ||
tsd.d.ts | ||
tslint.json | ||
typedoc.json | ||
webpack.config.js | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
.circleci/config.yml | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.yo-rc.json | ||
ISSUE_TEMPLATE.md | ||
LICENSE | ||
README.md | ||
buildInfo.js | ||
buildPython.js | ||
deploy/Dockerfile | ||
deploy/docker-compose.partial.yml | ||
deploy/nginx-default.conf | ||
docker_packages.txt | ||
docs/.gitignore | ||
docs/_static/touch.txt | ||
docs/_templates/touch.txt | ||
docs/conf.py | ||
docs/index.rst | ||
jest.config.js | ||
package.json | ||
phovea_registry.js | ||
requirements.txt | ||
requirements_dev.txt | ||
setup.cfg | ||
setup.py | ||
src/404.html | ||
src/app.ts | ||
src/index.html | ||
src/index.ts | ||
src/language.ts | ||
src/phovea.ts | ||
src/robots.txt | ||
src/style.scss | ||
src/styles/_base.scss | ||
test/__init__.py | ||
test/config.json | ||
tests.webpack.js | ||
tests/app.test.ts | ||
tox.ini | ||
tsconfig.json | ||
tsconfig_dev.json | ||
tsd.d.ts | ||
tslint.json | ||
typedoc.json | ||
webpack.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.circleci/config.yml | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.yo-rc.json | ||
ISSUE_TEMPLATE.md | ||
LICENSE | ||
README.md | ||
buildInfo.js | ||
index.js | ||
jest.config.js | ||
package.json | ||
phovea_registry.js | ||
src/index.ts | ||
src/phovea.ts | ||
tests.webpack.js | ||
tests/index.test.ts | ||
tsconfig.json | ||
tsconfig_dev.json | ||
tsd.d.ts | ||
tslint.json | ||
typedoc.json | ||
webpack.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
.circleci/config.yml | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.yo-rc.json | ||
ISSUE_TEMPLATE.md | ||
LICENSE | ||
README.md | ||
buildInfo.js | ||
buildPython.js | ||
deploy/Dockerfile | ||
deploy/Dockerfile_dev | ||
deploy/docker-compose-debug.partial.yml | ||
deploy/docker-compose.partial.yml | ||
docker_packages.txt | ||
docs/.gitignore | ||
docs/_static/touch.txt | ||
docs/_templates/touch.txt | ||
docs/conf.py | ||
docs/index.rst | ||
index.js | ||
jest.config.js | ||
package.json | ||
phovea_registry.js | ||
requirements.txt | ||
requirements_dev.txt | ||
setup.cfg | ||
setup.py | ||
src/index.ts | ||
src/phovea.ts | ||
test/__init__.py | ||
test/config.json | ||
test/server.py | ||
tests.webpack.js | ||
tests/index.test.ts | ||
tests/test_server.py | ||
tox.ini | ||
tsconfig.json | ||
tsconfig_dev.json | ||
tsd.d.ts | ||
tslint.json | ||
typedoc.json | ||
webpack.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
.circleci/config.yml | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.yo-rc.json | ||
ISSUE_TEMPLATE.md | ||
LICENSE | ||
README.md | ||
buildInfo.js | ||
buildPython.js | ||
deploy/docker-compose.partial.yml | ||
docker_packages.txt | ||
docs/.gitignore | ||
docs/_static/touch.txt | ||
docs/_templates/touch.txt | ||
docs/conf.py | ||
docs/index.rst | ||
index.js | ||
jest.config.js | ||
package.json | ||
phovea_registry.js | ||
requirements.txt | ||
requirements_dev.txt | ||
setup.cfg | ||
setup.py | ||
src/index.ts | ||
src/phovea.ts | ||
test/__init__.py | ||
test/config.json | ||
tests.webpack.js | ||
tests/index.test.ts | ||
tox.ini | ||
tsconfig.json | ||
tsconfig_dev.json | ||
tsd.d.ts | ||
tslint.json | ||
typedoc.json | ||
webpack.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.circleci/config.yml | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.yo-rc.json | ||
ISSUE_TEMPLATE.md | ||
LICENSE | ||
README.md | ||
buildPython.js | ||
deploy/Dockerfile | ||
deploy/Dockerfile_dev | ||
deploy/docker-compose-debug.partial.yml | ||
deploy/docker-compose.partial.yml | ||
docker_packages.txt | ||
docs/.gitignore | ||
docs/_static/touch.txt | ||
docs/_templates/touch.txt | ||
docs/conf.py | ||
docs/index.rst | ||
package.json | ||
requirements.txt | ||
requirements_dev.txt | ||
setup.cfg | ||
setup.py | ||
test/__init__.py | ||
test/config.json | ||
test/server.py | ||
tests/test_server.py | ||
tox.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.circleci/config.yml | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.yo-rc.json | ||
ISSUE_TEMPLATE.md | ||
LICENSE | ||
README.md | ||
buildPython.js | ||
deploy/docker-compose.partial.yml | ||
docker_packages.txt | ||
docs/.gitignore | ||
docs/_static/touch.txt | ||
docs/_templates/touch.txt | ||
docs/conf.py | ||
docs/index.rst | ||
package.json | ||
requirements.txt | ||
requirements_dev.txt | ||
setup.cfg | ||
setup.py | ||
test/__init__.py | ||
test/config.json | ||
tox.ini |
Oops, something went wrong.