Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up #2

Merged
merged 4 commits into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 4 additions & 16 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
# This CODEOWNERS file follows the format of Github's CODEOWNERS
# Documentation for reference, https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
# Application Engineering CODEOWNERS

# This is a comment.
# Each line is a file pattern followed by one or more owners.
* @naveedkhan8067

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.

* @testUser3067

/.github/ @testUser3067 @naveedkhan8067
/components/ @testUser3067



/.github/ @naveedkhan8067
/src/ @naveedkhan8067
50 changes: 50 additions & 0 deletions .github/workflows/Build-And-Test-Variant.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "Build-And-Test-Variant"

on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
app-advance-variant-windows:
name: "Advance Variant (Windows)"
runs-on: windows-latest
steps:
- name: 📚 Checkout
uses: actions/[email protected]

- name: 🟢 Install Node
uses: actions/setup-node@v4
with:
always-auth: true
node-version: 18
scope: '@naveed235812'
registry-url: https://registry.npmjs.org

- name: Install Dependencies
run: npm install

- name: Build Advance Variant
run: npm run build

- name: Execute Tests
run: npm run test

# # This step was added to show the output
# - name: Execute Variant (Demo Purposes)
# run: node ./lib/index.js

- name: Package Advance Variant
run: npm pack
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}

- name: Publish Advance Variant
uses: actions/upload-artifact@v3
with:
name: app-advance-windows
path: ./AppAdvance-Windows*.tgz
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Advance Variant
It is the advance variant of test application engineering project.

19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"name": "@naveed235812/VarientBasic",
"name": "@naveed235812/AppAdvance-Windows",
"version": "1.1.0",
"description": "Basic varient of product",
"description": "Advance variant of test product for windows.",
"main": "index.js",
"bin": {
"hello-world": "./lib/index.js"
},
"author": "Naveed Ahmad",
"license": "ISC",
"license": "",
"repository": {
"type": "git",
"url": "https://github.com/naveedkhan8067/Varient_Basic"
"url": "https://github.com/naveedkhan8067/Advance_Variant"
},
"scripts": {
"clean": "rimraf lib",
"copy:assets": "cpx ./src/index.js ./lib",
"build": "tsc 1>&2 && npm run copy:assets",
"test": "echo \"Error: no test specified\" && exit 1"
"copy:indexFile": "cpx ./src/index.js ./lib",
"build": "tsc 1>&2 && npm run copy:indexFile",
"test": "mocha -r ts-node/register src/test/**.test.ts --timeout 5000"
},
"dependencies": {
"c-preprocessor": "^0.2.13",
"chalk": "^2.4.1",
"commander": "^2.19.0",
"readdirp": "^3.0.0",
"@naveed235812/hello-world-windows": "1.0.0"
"@naveed235812/hello-world-windows": "1.0.6"
},
"devDependencies": {
"@types/node": "18.11.5",
Expand All @@ -34,7 +34,6 @@
"typescript": "~4.3.0",
"chai": "^4.2.0",
"mocha": "^10.0.0",
"nyc": "^15.1.0",
"eslint": "^7.11.0"
"ts-node": "^10.8.2"
}
}
24 changes: 16 additions & 8 deletions src/Main.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import * as fs from "fs";
import * as path from "path";
import * as chalk from "chalk";
import { Main } from "@naveed235812/hello-world-windows/lib/Main";
import { CreateMsgString } from "@naveed235812/hello-world-windows/lib/Main";

export function AdvanceVariantPrint(subStr: string) {
console.log("Display Msg: " + subStr);
Main("Hello-World Component");
}
/*
Creates final message string
*/
export function PrepareMsgString(appMsgString: string): string {
const domainComponentMsg = CreateMsgString();
return appMsgString + " --> " + domainComponentMsg;
}

/*
Display message string
*/
export function AdvanceVariantPrint(message: string): void {
const msgString = PrepareMsgString(message);
console.log(msgString);
}
33 changes: 12 additions & 21 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
const fs = require("fs");
const path = require("path");
const chalk=require("chalk");
const rimraf = require("rimraf");
const commander = require("commander");
const AdvanceVariantPrint = require("./Main").AdvanceVariantPrint;

const program = new commander.Command("Hello World NPM CLI");
program.option("--displayMsg");
program.option("-g, --green", "Display the message in Green.");
program.option("-r, --red", "Display the message in Red.");

program.parse(process.argv);

if (program.green) {
console.log(chalk.green("Message was configured to show in green color."));
const displayMessage = require("./Main").AdvanceVariantPrint;

/*
Main function
*/
function main() {
var appAdvanceMsg = "Advance Variant";
displayMessage(appAdvanceMsg);
}

if (program.red) {
console.log(chalk.red("Message was configured to show in red color."));
}
/*
Calling Main
*/
main();

var str = "Advance Variant";
AdvanceVariantPrint(str);
10 changes: 10 additions & 0 deletions src/test/Main.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { expect } from "chai";
import { PrepareMsgString, AdvanceVariantPrint } from "../Main";

describe("Advance Variant Tests", async () => {
it("verify message string", async () => {
const msgString = PrepareMsgString("Advance Variant");
expect(msgString).to.equal("Advance Variant --> *** Windows platform --> Hello-World ***");
AdvanceVariantPrint("Advance Variant");
});
});
Loading