Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminDobler committed May 16, 2019
1 parent 168fbe3 commit 3253886
Show file tree
Hide file tree
Showing 21 changed files with 7,375 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
51 changes: 51 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# See http:https://help.github.com/ignore-files/ for more about ignoring files.

# Outputs
src/**/*.js
src/**/*.js.map
src/**/*.d.ts

# compiled output
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out

# dependencies
/node_modules

# profiling files
chrome-profiler-events.json
speed-measure-plugin.json

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignores TypeScript files, but keeps definitions.
*.ts
!schematics/ng-add/files/electron.ts
!*.d.ts
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2019 Benjamin Dobler

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5 changes: 5 additions & 0 deletions builders/build/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { BuilderContext, BuilderOutput } from "@angular-devkit/architect";
import { Observable } from "rxjs";
export declare const execute: (options: any, context: BuilderContext) => Observable<BuilderOutput>;
declare const _default: import("@angular-devkit/architect/src/internal").Builder<any>;
export default _default;
31 changes: 31 additions & 0 deletions builders/build/index.js

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

1 change: 1 addition & 0 deletions builders/build/index.js.map

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

58 changes: 58 additions & 0 deletions builders/build/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import {DevServerBuilderOptions, DevServerBuilderOutput} from "@angular-devkit/build-angular";
import {BuilderContext, BuilderOutput, createBuilder, targetFromTargetString} from "@angular-devkit/architect";
import {from, Observable} from "rxjs";
import {workspaces} from '@angular-devkit/core';
import {NodeJsSyncHost} from "@angular-devkit/core/node";
import {runWebpack} from '@angular-devkit/build-webpack';
import {Configuration} from "webpack";


export const execute = (options: any, context: BuilderContext): Observable<BuilderOutput> => {
let serverOptions;
let buildElectronOptions;

const setup = async (): Promise<BuilderOutput> => {
return new Promise(async (resolve, reject) => {

const workspaceHost = workspaces.createWorkspaceHost(new NodeJsSyncHost());
const {workspace} = await workspaces.readWorkspace(
context.workspaceRoot,
workspaceHost
);

console.log("Workspace");
const project: workspaces.ProjectDefinition = workspace.projects.get(context.target.project);

console.log(workspace.projects.get(context.target.project).sourceRoot);


resolve({success: true});
});


const webpackConfig: Configuration = {
entry: options.main,
mode: 'development',
target: 'node',
output: {
path: options.outputPath,
filename: 'main.js'
},
resolve: {
extensions: ['.ts', '.js'],
}
};


runWebpack(webpackConfig, context)


}

console.log("Node Builder");

return from(setup())

}

export default createBuilder<any, DevServerBuilderOutput>(execute);
10 changes: 10 additions & 0 deletions builders/build/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "http:https://json-schema.org/schema",
"title": "Dev Server Target",
"description": "Dev Server target options for Build Facade.",
"type": "object",
"properties": {

},
"additionalProperties": false
}
9 changes: 9 additions & 0 deletions builders/builders.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"builders": {
"build": {
"implementation": "./build",
"schema": "./build/schema.json",
"description": "build a node application"
}
}
}
Binary file added ngtron.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 3253886

Please sign in to comment.