Ejemplo n.º 1
0
  writing: function () {
    this.fs.copyTpl(
        this.templatePath('componentView.js'),
        this.destinationPath('src/components/'+changeCase.camel(this.name)+'/'+changeCase.pascal(this.name)+'View.js'),
        {
          name: changeCase.pascal(this.name)
        }
    );

    this.fs.copyTpl(
        this.templatePath('componentViewController.js'),
        this.destinationPath('src/components/'+changeCase.camel(this.name)+'/'+changeCase.pascal(this.name)+'ViewController.js'),
        {
          name: changeCase.pascal(this.name)
        }
    );

    this.fs.copyTpl(
        this.templatePath('componentViewEvents.js'),
        this.destinationPath('src/components/'+changeCase.camel(this.name)+'/'+changeCase.pascal(this.name)+'ViewEvents.js'),
        {
          name: changeCase.pascal(this.name)
        }
    );
  }
Ejemplo n.º 2
0
export default function componentTransformer (file, options) {
    let { oldName, newName, oldPath, newPath } = options;

    return transforms.transformIdentifiers(file, pascal(oldName), pascal(newName))
    .then(() => transforms.transformIdentifiers(file, camel(oldName), camel(newName)))
    .then(() => transforms.transformMetadata(file, null, oldName, newName))
    .then(() => transforms.transformReferences('components', oldPath, newPath, oldName, newName))
    .then(() => transforms.transformReferenceIdentifiers(oldPath, pascal(oldName), pascal(newName)))
    .then(() => transforms.transformReferenceIdentifiers(oldPath, camel(oldName), camel(newName)));
}
Ejemplo n.º 3
0
    writing: function () {
        this.destinationRoot(this.env.cwd);

        this.fs.copyTpl(
            this.templatePath('componentViewController.js'),
            this.destinationPath(changeCase.pascal(this.name) + 'ViewController.js'),
            {
                name: changeCase.pascal(this.name)
            }
        );
    }
Ejemplo n.º 4
0
export default function (name) {
    return `

import mongoose from 'mongoose'
import schema from '../../../data/schema/${name}'

export const ${pascal([name, 'schema'])} = new mongoose.Schema(schema)

export const ${pascal([name, 'model'])} = mongoose.model('${name}', ${pascal([name, 'schema'])})

`.trim()
}
 ngModelController.$validators.variableNameValid = function (value) {
     var variableName = $scope.$parent.isClass ? pascalcase(value) : camelcase(value);
     if (variableName.length === 0) {
         return false;
     }
     return validationService.validateVariableName(variableName);
 };
Ejemplo n.º 6
0
  handleAction = (action) => {
    if (this.plannerActive()) this.animationCollection.acceptAction(action);

    const handlerSuffix = changeCase.pascal(action.type);
    const handlerName = `handle${handlerSuffix}`;
    const handler = this[handlerName];
    if (handler) handler(action);
  }
Ejemplo n.º 7
0
    initializing: function () {
        this.argument('name', {
            required: true,
            type: String,
            desc: 'GLU viewcontroller name'
        });

        this.log('Creating GLU viewcontroller: ' + changeCase.pascal(this.name) + '.');
    },
Ejemplo n.º 8
0
  initializing: function () {
    this.argument('name', {
      required: true,
      type: String,
      desc: 'Component name'
    });

    this.log('Creating component: ' + changeCase.pascal(this.name) + '.');
  },
    index: function (req, res) {

        sails.log(req.socket._connecting);

        var str = req.session.passport.user,
            user = changeCase.pascal(str);


        return res.view({title: "Dockerstack.org",user:user});
    }
Ejemplo n.º 10
0
export default function (name) {
    return `

import {${pascal([name, 'model'])}} from '../model/${name}'

export async function save(entry) {
    let _entry = new ${pascal([name, 'model'])}(entry)
    return _entry.save()
}

export async function remove(id) {
    return ${pascal([name, 'model'])}.remove({_id: id}).exec()
}

export async function update(entry) {
    return ${pascal([name, 'model'])}.update({_id: entry._id}, entry).exec()
}

export async function findById(id) {
    return ${pascal([name, 'model'])}.findById(id).exec()
}

export async function find() {
    return ${pascal([name, 'model'])}.find().exec()
}

`.trim()
}
Ejemplo n.º 11
0
 handleAction = (action) => {
   const handlerSuffix = changeCase.pascal(action.type);
   const handlerName = `handle${handlerSuffix}`;
   const handler = this[handlerName];
   if (handler) handler(action);
 }
Ejemplo n.º 12
0
import changeCase from 'change-case'

export const DEV_PORT = 5000
export const WEBPACK_DEV_PORT = 3000
export const OUTPUT_PATH = './resources/'
export const JS_OUTPUT_FILENAME = 'index.js'
export const CSS_OUTPUT_FILENAME = 'main.css'
export const WEB_APP_ENTRY_POINT = './app/index.js'
export const WEB_APP_DIR = './'
export const HARNESS_DIR = '../DiagnosticsHarness'
export const NPM_CMD = 'yarn'
export const ENV = process.env.NODE_ENV ? process.env.NODE_ENV : 'development'
export const TARGET = process.env.CONFIGURATION ? process.env.CONFIGURATION : 'Debug'

// ASP.NET Core expects environment names to be Pascal case
export const WEB_APP_ENV = changeCase.pascal(ENV)
Ejemplo n.º 13
0
 .then(() => transforms.transformReferenceIdentifiers(oldPath, pascal(oldName), pascal(newName)))
Ejemplo n.º 14
0
 clean: name => changeCase.pascal(name),
export const LoggingStrings = {
  levels: [
    'FATAL',
    'ERROR',
    'WARN',
    'INFO',
    'DEBUG'
  ],
  originClient: 'client',
  originServer: 'server'
};

export const Api = {
  displayName: "Stress API",
  get name() {
    return ChangeCase.pascal(Api.displayName);
  },
  all: {
    get userObjRoot() {
      return `${ChangeCase.camel(Api.name)}`;
    },
    tokenName: 'apiKey',
    get apiUserTokenPath() {
      return `${Api.all.userObjRoot}.${Api.all.tokenName}`;
    },
    get idHeader() {
      return `X-${Api.name}-Id`;
    },
    get tokenHeader() {
      return `X-${Api.name}-Token`;
    }
 ngModelController.$validators.variableNameUnique = function (value) {
     var variableName = $scope.$parent.isClass ? pascalcase(value) : camelcase(value);
     var allVariableNames = $scope.allVariableNames();
     var result = !_.contains(allVariableNames, variableName);
     return result;
 };