Skip to content

Commit

Permalink
chore(): update gulp
Browse files Browse the repository at this point in the history
RozmarinUS committed Jul 10, 2024
1 parent 155736a commit 30924f2
Showing 9 changed files with 50 additions and 77 deletions.
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -4,11 +4,11 @@
},
"files.exclude": {
// "**/dist": true,
"**/node_modules": true,
// "**/node_modules": true,
},
"search.exclude": {
// "**/dist": true,
"**/node_modules": true,
// "**/node_modules": true,
},
"eslint.validate": ["javascript"]
}
1 change: 0 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use strict';
/**
* Load the TypeScript compiler, then load the TypeScript gulpfile which simply loads all
* the tasks. The tasks are really inside tools/gulp/tasks.
17 changes: 11 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -11,11 +11,11 @@
"build:prod": "tsc -b -v packages",
"changelog": "lerna-changelog",
"clean": "tsc -b --clean packages",
"move:samples": "gulp move:samples",
"move:samples": "gulp move:samples",
"move:node_modules": "gulp move:node_modules",
"lint": "concurrently 'npm run lint:packages'",
"lint": "concurrently 'npm run lint:packages'",
"lint:fix": "concurrently 'npm run lint:packages -- --fix' 'npm run lint:integration -- --fix' 'npm run lint:spec -- --fix'",
"lint:packages": "eslint 'packages/**/**.ts' --ignore-pattern 'packages/**/*.spec.ts'",
"lint:packages": "eslint 'packages/**/**.ts' --ignore-pattern 'packages/**/*.spec.ts'",
"prerelease": "gulp copy-misc",
"publish": "npm run prerelease && npm run build && ./node_modules/.bin/lerna publish --force-publish --access public --exact -m \"chore(@nestgram) publish %s release\"",
"prepublishOnly": "npm run changelog | pbcopy",
@@ -65,12 +65,15 @@
"devDependencies": {
"@commitlint/cli": "19.3.0",
"@commitlint/config-angular": "19.3.0",
"@nestjs/common": "^10.0.0",
"@nestjs/core": "^10.0.0",
"@types/gulp": "4.0.17",
"@types/node": "^20.3.1",
"@typescript-eslint/eslint-plugin": "7.16.0",
"@typescript-eslint/parser": "7.16.0",
"cli-color": "^2.0.4",
"concurrently": "8.2.2",
"concurrently": "8.2.2",
"delete-empty": "^3.0.0",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.1.3",
@@ -85,11 +88,13 @@
"lerna": "2.11.0",
"lerna-changelog": "2.2.0",
"lint-staged": "15.2.7",
"path-to-regexp": "^7.0.0",
"prettier": "3.3.2",
"rimraf": "6.0.0",
"telegraf": "^4.16.3",
"ts-node": "10.9.2",
"typescript": "5.5.3",
"delete-empty": "^3.0.0"
"tslib": "^2.6.3",
"typescript": "5.5.3"
},
"changelog": {
"labels": {
25 changes: 8 additions & 17 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
{
"name": "@nestgramjs/core",
"version": "1.2.3",
"description": "A module for creating Telegram bots using NestJS, based on telegraf.js",
"author": "GlobalArt, Inc",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"dependencies": {
"path-to-regexp": "^7.0.0",
"tslib": "2.6.3"
},
"devDependencies": {
"@nestjs/common": "^10.3.10",
"@nestjs/core": "^10.3.10",
"telegraf": "^4.16.3"
}
"name": "@nestgramjs/core",
"version": "1.2.3",
"description": "A module for creating Telegram bots using NestJS, based on telegraf.js",
"author": "GlobalArt, Inc",
"license": "MIT",
"publishConfig": {
"access": "public"
}
}
34 changes: 16 additions & 18 deletions pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion tools/gulp/config.ts
Original file line number Diff line number Diff line change
@@ -2,6 +2,6 @@ import { getDirs } from './util/task-helpers';

// All paths are related to the base dir
export const source = 'packages';
export const samplePath = 'sample';
export const samplePath = 'examples';

export const packagePaths = getDirs(source);
7 changes: 2 additions & 5 deletions tools/gulp/tasks/copy-misc.ts
Original file line number Diff line number Diff line change
@@ -9,10 +9,7 @@ function copyMisc(): NodeJS.ReadWriteStream {
const miscFiles = src(['Readme.md', 'LICENSE', '.npmignore']);
// Since `dest()` does not take a string-array, we have to append it
// ourselves
return packagePaths.reduce(
(stream, packagePath) => stream.pipe(dest(packagePath)),
miscFiles,
);
return packagePaths.reduce((stream, packagePath) => stream.pipe(dest(packagePath)), miscFiles);
}

task('copy-misc', copyMisc);
task('copy-misc', async () => copyMisc);
10 changes: 3 additions & 7 deletions tools/gulp/tasks/move.ts
Original file line number Diff line number Diff line change
@@ -3,11 +3,7 @@ import { join } from 'path';
import { samplePath } from '../config';
import { containsPackageJson, getDirs } from '../util/task-helpers';

const distFiles = src([
'packages/**/*',
'!packages/**/*.ts',
'packages/**/*.d.ts',
]);
const distFiles = src(['packages/**/*', '!packages/**/*.ts', 'packages/**/*.d.ts']);

/**
* Moves the compiled nest files into "node_module" folder.
@@ -43,5 +39,5 @@ function moveToSamples() {
);
}

task('move:node_modules', moveToNodeModules);
task('move:samples', moveToSamples);
task('move:node_modules', async () => moveToNodeModules);
task('move:samples', async () => moveToSamples);
27 changes: 7 additions & 20 deletions tools/gulp/tasks/samples.ts
Original file line number Diff line number Diff line change
@@ -9,10 +9,7 @@ import { containsPackageJson, getDirs } from '../util/task-helpers';

const exec = promisify(childProcess.exec);

async function executeNpmScriptInSamples(
script: string,
appendScript?: string,
) {
async function executeNpmScriptInSamples(script: string, appendScript?: string) {
const directories = getDirs(samplePath);

for await (const dir of directories) {
@@ -37,17 +34,11 @@ async function executeNpmScriptInSamples(
* @param script script to execute
* @param appendScript additional params appended to the script
*/
async function executeNPMScriptInDirectory(
dir: string,
script: string,
appendScript?: string,
) {
async function executeNPMScriptInDirectory(dir: string, script: string, appendScript?: string) {
const dirName = dir.replace(resolve(__dirname, '../../../'), '');
log.info(`Running ${clc.blue(script)} in ${clc.magenta(dirName)}`);
try {
const result = await exec(
`${script} --prefix ${dir} ${appendScript ? '-- ' + appendScript : ''}`,
);
const result = await exec(`${script} --prefix ${dir} ${appendScript ? '-- ' + appendScript : ''}`);
// const result = await exec(`npx npm-check-updates -u`, {
// cwd: join(process.cwd(), dir),
// });
@@ -74,13 +65,9 @@ async function executeNPMScriptInDirectory(
task('install:samples', async () =>
executeNpmScriptInSamples(
// 'npm ci --no-audit --no-shrinkwrap --no-optional',
'npm install --legacy-peer-deps',
'pnpm install',
),
);
task('build:samples', async () => executeNpmScriptInSamples('npm run build'));
task('test:samples', async () =>
executeNpmScriptInSamples('npm run test', '--passWithNoTests'),
);
task('test:e2e:samples', async () =>
executeNpmScriptInSamples('npm run test:e2e', '--passWithNoTests'),
);
task('build:samples', async () => executeNpmScriptInSamples('pnpm run build'));
task('test:samples', async () => executeNpmScriptInSamples('pnpm run test', '--passWithNoTests'));
task('test:e2e:samples', async () => executeNpmScriptInSamples('pnpm run test:e2e', '--passWithNoTests'));

0 comments on commit 30924f2

Please sign in to comment.