This repository has been archived by the owner on Jul 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Showing
59 changed files
with
664 additions
and
334 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
# Contributing to generator-oraclejet | ||
|
||
*Copyright (c) 2014, 2017 Oracle and/or its affiliates | ||
The Universal Permissive License (UPL), Version 1.0* | ||
|
||
**Pull requests are currently not being accepted for the Oracle JET project.** | ||
|
||
We plan to provide this functionality in the future. At that time, you will need to follow [The Oracle Contributor Agreement](https://www.oracle.com/technetwork/community/oca-486395.html) | ||
(OCA). | ||
|
||
If you have ideas, comments, or issues related to generator, swing on by the [Oracle JET discussion forum.](https://community.oracle.com/community/development_tools/oracle-jet/generators) | ||
# Contributing to generator-oraclejet | ||
|
||
*Copyright (c) 2014, 2017 Oracle and/or its affiliates | ||
The Universal Permissive License (UPL), Version 1.0* | ||
|
||
**Pull requests are currently not being accepted for the Oracle JET project.** | ||
|
||
We plan to provide this functionality in the future. At that time, you will need to follow [The Oracle Contributor Agreement](https://www.oracle.com/technetwork/community/oca-486395.html) | ||
(OCA). | ||
|
||
If you have ideas, comments, or issues to discuss, swing on by the [Oracle JET discussion forum.](https://community.oracle.com/community/development_tools/oracle-jet/generators) |
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 @@ | ||
/** | ||
Copyright (c) 2015, 2017, Oracle and/or its affiliates. | ||
The Universal Permissive License (UPL), Version 1.0 | ||
*/ | ||
module.exports = function (grunt) { | ||
grunt.initConfig({ | ||
}); | ||
|
||
|
||
// Load grunt tasks from NPM packages | ||
require("load-grunt-tasks")(grunt); | ||
|
||
// Merge sub configs | ||
var options = { | ||
config : { | ||
src : "build/generator.js" | ||
}, | ||
pkg: grunt.file.readJSON("package.json") | ||
} | ||
var configs = require('load-grunt-configs')(grunt, options); | ||
grunt.config.merge(configs); | ||
|
||
}; | ||
|
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 |
---|---|---|
@@ -1,37 +1,18 @@ | ||
# generator-oraclejet 3.2.0 | ||
|
||
## About the generator | ||
This Yeoman generator for Oracle JET lets you quickly set up a project for use as a web application or hybrid mobile application for Android, iOS or Windows 10. | ||
|
||
This is an open source project maintained by Oracle Corp. | ||
|
||
## Installation | ||
For step-by-step instructions on using Yeoman and this generator to build an Oracle JET application, including possible pre-requisites for installation, please see the [Oracle JET Developers Guide](http://docs.oracle.com/middleware/jet320/jet/) | ||
```bash | ||
npm install -g generator-oraclejet | ||
``` | ||
|
||
## Usage | ||
Once you have the generator installed, the following commands will scaffold up a JET based application. See the [Oracle JET Developers Guide](http://docs.oracle.com/middleware/jet320/jet/) for information about all of the available command line options as well as details on pre-requisites for installation. | ||
|
||
```bash | ||
# Generate a web application with default blank template | ||
yo oraclejet <app name> | ||
``` | ||
```bash | ||
# Generate a web application with default basic template | ||
yo oraclejet <app name> --template=basic | ||
``` | ||
```bash | ||
# Generate a hybrid mobile application for Android with default navdrawer template | ||
yo oraclejet:hybrid myApp --appid=com.oracle.samples.myapp --appname=MyApp --template=navdrawer --platform=android | ||
``` | ||
|
||
## [Contributing](https://github.com/oracle/generator-oraclejet/tree/master/CONTRIBUTING.md) | ||
Oracle JET is an open source project. Pull Requests are currently not being accepted. See | ||
[CONTRIBUTING](https://github.com/oracle/generator-oraclejet/tree/master/CONTRIBUTING.md) | ||
for details. | ||
|
||
## [License](https://github.com/oracle/generator-oraclejet/tree/master/LICENSE.md) | ||
Copyright (c) 2014, 2017 Oracle and/or its affiliates | ||
The Universal Permissive License (UPL), Version 1.0 | ||
# @oracle/generator-oraclejet 4.0.0 | ||
|
||
## About the generator | ||
This Yeoman generator for Oracle JET lets you quickly set up a project for use as a web application or hybrid mobile application for Android, iOS or Windows 10. | ||
|
||
This is an open source project maintained by Oracle Corp. | ||
|
||
## Installation | ||
This module will be automatically installed as a dependency of the Oracle JET command-line interface [@oracle/ojet-cli](https://github.com/oracle/ojet-cli), and should not be installed directly. | ||
|
||
## [Contributing](https://github.com/oracle/generator-oraclejet/tree/master/CONTRIBUTING.md) | ||
Oracle JET is an open source project. Pull Requests are currently not being accepted. See | ||
[CONTRIBUTING](https://github.com/oracle/generator-oraclejet/tree/master/CONTRIBUTING.md) | ||
for details. | ||
|
||
## [License](https://github.com/oracle/generator-oraclejet/tree/master/LICENSE.md) | ||
Copyright (c) 2014, 2017 Oracle and/or its affiliates | ||
The Universal Permissive License (UPL), Version 1.0 |
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,64 @@ | ||
/** | ||
Copyright (c) 2015, 2017, Oracle and/or its affiliates. | ||
The Universal Permissive License (UPL), Version 1.0 | ||
*/ | ||
'use strict'; | ||
|
||
const fs = require('fs-extra'); | ||
const path = require('path'); | ||
const CONSTANTS = require('../util/constants'); | ||
const paths = require('../util/paths'); | ||
|
||
module.exports = | ||
{ | ||
writeComponentTemplate: function _writeComponentTemplate(generator) { | ||
return new Promise((resolve) => { | ||
if (generator.options.component) { | ||
const templateSrc = path.join(generator.templatePath(), '../../../template/component'); | ||
const isApp = fs.existsSync(path.join(process.cwd(), CONSTANTS.APP_CONFIG_JSON)) | ||
|| generator.appDir !== undefined; | ||
|
||
if (!isApp) return resolve(generator); | ||
|
||
const appDir = generator.appDir === undefined | ||
? process.cwd() : generator.destinationPath(generator.appDir); | ||
|
||
const _configPaths = generator.appDir === undefined | ||
? paths.getConfiguredPaths(appDir) : paths.getDefaultPaths(); | ||
|
||
const destDirectory = generator.destinationPath( | ||
path.join(appDir, _configPaths.source, | ||
_configPaths.sourceJavascript, CONSTANTS.JET_COMPOSITES, generator.options.component)); | ||
|
||
// avoid overwrite component | ||
if (fs.existsSync(destDirectory)) { | ||
console.log('Component already exists. '); | ||
return resolve(generator); | ||
} | ||
fs.ensureDirSync(destDirectory); | ||
fs.copySync(templateSrc, destDirectory); | ||
_replaceComponentTemplateToken(generator); | ||
} | ||
|
||
return resolve(generator); | ||
}); | ||
} | ||
}; | ||
|
||
function _replaceComponentTemplateToken(generator) { | ||
const componentName = generator.componentName || generator.options.component; | ||
|
||
const appDir = generator.appDir === undefined | ||
? process.cwd() : generator.destinationPath(generator.appDir); | ||
|
||
const _configPaths = generator.appDir === undefined | ||
? paths.getConfiguredPaths(appDir) : paths.getDefaultPaths(); | ||
|
||
const base = path.join(appDir, _configPaths.source, | ||
_configPaths.sourceJavascript, CONSTANTS.JET_COMPOSITES, componentName); | ||
|
||
CONSTANTS.COMPONENT_FILES.forEach((file) => { | ||
const fileContent = fs.readFileSync(path.join(base, file), 'utf-8'); | ||
fs.outputFileSync(path.join(base, file), fileContent.replace(new RegExp('@component@', 'g'), componentName)); | ||
}); | ||
} |
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
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
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,56 @@ | ||
/** | ||
Copyright (c) 2015, 2017, Oracle and/or its affiliates. | ||
The Universal Permissive License (UPL), Version 1.0 | ||
*/ | ||
'use strict'; | ||
|
||
const fs = require('fs-extra'); | ||
const path = require('path'); | ||
const CONSTANTS = require('../util/constants'); | ||
const paths = require('../util/paths'); | ||
|
||
module.exports = | ||
{ | ||
writeTestTemplate: function _writeTestTemplates(generator) { | ||
return new Promise((resolve) => { | ||
if (generator.options.component) { | ||
const isApp = fs.existsSync(path.join(process.cwd(), CONSTANTS.APP_CONFIG_JSON)) | ||
|| generator.appDir !== undefined; | ||
|
||
if (!isApp) return resolve(generator); | ||
|
||
const appDir = generator.appDir === undefined | ||
? process.cwd() : generator.destinationPath(generator.appDir); | ||
|
||
const _configPaths = generator.appDir === undefined | ||
? paths.getConfiguredPaths(appDir) : paths.getDefaultPaths(); | ||
|
||
const templateSrc = path.join(generator.templatePath(), '../../../template/test'); | ||
const destDirectory = generator.destinationPath( | ||
path.join(appDir, _configPaths.source, _configPaths.sourceTests)); | ||
|
||
// avoid overwrite test | ||
if (fs.existsSync(destDirectory)) resolve(generator); | ||
|
||
fs.ensureDirSync(destDirectory); | ||
fs.copySync(templateSrc, destDirectory); | ||
_replaceTestHTMLToken(generator); | ||
} | ||
return resolve(generator); | ||
}); | ||
}, | ||
}; | ||
|
||
function _replaceTestHTMLToken(generator) { | ||
const componentName = generator.componentName || generator.options.component; | ||
|
||
const appDir = generator.appDir === undefined | ||
? process.cwd() : generator.destinationPath(generator.appDir); | ||
|
||
const _configPaths = generator.appDir === undefined | ||
? paths.getConfiguredPaths(appDir) : paths.getDefaultPaths(); | ||
|
||
const htmlPath = path.join(appDir, _configPaths.source, _configPaths.sourceTests, 'index.html'); | ||
const html = fs.readFileSync(htmlPath, 'utf-8'); | ||
fs.outputFileSync(htmlPath, html.replace(new RegExp('@component@', 'g'), componentName)); | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.