Skip to content

Commit

Permalink
Merge branch 'release/4.0.0-alpha.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobuddy committed Jun 5, 2024
2 parents ffce948 + 7fbce46 commit 7363ef8
Show file tree
Hide file tree
Showing 27 changed files with 344 additions and 194 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: casejs
open_collective: mnfst
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: 🆕 Feature request
url: https://github.com/ManifestOfficial/manifest/discussions/new?category=feature-request
url: https://github.com/mnfst/manifest/discussions/new?category=feature-request
about: Ask for new features! The most popular features will be included in the roadmap.
28 changes: 28 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI-CD Core Manifest

on:
pull_request:
branches: [master, develop]
push:
branches: [master, develop]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '18.x'
- name: Install dependencies
run: npm ci
working-directory: ./packages/core/manifest
- name: Build app
run: npm run build
working-directory: ./packages/core/manifest
- name: Test app
run: npm run test
working-directory: ./packages/core/manifest
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<br>
<p align="center">
<a href="https://manifest.build">
<img alt="manifest" src="https://manifest.build/logo-transparent.svg" height="55px" />
<a href="https://manifest.build/#gh-light-mode-only">
<img alt="manifest" src="https://manifest.build/assets/images/logo-transparent.svg" height="55px" alt="Manifest logo" title="Manifest - Effortless backends" />
</a>
<a href="https://manifest.build/#gh-dark-mode-only">
<img alt="manifest" src="https://manifest.build/assets/images/logo-light.svg" height="55px" alt="Manifest logo" title="Manifest - Effortless backends" />
</a>
</p>

Expand All @@ -11,16 +14,16 @@
<a href="https://www.npmjs.com/package/manifest" target="_blank">
<img alt="npm" src="https://img.shields.io/npm/v/manifest">
</a>
<a href="https://www.codefactor.io/repository/github/ManifestOfficial/manifest" target="_blank">
<img alt="CodeFactor Grade" src="https://img.shields.io/codefactor/grade/github/ManifestOfficial/manifest">
<a href="https://www.codefactor.io/repository/github/mnfst/manifest" target="_blank">
<img alt="CodeFactor Grade" src="https://img.shields.io/codefactor/grade/github/mnfst/manifest">
</a>
<a href="https://discord.com/invite/FepAked3W7" target="_blank">
<img alt="Discord" src="https://img.shields.io/discord/1089907785178812499?label=discord">
</a>
<a href="https://opencollective.com/casejs" target="_blank">
<a href="https://opencollective.com/mnfst" target="_blank">
<img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us">
</a>
<a href="https://github.com/ManifestOfficial/manifest/blob/develop/LICENSE" target="_blank">
<a href="https://github.com/mnfst/manifest/blob/develop/LICENSE" target="_blank">
<img alt="License MIT" src="https://img.shields.io/badge/licence-MIT-green">
</a>
<br>
Expand Down Expand Up @@ -73,12 +76,12 @@ npx add-manifest

- [Docs](https://manifest.build/docs) - Get started with Manifest
- [Discord](https://discord.gg/FepAked3W7) - Come chat with the community
- [Github](https://github.com/ManifestOfficial/manifest/issues) - Report bugs and share ideas to improve the product.
- [Github](https://github.com/mnfst/manifest/issues) - Report bugs and share ideas to improve the product.

## Contributors

Thanks to our first wonderful contributors !

<a href="https://github.com/ManifestOfficial/manifest/graphs/contributors">
<img src="https://contrib.rocks/image?repo=ManifestOfficial/manifest" />
<a href="https://github.com/mnfst/manifest/graphs/contributors">
<img src="https://contrib.rocks/image?repo=mnfst/manifest" />
</a>
8 changes: 4 additions & 4 deletions packages/add-manifest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "add-manifest",
"version": "0.1.0-alpha.3",
"version": "0.1.0-alpha.5",
"author": "Manifest",
"description": "Add Manifest backend to your app",
"homepage": "https://manifest.build",
Expand Down Expand Up @@ -43,9 +43,9 @@
"chalk": "^5.3.0",
"fs": "^0.0.1-security",
"jsonc-parser": "^3.2.1",
"open": "^10.1.0",
"ora": "^8.0.1",
"path": "^0.12.7",
"tree-kill": "^1.2.2",
"url": "^0.11.3"
},
"devDependencies": {
Expand Down Expand Up @@ -73,9 +73,9 @@
"main": "",
"repository": {
"type": "git",
"url": "git+https://github.com/ManifestOfficial/manifest.git"
"url": "git+https://github.com/mnfst/manifest.git"
},
"bugs": "https://github.com/ManifestOfficial/manifest/issues",
"bugs": "https://github.com/mnfst/manifest/issues",
"keywords": [
"manifest",
"backend",
Expand Down
49 changes: 39 additions & 10 deletions packages/add-manifest/src/commands/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Command } from '@oclif/core'
import axios from 'axios'
import { exec as execCp } from 'node:child_process'
import { PromiseWithChild, exec as execCp } from 'node:child_process'
import * as crypto from 'node:crypto'
import * as fs from 'node:fs'
import * as path from 'node:path'
import { fileURLToPath } from 'node:url'
import { promisify } from 'node:util'
import open from 'open'
import ora from 'ora'
import treeKill from 'tree-kill'
import { parse } from 'jsonc-parser'

import { updateExtensionJsonFile } from '../utils/UpdateExtensionJsonFile.js'
Expand Down Expand Up @@ -91,7 +91,7 @@ export class MyCommand extends Command {
updatePackageJsonFile({
fileContent: packageJson,
newPackages: {
manifest: '^4.0.0-alpha.4'
manifest: '^4.0.0-alpha.8'
},
newScripts: {
manifest: 'node node_modules/manifest/scripts/watch/watch.js',
Expand Down Expand Up @@ -201,18 +201,21 @@ export class MyCommand extends Command {
fs.writeFileSync(envFilePath, envContent)

spinner.succeed()
spinner.start('Build the database...')

let serveTask: PromiseWithChild<{ stdout: string; stderr: string }> | null =
null

spinner.start('Serve the backend...')
try {
exec('npm run manifest')
// We run the manifest script to build the database.
serveTask = exec('npm run manifest')

await this.waitForServerToBeReady()
spinner.succeed()
} catch (error) {
spinner.fail(`Execution error: ${error}`)
}

// Wait for the server to start
await this.waitForServerToBeReady()
spinner.succeed()

spinner.start('Seed initial data...')
try {
await exec('npm run manifest:seed')
Expand All @@ -222,7 +225,14 @@ export class MyCommand extends Command {

spinner.succeed()

open('http://localhost:1111/auth/login')
console.log()
console.log('🎉 Manifest successfully installed !')
console.log()
console.log('🚀 Run `npm run manifest` to start the server.')
console.log()

await this.silentKill(serveTask?.child?.pid || 0)
process.exit()
}

/**
Expand Down Expand Up @@ -267,4 +277,23 @@ export class MyCommand extends Command {
.replace(/\/\*[\s\S]*?\*\//g, '') // Remove multi-line comments
.replace(/\/\/.*$/gm, '') // Remove single-line comments
}

/**
* Kill a process without logging an error if it fails.
*
* @param {number} pid - The process ID.
* @returns {Promise<void>} - A promise that resolves when the process is killed.
*
*/
silentKill(pid: number): Promise<void> {
return new Promise<void>((resolve, reject) => {
treeKill(pid, 'SIGKILL', (err) => {
if (err) {
reject(`Failed to kill process: ${err}`)
} else {
resolve()
}
})
})
}
}
12 changes: 6 additions & 6 deletions packages/core/admin/package-lock.json

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

6 changes: 3 additions & 3 deletions packages/core/admin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mnfst/admin",
"version": "0.1.0-alpha.2",
"version": "0.1.0-alpha.4",
"homepage": "https://manifest.build",
"keywords": [
"admin",
Expand All @@ -15,10 +15,10 @@
"description": "Official Manifest admin panel",
"repository": {
"type": "git",
"url": "git+https://github.com/ManifestOfficial/manifest.git"
"url": "git+https://github.com/mnfst/manifest.git"
},
"bugs": {
"url": "https://github.com/ManifestOfficial/manifest/issues"
"url": "https://github.com/mnfst/manifest/issues"
},
"files": [
"dist/"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HttpErrorResponse } from '@angular/common/http'
import { Component, OnInit } from '@angular/core'
import { FormControl, FormGroup, Validators } from '@angular/forms'
import { ActivatedRoute, Router } from '@angular/router'
import { ActivatedRoute, Params, Router } from '@angular/router'

import { PropType } from '@mnfst/types'

Expand All @@ -14,12 +14,6 @@ import { AuthService } from '../../auth.service'
styleUrls: ['./login.component.scss']
})
export class LoginComponent implements OnInit {
// appConfig: AppConfig

defaultUser: any = {
email: '[email protected]',
password: 'manifest'
}
suggestedEmail: string
suggestedPassword: string

Expand All @@ -34,32 +28,24 @@ export class LoginComponent implements OnInit {
private readonly authService: AuthService,
private router: Router,
private activatedRoute: ActivatedRoute,
private flashMessageService: FlashMessageService // private appConfigService: AppConfigService
private flashMessageService: FlashMessageService
) {}

ngOnInit(): void {
// combineLatest([
// this.appConfigService.appConfig,
// this.activatedRoute.queryParams
// ]).subscribe(([appConfig, queryParams]: [AppConfig, Params]) => {
// this.appConfig = appConfig
// if (queryParams['email']) {
// this.suggestedEmail = queryParams['email']
// } else if (!this.appConfig.production) {
// this.suggestedEmail = this.defaultUser.email
// }
// if (queryParams['password']) {
// this.suggestedPassword = queryParams['password']
// } else if (!this.appConfig.production) {
// this.suggestedPassword = this.defaultUser.password
// }
// if (this.suggestedEmail) {
// this.patchValue('email', this.suggestedEmail)
// }
// if (this.suggestedPassword) {
// this.patchValue('password', this.suggestedPassword)
// }
// })
this.activatedRoute.queryParams.subscribe((queryParams: Params) => {
if (queryParams['email']) {
this.suggestedEmail = queryParams['email']
}
if (queryParams['password']) {
this.suggestedPassword = queryParams['password']
}
if (this.suggestedEmail) {
this.patchValue('email', this.suggestedEmail)
}
if (this.suggestedPassword) {
this.patchValue('password', this.suggestedPassword)
}
})
}

patchValue(controlName: string, value: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class ListComponent implements OnInit {

this.router.navigate(['.'], {
relativeTo: this.activatedRoute,
queryParams: this.queryParams,
queryParams,
queryParamsHandling: 'merge'
})
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/admin/src/app/pages/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ <h1>{{ appManifest.name }}</h1>
<div class="column is-6">
<a
class="card-link"
href="https://github.com/ManifestOfficial/manifest/discussions/categories/feedback"
href="https://github.com/mnfst/manifest/discussions/categories/feedback"
target="_blank"
>
<div
Expand Down
Loading

0 comments on commit 7363ef8

Please sign in to comment.