1.0.15 • Published 1 year ago

cc-pac-dashboard v1.0.15

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

README

What is this repository for?

  • CC custom packages to be used for v2-v3 integration.

  • v2 is using the CDN version of the packages.

  • v3 is using the npm version that hosted on the npm registry.

How do I get set up?

  • v3 For v3 sites it only needs to be installed from npm, like any normal npm packages. After installation each package follow the instruction to set it up.

  • v2 On this sites, that can be any basic html page, use the CDN version of the package. that are available on cdn.jsdelivr.net

ex. Here we can use modularized version to reduce code loading or using the all-in-one as on

// all-in-one

\<script src="https://cdn.jsdelivr.net/npm/cc-pac-dashboard@1.0.10/dist/cc-pac-dashboard.min.js">\<\/script>

// modularized

\<script src="https://cdn.jsdelivr.net/npm/cc-pac-dashboard@1.0.10/dist/columnWithDataChart.min.js">\<\/script>

<div id="bardatachart" style="width: 500px; height: 400px;">chart</div>
<script src="https://cdn.jsdelivr.net/npm/cc-pac-dashboard@1.0.10/dist/columnWithDataChart.min.js"></script>
<script>
    try {
        let api = "https://google.com"
        ccPacDashboard.columnWithDataChart('bardatachart', api);
    } catch (error) {
        console.log(error);
    }
</script>

Note: Better to use latest version for the url so each project would have the latest version of each package when it is deployed.

  • usage in other apps
    • Install the page with npm
    • Import where it is needed
      import { basicBarChart } from 'cc-pac-dashboard';
    • and use the valid snippet for example this
          useEffect(() => {
                // Call lineChart function here
                let api = "http://api.co.com/3.0/settings/list";
                basicBarChart('bar-chart-wrapper', api);

            }, []);
            ...
            <div id='bar-chart-wrapper'></div>

Contribution guidelines

  • Developing In the phase of developing we can use our local version to debug and fully test the changes.
    • NPM
      • npm link By using the option you can test the package changes directly on your application. First you need to run npm link inside your package dir. Then in your application run npm link package-name@version. Then check for changes that must be synced.
    • CDN

Publish Package to NPM

  • After testing and verify changes, we can publish the package to the npm, so they would be available for every project. The cdn version used with @latest would load latest changes, but need to consider the cache system and optimize based on it. For the NPM packages also we need to use the @latest when installing them and after deployment need to update packages to the latest version, that can be done by npm update

  • Useful commands

    • npm run build
      • Need to be run before publish to have the updated dist for CDN
    • npm publish
      • To publish the latest version to NPM registry
  • versioning

    • Minor updates npm version patch
      • e.g., from 1.2.3 to 1.3.0
    • Major updates npm version major
      • e.g., from 1.2.3 to 2.0.0
    • Patch updates npm version minor
      • e.g., from 1.2.3 to 1.2.4
1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago