Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
1bc2c98
feat(core): initial commit
kuakman Mar 11, 2019
d450f76
feat(core): Added incremental dom dependency.
kuakman Mar 11, 2019
8bb0a2b
feat(core): updated package-lock.json
kuakman Mar 11, 2019
9d92537
feat(core): more progress on building pipeline
kuakman Mar 20, 2019
e0dbf5c
feat(core): progress on libraries build.
kuakman Mar 20, 2019
c2c8611
feat(core): Initial implementation of serve.
kuakman Mar 21, 2019
189d84a
feat(core): completed template compilation.
kuakman Mar 21, 2019
7832dcc
feat(core): progress on systemjs utility. refactored files and librar…
kuakman Mar 22, 2019
1a46e1f
feat(core): Fixed dependency paths to options.
kuakman Mar 22, 2019
b72d42a
feat(core): Progress on SystemJs read/write feature.
kuakman Mar 29, 2019
776c77b
feat(core): Refactored to work on synapse cli tool.
kuakman Mar 29, 2019
85775ac
Merge branch 'master' into dev
kuakman Mar 29, 2019
10a6812
feat(core): Fixed gitignore.
kuakman Mar 29, 2019
3bef4d8
feat(core): Progress refactoring code.
kuakman Mar 29, 2019
173208f
feat(core): updated readme.
kuakman Mar 29, 2019
33a9c75
feat(core): progress on setting up unit testing and integration testing.
kuakman Apr 3, 2019
8a67811
migration: initial migration to oclif.
Sep 8, 2019
b80bcc0
migration: Fixe babel 7 env for development. oclif commands load phas…
Sep 10, 2019
0e96309
migration: Clean up.
Sep 10, 2019
6808a16
migration: refactoring and building the skeleton.
Sep 10, 2019
821f813
migration: progress on commands generation and configuration. Bump up…
Feb 1, 2020
7a4fb04
Clean up dependecies. Setup npm test and dev environments. Add github…
Feb 2, 2020
27a087c
migration: attempt to fix github ci workflow.
Feb 2, 2020
3f0c305
migration: another attempt to fix github workflow ci.yml
Feb 2, 2020
07c5344
migration: Fixed yamls formatting for workflows. Added workflows badg…
Feb 2, 2020
b310dee
migration: Progress on SynapseCommand and ScaffoldCommand.
Feb 2, 2020
2eb50f7
migration: Added unit test coverage for common commands. Progress def…
Feb 19, 2020
58db741
migration: Added extend as dependency. Improve Command options inject…
Feb 20, 2020
922c110
Resolved merge conflicts
Mar 2, 2020
085f87a
migration: More Progress with decorators and collection adt utility.
Mar 10, 2020
e77960d
migration: progress on implementing utils.adt.Collection class. Under…
Mar 12, 2020
31eaab7
migration: more progress on the utils.adt.Collection class. Writing m…
Mar 14, 2020
3f96b33
Merge branch 'migration' of https://github.com/kuakman/synapse into m…
Mar 14, 2020
b6b4ac5
migration: Clean up. Started using utils.adt.Collection for command t…
Mar 16, 2020
a383b39
migration: progress on scaffold command and init command. Installed I…
Mar 16, 2020
ed6967c
migration: More Progress on Init Command.
Apr 2, 2020
8f8e5f4
migration: more progress with archetypes and commands.
Apr 4, 2020
69ce863
migration: More Progress.
Apr 10, 2020
8b85b80
migration: More Progress on ScaffoldCommand (remove inquirer in repla…
Apr 14, 2020
01b318a
migration: Completed custom Archetype multiple select (with group sup…
Apr 15, 2020
41aeedf
migration: update ci.yml
kuakman Apr 16, 2020
3e0a494
migration: update ci.yml
kuakman Apr 16, 2020
37a6d7c
migration: Fixed unit tests. Applied fix to ci.yml and deploy.yml. Up…
Apr 16, 2020
90350f0
migration: Improve progress and success messaging with color support.…
Apr 16, 2020
7b774d8
migration: more progress.
Apr 20, 2020
2e49d68
migration: More progress.
Apr 20, 2020
278040d
Merge branch 'migration' of github.com:kuakman/synapse into migration
Apr 20, 2020
2a5fe97
migration: Scaffold internal pipeline implementation.
Apr 21, 2020
b620266
migration: progress on archetype parsing for scaffolding.
Apr 28, 2020
dab8103
migration: more progress building core pieces for scaffolding. Fixed …
May 1, 2020
21806eb
migration: More progress and refactor. Unit Test will fail here.
May 3, 2020
5378d2f
migration: more progress refactoring. Unit tests still failing...
May 4, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"presets": [
["@babel/preset-env", {
"targets": { "node": true },
"modules": "commonjs"
}]
],
"plugins": [
["module-resolver", {
"alias": {
"commands": "./lib/commands",
"common": "./lib/common",
"meta": "./lib/meta",
"archetypes": "./lib/archetypes",
"utils": "./lib/utils"
}
}],
["@babel/plugin-proposal-class-properties"],
["@babel/plugin-transform-shorthand-properties"],
["@babel/plugin-syntax-decorators", { "decoratorsBeforeExport": true }],
["@babel/plugin-proposal-decorators", { "decoratorsBeforeExport": true }]
],
"env": {
"test": {
"plugins": ["istanbul"]
}
}
}
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore linting
node_modules
bin
coverage
52 changes: 52 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"env": {
"es6": true,
"mocha": true
},
"extends": [
"standard",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"globals": {
"assert": true,
"sinon": true,
"sandbox": true,
"wrap": true,
"register": true,
"initialize": true,
"expose": true,
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"plugins": [
"import",
"mocha",
"promise",
"chai-assert-bdd",
"@typescript-eslint"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"rules": {
"semi": ["error", "always"],
"indent": ["error", "tab"],
"no-tabs": ["error", { "allowIndentationTabs": true }],
"no-spaced-func": "off",
"space-before-function-paren": "off",
"no-trailing-spaces": ["error", { "skipBlankLines": true }],
"lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }],
"new-cap": ["error", { "newIsCap": false, "capIsNew": false }],
"one-var": [2, { "uninitialized": "always" }],
"no-use-before-define": ["error", { "variables": false, "functions": true, "classes": true }],
"@typescript-eslint/triple-slash-reference": ["error", { "path": "always", "types": "always", "lib": "never" }],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-empty-function": ["error", { "allow": ["functions", "arrowFunctions", "methods"] }],
"operator-linebreak": "off"
}
}
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI Branches

on:
push:
branches-ignore:
- 'master'

jobs:
test:
name: Unit Testing
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node 10.x
uses: actions/setup-node@v1
with:
node-version: '10.x'

- name: Unit Testing
run: |
npm install
npm run test-sr
33 changes: 33 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI Deployment

on:
pull_request:
types: [closed]
branches:
- master

jobs:
deploy:
name: Deployment
runs-on: ubuntu-latest
if: github.event.pull_request.merged

steps:
- name: Checkout
if: github.event.pull_request.merged
uses: actions/checkout@v2

- name: Use Node 10.x
uses: actions/setup-node@v1
with:
node-version: 10.x

- name: Unit Testing & Coverage
run: |
npm install
npm run coverage

- name: Coveralls Report
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
46 changes: 8 additions & 38 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Project

# Logs
logs
*.log
Expand All @@ -11,51 +13,19 @@ pids
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
.cache

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
# IDEs
.idea
_babel_resolver.js

# next.js build output
.next
# OS
.DS_Store
20 changes: 20 additions & 0 deletions .mocharc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use strict';
require('@babel/register')({ cache: false });

/**
* Mocha Configuration
*/
module.exports = {
require: [
'json5/lib/register',
'chai/register-assert',
'./test/globals'
],
ui: 'bdd',
diff: true,
extension: ['js', 'json5'],
'inline-diffs': true,
timeout: 2000,
reporter: 'spec',
'watch-files': ['lib/**/*.js', 'test/**/*.js']
};
154 changes: 154 additions & 0 deletions @types/core.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
/**
* Synapse Core Typings
* @author Patricio Ferreira <3dimentionar@gmail.com>
* @module synapse-core
*/
declare module 'synapse-core' {
// Imports
import EventEmitter from 'events';
import { StdioOptions } from 'child_process';
import { Collection } from 'synapse-utils';

/**
* @type DependenciesType
*/
export type DependenciesType = 'dependencies' | 'devDependencies' | 'peerDependencies';

/**
* @type ScriptType
*/
export type ScriptType =
'create' |

'start' |

'pre-config' |
'config' |
'post-config' |

'pre-clean' |
'clean' |
'post-clean' |

'pre-env' |

'pre-test' |
'test' |
'post-test' |

'pre-dev' |
'dev' |
'post-dev' |

'pre-prod' |
'prod' |
'post-prod' |

'post-env' |

'pre-serve' |
'serve' |
'post-serve' |

'pre-release' |
'release' |
'post-release' |

'end';

/**
* @type EnvironmentType
*/
export type EnvironmentType = 'all' | 'test' | 'dev' | 'prod';

/**
* @interface Core
* @extends EventEmitter
*/
export interface Core extends EventEmitter {
readonly defaults: Partial<Core>;

attachEvents(): Core;
execute(methodName: string, ...args: any[]): any;
parse(attributes?: Partial<Core>): Core;
serialize(instance: any, ...omit: string[]): Partial<Core>;
}

/**
* @interface Environment
* @extends Core
*/
export interface Environment extends Core {
readonly name: EnvironmentType | undefined;
readonly config: object | undefined;

parse(attributes?: Partial<Environment>): Environment;
parseName(attributes?: Partial<Environment>): Environment;
parseConfig(attributes?: Partial<Environment>, environment?: Environment): Environment;
}

/**
* @interface Script
* @extends Core
*/
export interface Script extends Core {
readonly name: ScriptType | undefined;
readonly queue: Collection<string>;
readonly stdio: StdioOptions;

isSupported(name: string): boolean;
parse(attributes?: Partial<Script>): Script;
parseName(attributes?: Partial<Script>): Script;
parseQueue(attributes?: Partial<Script>, script?: Script): Script;

run(): Promise<any>;
create(scriptPath: string): Promise<Promise<any>>;
execute(prevResponse: any, scriptPath: string, resolve: Function, reject: Function): Promise<void>;
}

/**
* @interface Synapse
* @extends Core
*/
export interface Synapse extends Core {
readonly source: string;
readonly target: string;
readonly scripts?: Collection<Script>;
readonly environments?: Collection<Environment>;

parse(attributes?: Partial<Synapse>): Synapse;
parseScripts(attributes?: Partial<Synapse>): Synapse;
parseEnvironments(attributes?: Partial<Synapse>): Synapse;
}

/**
* @interface Archetype
* @extends Core
*/
export interface Archetype extends Core {
readonly uri: string | undefined;
readonly type: string | undefined;
readonly name: string | undefined;
readonly defaults: Partial<Archetype>;
readonly extend: Collection<string>;
readonly synapse: Synapse;
readonly dependencies: Collection<DependenciesType>;
readonly devDependencies: Collection<DependenciesType>;
readonly peerDependencies: Collection<DependenciesType>;

resolveUri(): string;
load(): Promise<Archetype>;
parse(attributes?: Partial<Archetype>): Archetype;
parseExtend(attributes?: Partial<Archetype>): Archetype;
parseSynapse(attributes?: Partial<Archetype>): Archetype;
parseDependencies(attributes?: Partial<Archetype>): Archetype;
parseDevDependencies(attributes?: Partial<Archetype>): Archetype;
parsePeerDependencies(attributes?: Partial<Archetype>): Archetype;
toJSON(...omit: string[]): Partial<Archetype>;
}

/**
* @type Configuration
*/
export type Configuration = Pick<Archetype, 'synapse' | 'dependencies' | 'devDependencies' | 'peerDependencies'>;
}
Loading