mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-11 19:04:35 +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
|
||||
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": "",
|
||||
"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": {
|
||||
"prettier": "^2.4.1",
|
||||
"typescript": "^3.5.1"
|
||||
},
|
||||
"exports": {
|
||||
"./address": "./dist/address/index.js",
|
||||
"./answer": "./dist/answer/index.js",
|
||||
"./cache": "./dist/cache/index.js",
|
||||
"./cmd": "./dist/cmd/index.js",
|
||||
"./crypto": "./dist/crypto/index.js",
|
||||
"./currency": "./dist/currency/index.js",
|
||||
"./db": "./dist/db/index.js",
|
||||
"./email": "./dist/email/index.js",
|
||||
"./emoji": "./dist/emoji/index.js",
|
||||
"./evchargers": "./dist/evchargers/index.js",
|
||||
"./file": "./dist/file/index.js",
|
||||
"./forex": "./dist/forex/index.js",
|
||||
"./function": "./dist/function/index.js",
|
||||
"./geocoding": "./dist/geocoding/index.js",
|
||||
"./gifs": "./dist/gifs/index.js",
|
||||
"./helloworld": "./dist/helloworld/index.js",
|
||||
"./holidays": "./dist/holidays/index.js",
|
||||
"./id": "./dist/id/index.js",
|
||||
"./image": "./dist/image/index.js",
|
||||
"./ip": "./dist/ip/index.js",
|
||||
"./location": "./dist/location/index.js",
|
||||
"./notes": "./dist/notes/index.js",
|
||||
"./otp": "./dist/otp/index.js",
|
||||
"./pkg": "./dist/pkg/index.js",
|
||||
"./postcode": "./dist/postcode/index.js",
|
||||
"./prayer": "./dist/prayer/index.js",
|
||||
"./qr": "./dist/qr/index.js",
|
||||
"./quran": "./dist/quran/index.js",
|
||||
"./routing": "./dist/routing/index.js",
|
||||
"./rss": "./dist/rss/index.js",
|
||||
"./sentiment": "./dist/sentiment/index.js",
|
||||
"./sms": "./dist/sms/index.js",
|
||||
"./stock": "./dist/stock/index.js",
|
||||
"./stream": "./dist/stream/index.js",
|
||||
"./sunnah": "./dist/sunnah/index.js",
|
||||
"./test": "./dist/test/index.js",
|
||||
"./thumbnail": "./dist/thumbnail/index.js",
|
||||
"./time": "./dist/time/index.js",
|
||||
"./twitter": "./dist/twitter/index.js",
|
||||
"./url": "./dist/url/index.js",
|
||||
"./user": "./dist/user/index.js",
|
||||
"./vehicle": "./dist/vehicle/index.js",
|
||||
"./weather": "./dist/weather/index.js"
|
||||
},
|
||||
"files": [
|
||||
"esm",
|
||||
"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"
|
||||
],
|
||||
"license": "ISC",
|
||||
"main": "dist",
|
||||
"name": "m3o",
|
||||
"main": "index.js",
|
||||
"module": "esm/index.js",
|
||||
"name": "@micro/services",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/micro/services"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"prepare": "npm run build",
|
||||
"test": "echo \"Error: no test specified\" \u0026\u0026 exit 1"
|
||||
"build": "npm run clean \u0026\u0026 tsc \u0026\u0026 tsc --p tsconfig.es.json \u0026\u0026 node build.js",
|
||||
"clean": "rimraf ./tmp",
|
||||
"prepare": "npm run build"
|
||||
},
|
||||
"type": "module",
|
||||
"types": "dist/index.d.ts",
|
||||
"version": "1.0.554"
|
||||
"types": "index.d.ts",
|
||||
"version": "1.0.556"
|
||||
}
|
||||
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": {
|
||||
"module": "es6",
|
||||
"module": "CommonJS",
|
||||
"target": "es5",
|
||||
"declaration": true,
|
||||
"lib": ["es2015", "dom"],
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"outDir": "./dist",
|
||||
"outDir": "./tmp",
|
||||
"strict": true,
|
||||
"moduleResolution": "node",
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"include": ["index.ts", "./*"],
|
||||
"exclude": ["src/**/*.spec.*", "./dist", "./node_modules"]
|
||||
"include": ["src/index.ts", "src/**/*"],
|
||||
"exclude": ["./dist", "./node_modules"]
|
||||
}
|
||||
Reference in New Issue
Block a user