Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Commit

Permalink
Merge 849e62d into 2417929
Browse files Browse the repository at this point in the history
  • Loading branch information
robertrossmann committed Dec 4, 2018
2 parents 2417929 + 849e62d commit 3685304
Show file tree
Hide file tree
Showing 39 changed files with 1,160 additions and 27 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,3 @@ nbproject
*.sublime-*
*.atom-*
.tern-*
jsconfig.json
18 changes: 18 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"compilerOptions": {
"charset": "utf8",
"module": "commonjs",
"moduleResolution": "node",
"target": "esnext",
"noEmit": true,
"checkJs": false,
"noImplicitAny": true
},
"exclude": [
"node_modules",
"**/node_modules/*"
],
"typeAcquisition": {
"enable": true
}
}
25 changes: 25 additions & 0 deletions packages/action/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
declare module '@atlas.js/action' {
import Component from '@atlas.js/component'

/**
* Use this class to implement custom high-level "actions" or "operations" in your code
*
* An action could be thought of as a controller of sorts in the MVC architecture. The general
* idea of actions is that each class represents a group of releated operations which yield a
* specific end result. They should be callable from anywhere and should not be tied to a
* particular interface (ie. an HTTP server or a REPL session) - in other words, the idea is to
* make them as reusable as possible.
*
* Actions can be completely standalone or they might call other, lower-level actions or interact
* with services to manipulate external resources. Generally actions are called from some kind of
* externally available entry point, like an HTTP interface, a REPL session, a custom socket etc.
*
* Actions are intended to encapsulate "business-specific" or re-usable code/behaviour.
*
* @abstract
*/
export default abstract class Action extends Component {
/** @private */
static type: 'action'
}
}
17 changes: 17 additions & 0 deletions packages/action/src/index.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
import Component from '@atlas.js/component'

/**
* Use this class to implement custom high-level "actions" or "operations" in your code
*
* An action could be thought of as a controller of sorts in the MVC architecture. The general
* idea of actions is that each class represents a group of releated operations which yield a
* specific end result. They should be callable from anywhere and should not be tied to a
* particular interface (ie. an HTTP server or a REPL session) - in other words, the idea is to
* make them as reusable as possible.
*
* Actions can be completely standalone or they might call other, lower-level actions or interact
* with services to manipulate external resources. Generally actions are called from some kind of
* externally available entry point, like an HTTP interface, a REPL session, a custom socket etc.
*
* Actions are intended to encapsulate "business-specific" or re-usable code/behaviour.
*
* @abstract
*/
class Action extends Component {
static type = 'action'
}
Expand Down
19 changes: 19 additions & 0 deletions packages/atlas/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/atlas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"@atlas.js/errors": "^0.2.1",
"@atlas.js/hook": "^2.0.1",
"@atlas.js/service": "^1.1.1",
"@types/pino": "^4.7.0",
"ajv": "^6.5.0",
"ajv-keywords": "^3.2.0",
"lodash": "^4.17.4",
Expand Down
10 changes: 5 additions & 5 deletions packages/atlas/src/atlas.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class Atlas {
* providing greater flexibility as to which components will be used.
*
* @param {Atlas} atlas The Atlas instance to bootstrap
* @param {Object} modules={} All the modules which should be added to Atlas
* @param {Object} modules? All the modules which should be added to Atlas
* @param {Object} modules.actions Actions to add
* @param {Object} modules.hooks Hooks to add
* @param {Object} modules.services Services to add
Expand Down Expand Up @@ -290,7 +290,7 @@ class Atlas {
* Require a module by path, relative to the project root
*
* @param {String} location The module's location, relative to root
* @param {Object} options={} Options
* @param {Object} options? Options
* @param {Boolean} options.optional If true, will not throw if the module does not exist
* @param {Boolean} options.normalise If true, it will prefer the ES modules' default export
* over named exports or the CommonJS exports
Expand All @@ -315,7 +315,7 @@ class Atlas {
}

/**
* Register a service into this atlas at given alias
* Register a service into this instance of Atlas with the given alias
*
* @param {String} alias The alias for the service - it will be used for exposing
* the service's API on the atlas.services object and for
Expand All @@ -337,7 +337,7 @@ class Atlas {
}

/**
* Register a hook into this atlas using given alias
* Register a hook into this instance of Atlas with the given alias
*
* @param {String} alias The alias for the hook - it will be used for passing
* configuration data to it
Expand All @@ -358,7 +358,7 @@ class Atlas {
}

/**
* Register an action into this atlas at given alias
* Register an action into this instance of Atlas with the given alias
*
* @param {String} alias The alias for the action - it will be used for exposing
* the action's API on the atlas.actions object and for
Expand Down
Loading

0 comments on commit 3685304

Please sign in to comment.