@omni-door/tpl-common

The omni-door commom templates

Usage no npm install needed!

<script type="module">
  import omniDoorTplCommon from 'https://cdn.skypack.dev/@omni-door/tpl-common';
</script>

README

🐸 @omni-door/tpl-common

The common templates for @omni-door

Install

  • Clone the repo: git clone git@github.com:omni-door/tpl-common.git

  • Install with npm: npm install @omni-door/tpl-common

  • Install with Yarn: yarn add @omni-door/tpl-common

Methods

  • getDependency

    import { getDependency } from '@omni-door/tpl-common';
    
    const dependency = getDependency('latest', {
      'core-js': '3.6.4',
      'react': '16.12.0',
      'react-dom': '16.12.0',
      'regenerator-runtime': '0.13.3'
    });
    
    const dependency_stable = getDependency('stable', {
      'core-js': '3.6.4',
      'react': '16.12.0',
      'react-dom': '16.12.0',
      'regenerator-runtime': '0.13.3'
    });
    
    dependency('react'); // 'react@latest'
    dependency_stable('react'); // 'react@16.12.0'
    
  • arr2str

    import { arr2str } from '@omni-door/tpl-common';
    
    arr2str([1, 2, 3]); // "1 2 3"
    
  • intersection

    import { intersection } from '@omni-door/tpl-common';
    
    depArr = [ ...intersection(depArr, depArr.filter(v => v !== 1)) ]
    

Templates

  • babel => babel.config.js

  • commitlint => commitlint.config.js

  • eslint => .eslintrc.js

  • eslintignore => .eslintignore

  • gitignore => .gitignore

  • jest => jest.config.js

  • karma => karma.config.js

  • mocha => mocha.opts

  • npmignore => .npmignore

  • omni => omni.config.js

  • pkj => package.json

  • readme => README.md

  • stylelint => stylelint.config.js

  • tsconfig => tsconfig.json

  • component_class => component/index.(jsx|tsx)

  • component_functional => component/index.(jsx|tsx)

  • component_index => component/index.(js|ts)

  • component_readme => component/README.md

  • component_stylesheet => component/style/index.(css|less|scss)

  • component_test => component/test/index.(jsx|tsx)

  • component_mdx => component/README.mdx

  • component_stories => component/stories/index.(jsx|tsx)

  • tool_index => tool/index.(js|ts)

  • tool_readme => tool/README.md

  • tool_test => tool/test/index.(js|ts)