Publishable version of configs completed

This commit is contained in:
2024-09-18 16:30:58 +05:30
parent fbd22cf4da
commit adbb06b34b
12 changed files with 158 additions and 147 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -1,30 +0,0 @@
import { ApiConfig } from "@armco/types"
const API_CONFIG: ApiConfig = {
HOST: {
development: "http://localhost:5000/api",
production: "https://api.armco.tech",
},
STATIC_HOST: {
development: "http://localhost:5001/api",
production: "https://static.armco.tech",
},
TASKER: {
development: "http://localhost:5002/api",
production: "https://tasks.armco.tech",
},
CONFIG: {
development: "http://localhost:5003/api",
production: "https://config.armco.tech",
},
IAM: {
development: "http://localhost:5004/api",
production: "https://iam.armco.tech",
},
SEER: {
development: "http://localhost:5005/api",
production: "https://telemetry.armco.tech",
},
}
export default API_CONFIG

View File

@@ -1,4 +0,0 @@
export * from "./api-config"
export * from "./web-config"
export * from "./constants"
export * from "./navigator"

View File

@@ -1,12 +1,18 @@
{
"name": "@armco/configs",
"private": true,
"version": "0.0.0",
"version": "0.0.2",
"type": "module",
"main": "build/cjs/index.js",
"module": "build/es/index.js",
"types": "build/types/index.d.ts",
"scripts": {
"build": "tsc",
"build": "rm -rf build && tsc && vite build",
"format": "prettier --write .",
"lint": "eslint ."
"lint": "eslint .",
"publish:sh": "./publish.sh"
},
"dependencies": {
"@armco/types": "^0.0.8"
},
"devDependencies": {
"typescript": "^5.0.2"
@@ -20,7 +26,6 @@
}
},
"prettier": "prettier-config-nick",
"main": "build/index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/ReStruct-Corporate-Advantage/configs.git"
@@ -31,6 +36,9 @@
"building-blocks",
"foundation"
],
"files": [
"build"
],
"license": "ISC",
"bugs": {
"url": "https://github.com/ReStruct-Corporate-Advantage/configs/issues"

8
publish.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
semver=${1:-patch}
npm run build
set -e
npm --no-git-tag-version version ${semver}
npm publish --access public --loglevel verbose

View File

@@ -1,75 +1,4 @@
import moment from "moment"
import { ArWebPageLayout, ObjectType } from "@armco/types"
import API_CONFIG from "./api-config"
export const ICON_ROOT = `${
API_CONFIG.STATIC_HOST[process.env.NODE_ENV as "production" | "development"]
}/icon`
export const DEFAULT_LOCALE = {
direction: "ltr",
format: moment.localeData().longDateFormat("L"),
separator: " - ",
applyLabel: "Apply",
cancelLabel: "Cancel",
weekLabel: "W",
customRangeLabel: "Custom Range",
daysOfWeek: moment.weekdaysMin(),
monthNames: moment.monthsShort(),
firstDay: moment.localeData().firstDayOfWeek(),
}
export const ENDPOINTS = {
STATIC: {
ICON: {
ROOT: "/icon",
PAGE: "/page",
},
LOTTIE: {
ROOT: "/lottie",
TOMP4: "/to-mp4",
TOGIF: "/to-gif",
TOPNG: "/to-png",
TOSVG: "/to-svg",
},
FONT: {
ROOT: "/font",
PAGE: "/page",
},
},
USERS: {
ROOT: "/secure/users",
ADD: "/add",
UPDATE: "/update",
CHECK: "/check",
},
AUTH: {
ROOT: "/auth",
LOGIN: "/login",
FORGOT: "/forgot",
SIGNUP: "/register",
LOGOUT: "/logout",
},
NAMESPACE: {
ROOT: "/secure/namespace",
CREATE: "/",
FETCHALL: "/",
FETCH: "/",
},
CONFIG: {
ROOT: "/secure/config",
SAVE: "/",
DELETE: "/delete",
},
TASKER: {
ROOT: "/secure/jobs",
SAVE: "/",
DELETE: "/delete",
RUN: "/run",
FETCHALL: "/",
FETCH: "/",
},
}
export const MONTH_INDEX = [
"January",

99
src/endpoints.ts Normal file
View File

@@ -0,0 +1,99 @@
import { ApiConfig, WebConfig } from "@armco/types"
export const API_CONFIG: ApiConfig = {
HOST: {
development: "http://localhost:5000/api",
production: "https://api.armco.tech",
},
STATIC_HOST: {
development: "http://localhost:5001/api",
production: "https://static.armco.tech",
},
TASKER: {
development: "http://localhost:5002/api",
production: "https://tasks.armco.tech",
},
CONFIG: {
development: "http://localhost:5003/api",
production: "https://config.armco.tech",
},
IAM: {
development: "http://localhost:5004/api",
production: "https://iam.armco.tech",
},
SEER: {
development: "http://localhost:5005/api",
production: "https://telemetry.armco.tech",
},
}
export const ICON_ROOT = `${
API_CONFIG.STATIC_HOST[process.env.NODE_ENV as "production" | "development"]
}/icon`
export const WEB_CONFIG: WebConfig = {
ARMORY: {
development: "http://localhost:7992",
production: "https://armco.tech",
},
IAM: {
development: "http://localhost:3001",
production: "https://iam.notabuck.com",
},
FORESEER: {
development: "http://localhost:3002",
production: "https://seer.notabuck.com",
},
}
export const ENDPOINTS = {
STATIC: {
ICON: {
ROOT: "/icon",
PAGE: "/page",
},
LOTTIE: {
ROOT: "/lottie",
TOMP4: "/to-mp4",
TOGIF: "/to-gif",
TOPNG: "/to-png",
TOSVG: "/to-svg",
},
FONT: {
ROOT: "/font",
PAGE: "/page",
},
},
USERS: {
ROOT: "/secure/users",
ADD: "/add",
UPDATE: "/update",
CHECK: "/check",
},
AUTH: {
ROOT: "/auth",
LOGIN: "/login",
FORGOT: "/forgot",
SIGNUP: "/register",
LOGOUT: "/logout",
},
NAMESPACE: {
ROOT: "/secure/namespace",
CREATE: "/",
FETCHALL: "/",
FETCH: "/",
},
CONFIG: {
ROOT: "/secure/config",
SAVE: "/",
DELETE: "/delete",
},
TASKER: {
ROOT: "/secure/jobs",
SAVE: "/",
DELETE: "/delete",
RUN: "/run",
FETCHALL: "/",
FETCH: "/",
},
}

3
src/index.ts Normal file
View File

@@ -0,0 +1,3 @@
export * from "./endpoints"
export * from "./constants"
export { default as NAVIGATOR } from "./navigator"

View File

@@ -1,21 +1,4 @@
{
"compilerOptions": {
"skipLibCheck": true,
"esModuleInterop": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"outDir": "build",
"resolveJsonModule": true,
"isolatedModules": true,
"declaration": true,
"noEmit": false,
"lib": [
"dom",
"esnext"
],
"target": "es5",
},
"exclude": ["build"]
"extends": "../../tsconfig.json",
"include": ["src"],
}

33
vite.config.ts Normal file
View File

@@ -0,0 +1,33 @@
import { resolve } from "node:path"
import glob from "glob"
import { defineConfig } from "vitest/config"
import react from "@vitejs/plugin-react"
import dts from "vite-plugin-dts"
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), dts({ outDir: "build/types" })],
build: {
outDir: "build",
lib: {
entry: glob.sync(resolve(__dirname, "src/**/*.ts")),
name: "@armco/configs",
formats: ["es", "cjs"],
},
rollupOptions: {
treeshake: true,
output: [
{
format: "es",
dir: "build/es",
entryFileNames: "[name].js",
},
{
format: "cjs",
dir: "build/cjs",
entryFileNames: "[name].js",
},
],
},
},
})

View File

@@ -1,18 +0,0 @@
import { WebConfig } from "@armco/types"
const WEB_CONFIG: WebConfig = {
ARMORY: {
development: "http://localhost:7992",
production: "https://armco.tech",
},
IAM: {
development: "http://localhost:3001",
production: "https://iam.notabuck.com",
},
FORESEER: {
development: "http://localhost:3002",
production: "https://seer.notabuck.com",
},
}
export default WEB_CONFIG