mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-21 15:05:01 +00:00
Commit from GitHub Actions (Publish APIs & Clients)
This commit is contained in:
53
clients/ts/.gitignore
vendored
53
clients/ts/.gitignore
vendored
@@ -1 +1,54 @@
|
|||||||
|
node_modules
|
||||||
dist
|
dist
|
||||||
|
es
|
||||||
|
lib
|
||||||
|
types
|
||||||
|
tmp
|
||||||
|
index.js
|
||||||
|
index.d.ts
|
||||||
|
esmesm
|
||||||
|
index.js
|
||||||
|
index.d.ts
|
||||||
|
address
|
||||||
|
answer
|
||||||
|
cache
|
||||||
|
cmd
|
||||||
|
crypto
|
||||||
|
currency
|
||||||
|
db
|
||||||
|
email
|
||||||
|
emoji
|
||||||
|
evchargers
|
||||||
|
file
|
||||||
|
forex
|
||||||
|
function
|
||||||
|
geocoding
|
||||||
|
gifs
|
||||||
|
helloworld
|
||||||
|
holidays
|
||||||
|
id
|
||||||
|
image
|
||||||
|
ip
|
||||||
|
location
|
||||||
|
notes
|
||||||
|
otp
|
||||||
|
pkg
|
||||||
|
postcode
|
||||||
|
prayer
|
||||||
|
qr
|
||||||
|
quran
|
||||||
|
routing
|
||||||
|
rss
|
||||||
|
sentiment
|
||||||
|
sms
|
||||||
|
stock
|
||||||
|
stream
|
||||||
|
sunnah
|
||||||
|
test
|
||||||
|
thumbnail
|
||||||
|
time
|
||||||
|
twitter
|
||||||
|
url
|
||||||
|
user
|
||||||
|
vehicle
|
||||||
|
weather
|
||||||
|
|||||||
91
clients/ts/build.js
Normal file
91
clients/ts/build.js
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
const chalk = require('chalk');
|
||||||
|
const path = require('path');
|
||||||
|
const fs = require('fs');
|
||||||
|
const rimraf = require('rimraf');
|
||||||
|
const { ncp } = require('ncp');
|
||||||
|
|
||||||
|
function getTmpEsmDirectories() {
|
||||||
|
return fs
|
||||||
|
.readdirSync('./tmp/esm')
|
||||||
|
.filter(file => fs.statSync(`./tmp/esm/${file}`).isDirectory());
|
||||||
|
}
|
||||||
|
|
||||||
|
function log(text) {
|
||||||
|
console.log(`${chalk.cyan('M3O JS:')} ${text}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeModulePackageJsonFile(location) {
|
||||||
|
fs.writeFileSync(
|
||||||
|
`${location}/package.json`,
|
||||||
|
`{"module": "./esm/index.js"}`,
|
||||||
|
'utf8'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function deleteDirectory(directory) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
rimraf(directory, err => {
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function copyAllTmpFolders() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
// Now copy to root level
|
||||||
|
ncp(path.join(__dirname, 'tmp'), __dirname, err => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
} else {
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function moveToLocalEsmFolders() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const esmDirs = getTmpEsmDirectories();
|
||||||
|
|
||||||
|
// Move the files around in tmp...
|
||||||
|
esmDirs.forEach(dir => {
|
||||||
|
const currentPath = path.join(__dirname, 'tmp/esm', dir);
|
||||||
|
|
||||||
|
fs.readdirSync(currentPath).forEach(async file => {
|
||||||
|
const currentFilePath = path.join(currentPath, file);
|
||||||
|
const newFilePath = path.join(__dirname, 'tmp', dir, 'esm', file);
|
||||||
|
const esmFolderLocation = path.join(__dirname, 'tmp', dir, 'esm');
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (!fs.existsSync(esmFolderLocation)) {
|
||||||
|
fs.mkdirSync(esmFolderLocation);
|
||||||
|
}
|
||||||
|
|
||||||
|
fs.renameSync(currentFilePath, newFilePath);
|
||||||
|
writeModulePackageJsonFile(`./tmp/${dir}`);
|
||||||
|
await deleteDirectory(`./tmp/esm/${dir}`);
|
||||||
|
} catch (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
log('Moved local esm folders');
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function build() {
|
||||||
|
log('Moving to correct folders');
|
||||||
|
|
||||||
|
try {
|
||||||
|
await moveToLocalEsmFolders();
|
||||||
|
await copyAllTmpFolders();
|
||||||
|
writeModulePackageJsonFile('./tmp/esm');
|
||||||
|
await deleteDirectory('./tmp');
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
build();
|
||||||
6482
clients/ts/package-lock.json
generated
6482
clients/ts/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,70 +1,78 @@
|
|||||||
{
|
{
|
||||||
"author": "",
|
"author": "",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@m3o/m3o-node": "^0.0.24"
|
"@m3o/m3o-node": "^0.0.24",
|
||||||
|
"@types/estree": "^0.0.47",
|
||||||
|
"chalk": "^2.4.2",
|
||||||
|
"move-file": "^3.0.0",
|
||||||
|
"ncp": "^2.0.0",
|
||||||
|
"rimraf": "^3.0.2"
|
||||||
},
|
},
|
||||||
"description": "",
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"prettier": "^2.4.1",
|
||||||
"typescript": "^3.5.1"
|
"typescript": "^3.5.1"
|
||||||
},
|
},
|
||||||
"exports": {
|
"files": [
|
||||||
"./address": "./dist/address/index.js",
|
"esm",
|
||||||
"./answer": "./dist/answer/index.js",
|
"index.js",
|
||||||
"./cache": "./dist/cache/index.js",
|
"index.d.ts",
|
||||||
"./cmd": "./dist/cmd/index.js",
|
"address",
|
||||||
"./crypto": "./dist/crypto/index.js",
|
"answer",
|
||||||
"./currency": "./dist/currency/index.js",
|
"cache",
|
||||||
"./db": "./dist/db/index.js",
|
"cmd",
|
||||||
"./email": "./dist/email/index.js",
|
"crypto",
|
||||||
"./emoji": "./dist/emoji/index.js",
|
"currency",
|
||||||
"./evchargers": "./dist/evchargers/index.js",
|
"db",
|
||||||
"./file": "./dist/file/index.js",
|
"email",
|
||||||
"./forex": "./dist/forex/index.js",
|
"emoji",
|
||||||
"./function": "./dist/function/index.js",
|
"evchargers",
|
||||||
"./geocoding": "./dist/geocoding/index.js",
|
"file",
|
||||||
"./gifs": "./dist/gifs/index.js",
|
"forex",
|
||||||
"./helloworld": "./dist/helloworld/index.js",
|
"function",
|
||||||
"./holidays": "./dist/holidays/index.js",
|
"geocoding",
|
||||||
"./id": "./dist/id/index.js",
|
"gifs",
|
||||||
"./image": "./dist/image/index.js",
|
"helloworld",
|
||||||
"./ip": "./dist/ip/index.js",
|
"holidays",
|
||||||
"./location": "./dist/location/index.js",
|
"id",
|
||||||
"./notes": "./dist/notes/index.js",
|
"image",
|
||||||
"./otp": "./dist/otp/index.js",
|
"ip",
|
||||||
"./pkg": "./dist/pkg/index.js",
|
"location",
|
||||||
"./postcode": "./dist/postcode/index.js",
|
"notes",
|
||||||
"./prayer": "./dist/prayer/index.js",
|
"otp",
|
||||||
"./qr": "./dist/qr/index.js",
|
"pkg",
|
||||||
"./quran": "./dist/quran/index.js",
|
"postcode",
|
||||||
"./routing": "./dist/routing/index.js",
|
"prayer",
|
||||||
"./rss": "./dist/rss/index.js",
|
"qr",
|
||||||
"./sentiment": "./dist/sentiment/index.js",
|
"quran",
|
||||||
"./sms": "./dist/sms/index.js",
|
"routing",
|
||||||
"./stock": "./dist/stock/index.js",
|
"rss",
|
||||||
"./stream": "./dist/stream/index.js",
|
"sentiment",
|
||||||
"./sunnah": "./dist/sunnah/index.js",
|
"sms",
|
||||||
"./test": "./dist/test/index.js",
|
"stock",
|
||||||
"./thumbnail": "./dist/thumbnail/index.js",
|
"stream",
|
||||||
"./time": "./dist/time/index.js",
|
"sunnah",
|
||||||
"./twitter": "./dist/twitter/index.js",
|
"test",
|
||||||
"./url": "./dist/url/index.js",
|
"thumbnail",
|
||||||
"./user": "./dist/user/index.js",
|
"time",
|
||||||
"./vehicle": "./dist/vehicle/index.js",
|
"twitter",
|
||||||
"./weather": "./dist/weather/index.js"
|
"url",
|
||||||
},
|
"user",
|
||||||
|
"vehicle",
|
||||||
|
"weather"
|
||||||
|
],
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"main": "dist",
|
"main": "index.js",
|
||||||
"name": "m3o",
|
"module": "esm/index.js",
|
||||||
|
"name": "@micro/services",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/micro/services"
|
"url": "https://github.com/micro/services"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"build": "npm run clean \u0026\u0026 tsc \u0026\u0026 tsc --p tsconfig.es.json \u0026\u0026 node build.js",
|
||||||
"prepare": "npm run build",
|
"clean": "rimraf ./tmp",
|
||||||
"test": "echo \"Error: no test specified\" \u0026\u0026 exit 1"
|
"prepare": "npm run build"
|
||||||
},
|
},
|
||||||
"type": "module",
|
"types": "index.d.ts",
|
||||||
"types": "dist/index.d.ts",
|
"version": "1.0.556"
|
||||||
"version": "1.0.554"
|
|
||||||
}
|
}
|
||||||
16
clients/ts/tsconfig.es.json
Normal file
16
clients/ts/tsconfig.es.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"module": "ES2015",
|
||||||
|
"target": "ES6",
|
||||||
|
"declaration": true,
|
||||||
|
"lib": ["es2015", "dom"],
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"emitDecoratorMetadata": true,
|
||||||
|
"outDir": "./tmp/esm",
|
||||||
|
"strict": true,
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"esModuleInterop": true
|
||||||
|
},
|
||||||
|
"include": ["src/index.ts", "src/**/*"],
|
||||||
|
"exclude": ["./dist", "./node_modules"]
|
||||||
|
}
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "es6",
|
"module": "CommonJS",
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"lib": ["es2015", "dom"],
|
"lib": ["es2015", "dom"],
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"outDir": "./dist",
|
"outDir": "./tmp",
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"esModuleInterop": true
|
"esModuleInterop": true
|
||||||
},
|
},
|
||||||
"include": ["index.ts", "./*"],
|
"include": ["src/index.ts", "src/**/*"],
|
||||||
"exclude": ["src/**/*.spec.*", "./dist", "./node_modules"]
|
"exclude": ["./dist", "./node_modules"]
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user