npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

marcura

v0.2.0

Published

PortLog Common UI

Downloads

1,513

Readme

PortLog Common UI

Install

$ npm i --save marcura

Usage

angular.module('your.app.name', [
    //...
    'ui.marcura'
    //...
]);

Providers

Instruction Config

Set router state names for manager and creator/editor component.

Components relay on provided router state names:

  1. instructionAdd
  2. instructionCreator
// Setup
import {IInstructionConfigProvider} from 'marcura';
...
app.config((InstructionConfigProvider: IInstructionConfigProvider): void => {
    'ngInject';

    InstructionConfigProvider.config.router.manager = 'app.instruction.manager';
    InstructionConfigProvider.config.router.creator = 'app.instruction.creator';
});

// Usage
import {IInstructionConfig} from 'marcura';
...
class InstructionController implements angular.IComponentController {

    constructor(private InstructionConfig: IInstructionConfig,
                private $state: angular.ui.IStateService) {
        'ngInject';
    }
    ...
    public create(): void {
        this.$state.go(this.InstructionConfig.router.creator);
    }
}

Instruction Filter Assignee

Set default items and state for filters available on instruction list.

// Setup
import {Assignee, IInstructionFilterAssigneeProvider} from 'marcura';
...
app.config((instructionFilterAssigneeProvider: IInstructionFilterAssigneeProvider): void => {
    'ngInject';

    console.log(instructionFilterAssigneeProvider.assignees);
    // >> [{ name: 'Chartering', id: 2 },{ name: 'Operator', id: 3 },{ name: 'Master', id: 0 }]

    //Set default select for 'Chartering'
    // Remember to think in immutable way!
    const assignees: Assignees[] = [].concat(instructionFilterAssigneeProvider.assignees);
    const assignee: Assignee = assignees[0];
    assignee.checked = true;

    /*
    * Or shorter
    * assignees[0].checked = true;
    */
    instructionFilterAssigneeProvider.setAssignees(assignees);
});

// Usage
import {Assignee} from 'marcura'

class InstructionFilterController implment angular.IComponentController {

    constructor(private instructionFilterAssignee: Assignee[]) {
        'ngInject';
    }
}

Developement

PLO or PLC is required to be able to swiftly develop library. Of course any app that imports marcura will work, but portlog apps already have environment that enables some building to be done quicker.

The project is written in AngularJS with Typescript and component approach. Syles are written in sass with Bootstrap and PostCSS for autoprefixing.

Project dependencies

Core

  • Angular 1.6.x
  • Angular Material
  • Typescript
  • jQuery
  • lodash
  • Bootstrap
  • animate.css

Additional Libraries

  • marcura-ui
  • mdi
  • moment
  • pikaday
  • quill
  • select2
  • tslib

Developement wokflow

library = marcura-common-ui (this repository) app = any app that uses marcura library as depedency

  1. Clone git repository.
  2. Run npm install && npm link in the main folder of the library.
  3. In the local version of PLO or PLC run npm link marcura to link the app to the local version of library.
  4. Run that locally linked app (PLO or PLC) in developement mode so you can view marcura library elements inside of this app.
  5. Modify marcura-common-ui in any way you need.
  6. Run npm link from the root of the library to rebuilt and relink it.
  7. Rebuild app you were using locally as the base for library. (In PLO and PLC you can use npm run dev:fresh to rebuild the vendor of both apps uing the new marcura library. The script runs also dev developement for those apps).
  8. View the changes you've made in marcura library in the base app.

Deployment

  1. Make sure you have the newest version from master.
  2. Commit you changes to master. (preferably through PR first)
  3. Run npm login.
  4. Run npm version patch.
  5. Run npm publish.
  6. NPM publish creates a commit with updated version in package.json - push it to master.
  7. Update the version of marcura library in any apps that uses it to the new one just created and push to repository.
  8. Redeploy the apps.

Steps to do a Hotfix for common-ui (1st draft - needs editing):

  • So the process is that you create hotfix branches on both apps, make sure it works properly on both applications, then you publish the hotfix branch to npm
  • You have to merge the hotfix branch on common-ui after the hotfix is deployed and you have to update the marcura versions in the hot fix branches of both apps
  • Then you send a message in the global chat to everyone, telling them that they cannot deploy anything to cuat for plo and plc
  • Then, after publishing the hotfix branch of common-ui to npm, you have to deploy the hotfix branches of both apps to cuat
  • Then you ask Mayuri to test both applications, specify the feature that you made to her so she knows what to prioritse in her tests
  • After she approves both apps, then deploy both apps to production
  • Then merge all the hotfix branches into master for all the apps including common-ui
  • Publish common-ui again to npm from master this time
  • Then update the marcura versions on plo and plc, and then deploy both app to cuat on the master branch