Skip to content

Commit

Permalink
chore: updating the package.json versions (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustrb authored Sep 26, 2024
1 parent 86f4390 commit e7627d9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
26 changes: 16 additions & 10 deletions src/misc/variousUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,34 @@ import { IAppCategory } from './interfaces';

export class VariousUtils {
public static slugify = function _slugify(text: string): string {
return text.toString().toLowerCase().replace(/^\s+|\s+$/g, '')
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w-]+/g, '') // Remove all non-word chars
.replace(/--+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of textte
return text
.toString()
.toLowerCase()
.replace(/^\s+|\s+$/g, '')
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w-]+/g, '') // Remove all non-word chars
.replace(/--+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of textte
};

public static getTsDefVersion = function _getTsDefVersion(): string {
const devLocation = 'node_modules/@rocket.chat/apps-engine/package.json';
const devLocation =
'node_modules/@rocket.chat/apps-engine/package.json';

if (fs.existsSync(devLocation)) {
const info = JSON.parse(fs.readFileSync(devLocation, 'utf8'));
return '^' + info.version as string;
return ('^' + info.version) as string;
}

return '^1.4.0';
return '^1.44.0';
};

// tslint:disable:promise-function-async
public static async fetchCategories(): Promise<Array<IAppCategory>> {
const cats = await fetch('https://marketplace.rocket.chat/v1/categories').then((res) => res.json());
const cats = await fetch(
'https://marketplace.rocket.chat/v1/categories',
).then((res) => res.json());

const categories: Array<IAppCategory> = cats.map((c: any) => {
return {
Expand Down
8 changes: 6 additions & 2 deletions src/templates/app/packageJsonTemplate.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
export const packageJsonTemplate = (): string => {
return `{
"devDependencies": {
"@rocket.chat/apps-engine": "^1.19.0",
"@rocket.chat/apps-engine": "^1.44.0",
"@types/node": "14.14.6",
"tslint": "^5.10.0",
"typescript": "^4.0.5"
"typescript": "^5.6.2"
},
"dependencies": {
"@rocket.chat/icons": "^0.38.0",
"@rocket.chat/ui-kit": "^0.36.1"
}
}`;
};

0 comments on commit e7627d9

Please sign in to comment.