New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

espina

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

espina

Starter kit and generator for ES6 React Isomorphic webapp (React, Redux, Webpack, Universal-Webpack, Karma, Jasmine)

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
2
Weekly downloads
 
Created
Source

Spike Classes

import ClientStateManager from 'espina/client/state_manager';
import ServerStateManager from 'espina/server/state_manager';
import ClientRouter from 'espina/client/router';
import ServerRouter from 'espina/server/state_manager';

import ApplicationComponent from 'espina/shared/application_component';
import BaseComponent from 'espina/shared/base_component'; 
import Route from 'espina/shared/route.js';

import RouteLink from 'espina/shared/components/route/route_link.component.js';

Generators

Component Generators

Should generate components within shared/components as such:

espina generate component Example --name --where utils -t -s -rt

This would generate:

shared/components/utils/example
  example.component.js
  example.scss
  example.test
  example.rt.html

Similarly:

espina generate route --name  Route1

This would generate:

shared/components/routes/route1
  route.component.js
  route.scss
  route.test.js
  route.rt.html

Options

  • t or test [false]: include example.test.js
  • rt or react-template [false]: include example.rt.html
  • s or style [false]: include example.scss

Reducer Generators

spike generate reducer --name  User

This would generate:

shared/reducers/user
  user.reducers.js
  user.actions.js
  user.reducer.test.js

Application Generator

espina generate app

This would generate the following structure.

client
  config
    design
      webpack.js
    develop
      webpack.js
    production
      webpack.js
    shared
      style.js
  app.js
server
  assets
    css
    js
    transalations
      en.json
  config
    design
      server.js
    develop
      server.js
    production
      server.js
    server.base.js
  views
    index.ejs
shared
  base_classes
  components
  mixins
  reducers
  routes.js

I will need to think through options to configure:

  • Whether to include translations in app generation.

Build and Run Tools

We will want to provide easy build commands:

NODE_ENV=production espina build

This should build client assets (app.js, style.css, as well as a server build in build/production/server). See this article.

NODE_ENV=development espina run

Routes

We use path_to_regex in order to use express-style paths, so the routes must been an array with the fallowing syntax:

import Router from 'spike/client/router';
Router route = new Router(i18m,[
  {
    name: "Info",
    path: "/info"
  },
  {
    name:"Details",
    path:`/${i18n.t('details')}/:id`,
    url:(payload,i18n) => {
      return `/${i18n.t('details')}/${payload.id}`
    }
  },
]);

Where:

name : Is the route name used when you use this.route.pushRoute(route_name) in the base_components.

path : Is the express-style path expressions

url (optional) : Is the function called by route_link component in order to create the href parameter, if this parameter is not provided path will be used instead.

Keywords

FAQs

Package last updated on 21 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc