@jayway/tds
Tedious is a toolkit, mindset and service focusing on handling the tedious parts of web development, leaving all the fun to the developers.
Last updated 7 days ago by fsoderquist .
MIT · Original npm · Tarball · package.json
$ cnpm install @jayway/tds 
SYNC missed versions from official npm registry.

Jayway - Tedious Design System (tds)

Tedious is a toolkit, mindset and service focusing on handling the tedious parts of web development, leaving all the fun to the developers.

It handles bundling stylesheets, scripts and assets using webpack and a predefined (but exendable) config for development and production.

It handles rendering the application server side (SSR)

It adds custom Hot Module Reloading on top of SSR.

It parses your application code structure to identify components, containers, view, patterns, redux handler, graphQL types and resolvers. And serves it with no config as a fully functional application.

Besides it parses all components and serves them in a syleguide (using React Styleguidist)

It sets up a GraphQL server with playground, serving any resolvers in the project folder, but also acts as a proxy, stitching remote GraphQL endpoints to serve them all from a single endpoint.

It sets up Redux, with some built in recucers and middlewares to help you get started, like analytics tracking and screen size.

It also serves a CLI with tools from bundling assets, watching for changes, running the application or ejecting the entire setup as part of your project.

Without any config any component within the src/views folder will automatically be served as separate urls src/views/Start -> /, src/views/About -> /about, src/views/about/me -> /about/me.

By adding a data.json or data.js along with the view file, it will automatically cen loaded as default props, allowing for rapid prototyping.

And it is if needed configurable to get the expected bahaviours.

tds.config.js

  • title: Set the default document title and PWA app title
  • version: define a version of your app, which will be appended to any PWA-cache
  • shortTitle: Shorter title to use instead of title when installed on homescreen
  • description: Set meta description of application
  • lang: Define the language of your app
  • icon: Set relative path to a large icon-file that will be used in generating favicons, touch icons and PWA-icons
  • themeColor: '#3f5b57': Define a theme color for app, used in app capable PWA apps
  • backgroundColor: '#f2f6f3': Define a backgroundcolor used in splash-screen and on favicons (is transparent background)
  • cacheStrategy: 'NetworkFirst':(NetworkFirst,NetworkOnly,CacheFirst) Tell Tedious how to handle GET-requests and cache responses and assets, allowing to take you app to a truly offline PWA experience
  • alias: ({alias: path}) Set up aliases used in your application import statements. This might make importing components or dependencies from remote repositories easier. Per default Tedious is using your src directory as primary root when importing components. And when using @jayway/tds-ui ui is the primary root to src directory in tds-ui.
  • keys { : This is where we define keys to external tracking aplications such as analytics, tag manager and application insights
    • analytics: "G-123456789": Define your analytics key, which will automatically be used to track page requests, and any event dispatched via ({type: 'ANALYTICS_EVENT', name: 'name', value: value}). When using tds-ui components such as <Link />, <Button />, <Form /> and <View />, they provide easy event tracking by properties such as trackClick={'eventName'} trackChange={'eventName'} trackSubmit={'eventName'} trackPage={'eventName'}
    • applicationInsights: {key}: Sets a key by which to track any thrown error exceptions from both server and client to Application Insights. }
  • external: {css: ['http://...'], js: [{src: 'https://...', defer: true}]}: Can be used to add additional scripts and stylesheets to the application
  • entry ("src/containers/App/index.js") A full path to alternative entry file for the application. Tedious will automatically look for an src/index.js or src/App.js by default, or not finding that create an automatic entry with routes for each view component.
  • auth {password: 'secretpass'}: Prevent anyone accessing you app without giving the secret password
  • graphql: {remoteSchemas: [{prefix: '', url: '', token: ''}]}: An array of remote graphQL endpoint which to fetch and serve as our own. By adding a prefix, any root query will be prefixed.
  • server: ({port: 4444, host: "localhost", publicPath: '/'}) Set up server settings
  • webpack: ({dev: '', prod: ''}): set up path to custom webpack configs, to used on top of default, default will look for /webpack.dev.js, /webpack.prod.js or /webpack.config.js
module.exports = {
  title: 'My awesome project',
  keys: {
    analytics: 'G-123',
    applicationInsights: 'AI123'
  },
  alias: {
    tds: "@jayway/tds",
    ui: "@jayway/ui/src"
  },
  entry: "src/App.js",
  graphql: {
    remoteSchemas: [
      {
        prefix: 'cms',
        url:
          'https://api-euwest.graphcms.com/1234',
        token:
          'eyJ0eXAiOiJKV1...'
      }]
  },
  server: {
    port: 4444,
    host: "localhost",
    publicPath: '/'
  }
}

Parsing you application

Tedious will parse your application directory, automatically finding directories and files to figure out how to start up your application.

  • webpack.config.js, webpack.dev.js, webpack.prod.js: If any webpack config is found in your root, thees will be exteded to the build

  • .babelrc, babelrc.js: Extend the babel plugins and preset from your local babel configs.

  • graphql.types: Automatically build a graphQl schema based on your .gql files in src/gql/types, unless you provide a schema

  • graphql.resolvers: Automatically build attacj resolvers based on any .js files in src/gql/resolvers directory, unless you provide a schema

  • graphql.schema: If you have a schema file, this will be used instead of generating one based on types and resolver src/gql/schema.js

  • redux.middlewares: Find any js files in the directory src/store/middlewares and use them when generating a store, unless a store is provided

  • redux.reducers: Find any js files in the directory src/store/reduces and use them to create a store, unless a store is provided

  • redux.store: If the file src/store/index.js or src/store/store.js is provided, use this instead of generating a new store.

  • server.middlewares: Import any js file in src/server/middlewares and add as a koa server middleaware

Current Tags

  • 0.0.83                                ...           latest (7 days ago)

81 Versions

  • 0.0.83                                ...           7 days ago
  • 0.0.82                                ...           9 days ago
  • 0.0.81                                ...           10 days ago
  • 0.0.80                                ...           10 days ago
  • 0.0.78                                ...           a month ago
  • 0.0.77                                ...           a month ago
  • 0.0.76                                ...           a month ago
  • 0.0.75                                ...           a month ago
  • 0.0.74                                ...           2 months ago
  • 0.0.73                                ...           3 months ago
  • 0.0.72                                ...           3 months ago
  • 0.0.71                                ...           3 months ago
  • 0.0.70                                ...           4 months ago
  • 0.0.69                                ...           4 months ago
  • 0.0.68                                ...           4 months ago
  • 0.0.67                                ...           4 months ago
  • 0.0.65                                ...           4 months ago
  • 0.0.64                                ...           4 months ago
  • 0.0.63                                ...           4 months ago
  • 0.0.62                                ...           4 months ago
  • 0.0.61                                ...           4 months ago
  • 0.0.60                                ...           4 months ago
  • 0.0.59                                ...           4 months ago
  • 0.0.58                                ...           4 months ago
  • 0.0.57                                ...           4 months ago
  • 0.0.56                                ...           5 months ago
  • 0.0.55                                ...           5 months ago
  • 0.0.54                                ...           5 months ago
  • 0.0.53                                ...           6 months ago
  • 0.0.52                                ...           6 months ago
  • 0.0.51                                ...           6 months ago
  • 0.0.50                                ...           6 months ago
  • 0.0.49                                ...           6 months ago
  • 0.0.48                                ...           6 months ago
  • 0.0.47                                ...           6 months ago
  • 0.0.46                                ...           6 months ago
  • 0.0.45                                ...           6 months ago
  • 0.0.44                                ...           6 months ago
  • 0.0.43                                ...           6 months ago
  • 0.0.42                                ...           7 months ago
  • 0.0.41                                ...           7 months ago
  • 0.0.40                                ...           7 months ago
  • 0.0.39                                ...           9 months ago
  • 0.0.38                                ...           9 months ago
  • 0.0.37                                ...           9 months ago
  • 0.0.36                                ...           9 months ago
  • 0.0.35                                ...           9 months ago
  • 0.0.34                                ...           9 months ago
  • 0.0.33                                ...           9 months ago
  • 0.0.32                                ...           9 months ago
  • 0.0.31                                ...           9 months ago
  • 0.0.30                                ...           9 months ago
  • 0.0.29                                ...           9 months ago
  • 0.0.28                                ...           9 months ago
  • 0.0.27                                ...           9 months ago
  • 0.0.26                                ...           9 months ago
  • 0.0.25                                ...           9 months ago
  • 0.0.24                                ...           9 months ago
  • 0.0.23                                ...           9 months ago
  • 0.0.22                                ...           a year ago
  • 0.0.21                                ...           a year ago
  • 0.0.20                                ...           a year ago
  • 0.0.19                                ...           a year ago
  • 0.0.18                                ...           a year ago
  • 0.0.17                                ...           a year ago
  • 0.0.16                                ...           a year ago
  • 0.0.15                                ...           a year ago
  • 0.0.14                                ...           a year ago
  • 0.0.13                                ...           a year ago
  • 0.0.12                                ...           a year ago
  • 0.0.11                                ...           a year ago
  • 0.0.10                                ...           a year ago
  • 0.0.9                                ...           a year ago
  • 0.0.8                                ...           a year ago
  • 0.0.7                                ...           a year ago
  • 0.0.6                                ...           a year ago
  • 0.0.5                                ...           a year ago
  • 0.0.4                                ...           a year ago
  • 0.0.3                                ...           a year ago
  • 0.0.2                                ...           a year ago
  • 0.0.1                                ...           a year ago
Downloads
Today 0
This Week 81
This Month 136
Last Day 0
Last Week 52
Last Month 55
Dependencies (144)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2017 © taobao.org |