Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

atma

Package Overview
Dependencies
Maintainers
1
Versions
199
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

atma

Atma.Toolkit

  • 0.9.60
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Atma.js Toolkit

> npm install atma -g
# ...
> atma --help
> atma [action] [arg] [...] -KEY VALUE [...]
> atma [*.json | *.js | *.yml]
# Load Config and process
#   .config - JSON
#   .js - javascript should set config object to globals

Config

Configuration object consists from any number of actions you want to run.

// Single action
global.config = ActionObject;

// Multiple actions
global.config = [ActionObject, ActionObject, /*..*/];

// Grouped actions
global.config = {
    groupName: ActionObject, // [ActionObject]
    otherGroup: ActionObject, // [ActionObject]
    //? defaults: ['groupName']
}

/* normally, if you run "atma config.js" then all grouped actions will be started,
   but if 'defaults' property is used, then only that groups will be activated.
   Also you can run any group with: 'atma config.js groupName'
*/

ActionObject

{
    action: 'NAME',
    // ... action settings
}

If ActionObject is in a group, and that groupname has the name of existed action, then you can ommit 'action' property

global.config = {
    copy: {
        // action: 'copy' - is not required
		files: {
			'filePath': 'destinationPath',
            // ...
		}
    }
}

Actions

build

It is actually the purpose this tool was created for - it combines all resources included with IncludeJS in your app to a single one-page app

{
    "action": "build"
    "file": "index.dev.html" // — {String} - HTML input file
    "minify": true, // — {Boolean} — run MinifyJS and clean-css
    "uglify": {} // — {Object:optional} - UglifyJS compressor settings. @default {global_defs: {DEBUG: false}}
    "jshint" : {
        "options" : // —  {Object} - JSHINT options
        "globals" : // —  {Object} - global variables. @default {"window": false, "document": false}
        "ignore"  : // —  {Object} - file names to ignore
    }
    "outputMain": "index.html" — output name of a built html"
    "outputSources": "build/" — directory of combined/copied resources"
}
project-import
{
    action: "project-import"
}

Copy resources, that are used by current project, from referenced directories in .reference/* to .import directory

project-reference
{
    action: "project-reference"
}

Switch back from "project-import" to resource referencing

shell
{
    action: "shell",

    /* Commands: Array or String */
    command:  [
        "cmd /C copy /B index.html c:/app",
        "cmd /C copy /B index.build/ c:/app/index.build",
        // ... other commands
    ]

}

Execuate shell commands

Custom Scripts - (bash scripts)
{
    action: "custom",
    script: "scriptPath.js"
}

Run any javascript

> atma custom scriptPath

Custom script should export process(config, done){} function

// scriptPath.js

include.exports = {
    process: function(config, done){
        // config is current ActionObject - it can contain additional information
        // for a script

        // do smth. and call done if ready
        done(/* ?error */);
    }
}

@IMPORTANT

/*
    Any require(module) could also be resolved from global npm directory

    Example, you have installed jQuery globally - > npm install jquery -g
    and you can use it from the script as if it was installed in a directory, where
    scriptPath.js is located.

    var jquery = require('jquery');
    This is perfect for a cli scripting.

    Also you can use IncludeJS API here - as io.File:

    var content = new io.File('someTxt').read();

    new io.Directory().readFiles('*.txt).files.forEach(function(file){
        var txt = file.read() + '...';

        new io.File('path').write(txt);
    });
*/

Server

{
    action: 'server',
    port: 5777, // default 5777
    open: 'index.dev.html' // auto open file in browser
}

Start integrated server in a current working directory.

To start the server direct from command line, use cli action pattern

atma [action] -KEY VALUE

> atma server -port 5500
{
    "action": "reference"
    "path": directory path || name of a project from globals.txt
    "name": reference name /* optional @default directory name*/
}
> atma reference atmajs

Creates symbolic link in "%current directory%/.reference" folder

Template - Scaffolding

{
    action: "template",
    name: "name"
}
> atma template [name]

Templates:

  • starter - MaskJS/mask.bindings/jmask/mask.compo/IncludeJS/Ruqq/jQuery
  • compo - creates component template .js/.css/*.mask : ```> atma template compo desiredName"
  • server - create node.js bootstrap project
  • todoapp - creates todomvc sample application

You can create any other templates - just put the files to: %npm-global-directory%/node_modules/includejs/template/%YourTemplateName%

Clone Atma Libraries

> atma git-clone atma

Global Projects and default routes:

> atma globals

Sample:

{
	"projects":{
		"atma" : {
			"path": "file:///c:/Development/atmajs/"
		}
	},
	"defaultRoutes":{
		"atma_lib": 		"{atma}/{0}/lib/{1}.js",
        "atma_ruqq": 		"{atma}/ruqq/lib/{0}.js",
		"atma_compo": 		"{atma}/compos/{0}/lib/{1}.js"
	}
}

FAQs

Package last updated on 14 Nov 2013

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