#1 Vue POC
Merged 3 years ago by mymindstorm. Opened 3 years ago by mymindstorm.
mymindstorm/fedora-packages-static vue  into  master

file modified
+2
@@ -1,3 +1,5 @@ 

  public_html/

  repositories/

  pagure_owner_alias.json

+ vue/node_modules

+ vue/dist

file added
+37
@@ -0,0 +1,37 @@ 

+ FROM fedora:latest

+ 

+ RUN dnf -y upgrade \

+   && dnf -y install \

+   nginx \

+   make \

+   python3-requests \

+   python3-jinja2 \

+   npm \

+   cronie \

+   cronie-anacron

+ 

+ WORKDIR /usr/local/src/packages

+ 

+ RUN mkdir /srv/packages

+ ENV OUTPUT_DIR /srv/packages

+ 

+ RUN mkdir /etc/packages

+ ENV DB_DIR /etc/packages/repositories

+ ENV MAINTAINER_MAPPING /etc/packages/pagure_owner_alias.json

+ 

+ COPY . .

+ RUN chmod -R o+rx assets

+ 

+ RUN make setup-js \

+   && make js

+ 

+ COPY container/nginx.conf /etc/nginx/nginx.conf

+ COPY container/update-packages.sh /etc/cron.weekly/

+ 

+ # TODO: Figure out how to use a read-write volume for

+ #  one container that manages static files

+ #  and just serve from the rest with read-only mounts

+ VOLUME /srv/packages

+ EXPOSE 80

+ 

+ ENTRYPOINT [ "./container/entrypoint.sh" ]

file modified
+20 -2
@@ -6,10 +6,14 @@ 

  	@echo "sync-repositories: download RPM repository metadata for active releases"

  	@echo "fetch-maintainers: download package-maintainer mapping from dist-git"

  	@echo "html: generate static website"

+ 	@echo "js: generate js"

+ 	@echo "setup-js: get js dependencies"

  	@echo "all: all of the above, in order"

  	@echo "clean: remove artefacts"

  

- all: sync-repositories fetch-maintainers html

+ all: sync-repositories fetch-maintainers html js

+ 

+ html-only: sync-repositories fetch-maintainers html

  

  sync-repositories:

  	mkdir -p $(DB_DIR)
@@ -19,8 +23,22 @@ 

  	curl https://src.fedoraproject.org/extras/pagure_owner_alias.json -o $(MAINTAINER_MAPPING)

  

  html:

- 	mkdir -p $(OUTPUT_DIR)

+ 	mkdir -p $(OUTPUT_DIR)/assets

+ 	cp -r assets/* $(OUTPUT_DIR)/assets

  	bin/generate-html.py --target-dir $(OUTPUT_DIR)

  

+ js:

+ 	cd vue && npm run prod

+ 	mkdir -p $(OUTPUT_DIR)/assets/js

+ 	cp vue/dist/* $(OUTPUT_DIR)/assets/js

+ 

+ js-dev:

+ 	cd vue && npm run build

+ 	mkdir -p $(OUTPUT_DIR)/assets/js

+ 	cp vue/dist/* $(OUTPUT_DIR)/assets/js

+ 

+ setup-js:

+ 	cd vue && npm i

+ 

  clean:

  	rm -r $(OUTPUT_DIR) $(DB_DIR) $(MAINTAINER_MAPPING)

file modified
+1 -3
@@ -15,11 +15,8 @@ 

  ## TODO

  

  * Clean code, make pylint and humans happy.

- * Define license (likely MIT, GLPv3 would be nice).

- * Fix EPEL8 support.

  * Display dependencies in package detail page.

  * Add support for modular and flatpak repositories.

- * Build container for use in CommunityShift.

  

  ## Dependencies

  
@@ -36,6 +33,7 @@ 

  * Download repository metadata for active releases: `make sync-repositories`

  * Download package-maintainers mapping from dist-git: `make fetch-maintainers`

  * Generate static website: `make html`

+ * Install npm dependencies: `make setup-js`

  

  * All at once: `make all`

  * Help message: `make help`

file modified
+8
@@ -47,3 +47,11 @@ 

  .max-width {

  	width: 100%;

  }

+ 

+ .active {

+   background: lightgray;

+ }

+ 

+ ol, ul {

+   padding-left: 1.5em;

+ }

empty or binary file added
empty or binary file added
empty or binary file added
empty or binary file added
empty or binary file added
file modified
+6 -1
@@ -162,11 +162,16 @@ 

                  ('{}/pub/fedora/linux/updates/{}/Everything/x86_64/repodata'.format(MIRROR, version), release + "-updates"),

                  ('{}/pub/fedora/linux/updates/testing/{}/Everything/x86_64/repodata'.format(MIRROR, version), release + "-updates-testing"),

                  ]

-     elif product == "epel":

+     elif product == "epel" and int(version) < 8:

          return [

                  ('{}/pub/epel/{}/x86_64/repodata/'.format(MIRROR, version), release),

                  ('{}/pub/epel/testing/{}/x86_64/repodata'.format(MIRROR, version), release + "-testing"),

                  ]

+     elif product == "epel" and int(version) >= 8:

+         return [

+                 ('{}/pub/epel/{}/Everything/x86_64/repodata/'.format(MIRROR, version), release),

+                 ('{}/pub/epel/testing/{}/Everything/x86_64/repodata'.format(MIRROR, version), release + "-testing"),

+                 ]

      else:

          sys.exit("Unknown product: {}".format(product))

  

file modified
+2 -2
@@ -19,9 +19,9 @@ 

  from jinja2 import Environment, PackageLoader, select_autoescape

  

  TEMPLATE_DIR='../templates'

- DBS_DIR='repositories'

+ DBS_DIR=os.environ.get('DB_DIR') or "repositories"

  ASSETS_DIR='assets'

- SCM_MAINTAINER_MAPPING='pagure_owner_alias.json'

+ SCM_MAINTAINER_MAPPING=os.environ.get('MAINTAINER_MAPPING') or "pagure_owner_alias.json"

  

  class Package:

      def __init__(self, name):

@@ -0,0 +1,5 @@ 

+ #!/bin/sh

+ 

+ anacron -s

+ make html-only

+ nginx

file added
+53
@@ -0,0 +1,53 @@ 

+ user nginx;

+ worker_processes auto;

+ error_log /var/log/nginx/error.log;

+ pid /run/nginx.pid;

+ daemon off;

+ 

+ # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.

+ include /usr/share/nginx/modules/*.conf;

+ 

+ events {

+     worker_connections 1024;

+ }

+ 

+ http {

+     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '

+                       '$status $body_bytes_sent "$http_referer" '

+                       '"$http_user_agent" "$http_x_forwarded_for"';

+ 

+     access_log  /var/log/nginx/access.log  main;

+ 

+     sendfile            on;

+     tcp_nopush          on;

+     tcp_nodelay         on;

+     keepalive_timeout   65;

+     types_hash_max_size 4096;

+ 

+     include             /etc/nginx/mime.types;

+     default_type        application/octet-stream;

+ 

+     # Load modular configuration files from the /etc/nginx/conf.d directory.

+     # See http://nginx.org/en/docs/ngx_core_module.html#include

+     # for more information.

+     include /etc/nginx/conf.d/*.conf;

+ 

+     server {

+         listen       80;

+         listen       [::]:80;

+         server_name  _;

+         root         /srv/packages;

+ 

+         # Load configuration files for the default server block.

+         include /etc/nginx/default.d/*.conf;

+ 

+         error_page 404 /404.html;

+             location = /40x.html {

+         }

+ 

+         error_page 500 502 503 504 /50x.html;

+             location = /50x.html {

+         }

+     }

+ 

+ }

@@ -0,0 +1,4 @@ 

+ #!/bin/sh

+ 

+ cd /usr/local/src/packages

+ make html-only

file modified
+53 -17
@@ -9,9 +9,11 @@ 

  		<div class="page-large">

  			<div class="container">

  				<div class="row">

- 					<div class="col-md-6">

- 						<img src="../../assets/images/logo.png" style="margin-top: -30px;">

- 					</div>

+ 					<a href="/">

+ 						<div class="col-md-6">

+ 							<img src="../../assets/images/logo.png" style="margin-top: -30px;">

+ 						</div>

+ 					</a>

  					<div class="col-md-6">

  						<form action="http://yacysearchserver-pkgs-playground.apps.os.fedorainfracloud.org/yacysearch.html" method="get">

  							<div class="form-row">
@@ -37,17 +39,43 @@ 

  			</h1>

  			<p class="text-muted">{{ pkg.summary }}</p>

  			<ul class="list-group list-group-horizontal-lg">

- 				<li class="list-group-item max-width"><a href="https://admin.fedoraproject.org/updates/{{ pkg.source() }}">Bodhi</a></li>

- 				<li class="list-group-item max-width"><a href="https://bugzilla.redhat.com/buglist.cgi?component={{ pkg.source()}}&query_format=advanced&product=Fedora&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED">Bugzilla</a></li>

- 				<li class="list-group-item max-width"><a href="https://retrace.fedoraproject.org/faf/problems/?component_pkg.names={{ pkg.source() }}">FAF</a></li>

- 				<li class="list-group-item max-width"><a href="http://koji.fedoraproject.org/koji/search?match=glob&type=package&terms={{ pkg.source() }}">Koji</a></li>

- 				<li class="list-group-item max-width"><a href="https://src.fedoraproject.org/rpms/{{ pkg.source() }}">SCM</a></li>

+ 				<li class="list-group-item max-width">

+ 					<a href="https://bodhi.fedoraproject.org/updates/{{ pkg.source() }}">

+ 						<img src="../../assets/images/16_bodhi.png" height="16" width="16">

+ 						Bodhi

+ 					</a>

+ 				</li>

+ 				<li class="list-group-item max-width">

+ 					<a href="https://bugzilla.redhat.com/buglist.cgi?component={{ pkg.source()}}&query_format=advanced&product=Fedora&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED">

+ 						<img src="../../assets/images/16_bugzilla.png" height="16" width="16">

+ 						Bugzilla

+ 					</a>

+ 				</li>

+ 				<li class="list-group-item max-width">

+ 					<a href="https://retrace.fedoraproject.org/faf/problems/?component_pkg.names={{ pkg.source() }}">

+ 						<img src="../../assets/images/16_abrt.png" height="16" width="16">

+ 						FAF

+ 					</a>

+ 				</li>

+ 				<li class="list-group-item max-width">

+ 					<a href="http://koji.fedoraproject.org/koji/search?match=glob&type=package&terms={{ pkg.source() }}">

+ 						<img src="../../assets/images/16_koji.png" height="16" width="16">

+ 						Koji

+ 					</a>

+ 				</li>

+ 				<li class="list-group-item max-width">

+ 					<a href="https://src.fedoraproject.org/rpms/{{ pkg.source() }}">

+ 						<img src="../../assets/images/git-logo.png" height="16" width="16">

+ 						SCM

+ 					</a>

+ 				</li>

  			</ul>

  			<p class="yacy-index">{{ pkg.description }}</p>

- 			<hr />

- 			<div>

+ 			<div id="vue">

+ 				<hr />

  				<div class="row">

  					<div class="col-md-8">

+ 						<h3>Releases Overview</h3>

  						<table class="table table-striped table-borderless">

  							<thead>

  								<tr>
@@ -81,29 +109,37 @@ 

  								{% endfor %}

  							</tbody>

  						</table>

+ 						<datagrepper></datagrepper>

  					</div>

  					<div class="col-md-4">

+ 						<b>Package Info</b>

  						<ul>

  							<li>Upstream: <a href="{{ pkg.upstream }}">{{ pkg.upstream }}</a></li>

  							<li>License(s): {{ pkg.license }}</li>

- 							<li>Maintainer(s):{% for fas in pkg.maintainers %} {{ fas }}{% endfor %}</li>

+ 							{% if pkg.maintainers | length == 1 %}

+ 							<li>Maintainer:{% for fas in pkg.maintainers %} {{ fas }}{% endfor %}</li>

+ 							{% else %}

+ 							<li>Maintainers:{% for fas in pkg.maintainers %} {{ fas }}{{ "," if not loop.last }}{% endfor %}</li>

+ 							{% endif %}

  						</ul>

- 						<hr />

- 						<p>

- 						You can contact the maintainers of this package at

- 						<code>{{ pkg.source() }} dash owner at fedoraproject dotorg</code>.

- 						</p>

  						{% if pkg.subpackages | length %}

  						<hr />

+ 						<b>Subpackages</b>

  						<ul>

  						{% for subpkg in pkg.subpackages %}

  						<li><a href="../{{ subpkg }}">{{ subpkg }}</a></li>

  						{% endfor %}

- 						{% endif %}

  						</ul>

+ 						{% endif %}

+ 						<hr />

+ 						<p>

+ 						You can contact the maintainers of this package at

+ 						<code>{{ pkg.source() }} dash owner at fedoraproject dot org</code>.

+ 						</p>

  					</div>

  				</div>

  			</div>

  		</div>

  	</body>

+ 	<script src="../../assets/js/main.js"></script>

  </html>

file added
+14
@@ -0,0 +1,14 @@ 

+ module.exports = {

+   root: true,

+   parser: "@typescript-eslint/parser",

+   plugins: ["@typescript-eslint"],

+   parserOptions: {

+     tsconfigRootDir: __dirname,

+     project: ["./tsconfig.json"],

+   },

+   extends: [

+     "eslint:recommended",

+     "plugin:@typescript-eslint/recommended",

+     'plugin:@typescript-eslint/recommended-requiring-type-checking',

+   ],

+ };

file added
+2733
The added file is too large to be shown here, see it at: vue/package-lock.json
file added
+30
@@ -0,0 +1,30 @@ 

+ {

+   "name": "fedora-packages-static",

+   "version": "1.0.0",

+   "description": "",

+   "main": "index.js",

+   "scripts": {

+     "lint": "eslint src/**/*.ts",

+     "build": "webpack-cli",

+     "prod": "webpack-cli --config webpack.prod.js"

+   },

+   "author": "",

+   "repository": "https://pagure.io/fedora-packages-static",

+   "license": "SEE LICENSE IN LICENSE",

+   "devDependencies": {

+     "@typescript-eslint/eslint-plugin": "^4.6.0",

+     "@typescript-eslint/parser": "^4.6.0",

+     "eslint": "^7.12.1",

+     "fork-ts-checker-webpack-plugin": "^5.2.1",

+     "ts-loader": "^8.0.7",

+     "typescript": "^4.0.5",

+     "vue-loader": "^15.9.4",

+     "vue-template-compiler": "^2.6.12",

+     "webpack": "^5.3.2",

+     "webpack-cli": "^4.1.0",

+     "webpack-merge": "^5.3.0"

+   },

+   "dependencies": {

+     "vue": "^2.6.12"

+   }

+ }

@@ -0,0 +1,78 @@ 

+ <template>

+   <div>

+     <h2>Recent Activity</h2>

+     <div v-if="errMsg">{{ errMsg }}</div>

+     <div v-else-if="messages.length">

+       <table class="table">

+         <tbody>

+           <tr v-for="message in messages" :key="message.id">

+             <td><a :href="message.link"><img :src="message.icon" height="30" width="30"></a></td>

+             <td>{{ message.subtitle }} <span style="color: grey;">{{ message.date }}</span></td>

+           </tr>

+         </tbody>

+       </table>

+     </div>

+     <div v-else>Loading...</div>

+     <div id="scrollTrigger"></div>

+   </div>

+ </template>

+ <script lang="ts">

+ import Vue from "vue";

+ import {DgConnector, Messages} from "./datagrepper";

+ 

+ const dgConnector = new DgConnector("https://apps.fedoraproject.org/datagrepper");

+ 

+ export default Vue.extend({

+   data() {

+     return {

+       errMsg: "",

+       messages: [] as Messages[],

+       pages: 0,

+       currentPage: 0

+     };

+   },

+   mounted() {

+     this.loadPage();

+     this.setupObserver();

+   },

+   methods: {

+     async loadPage(page?: number) {

+       const dgData = await dgConnector.getMessages(

+         // @ts-ignore

+         this.$package,

+         { page }

+       );

+       if (typeof dgData !== "object") {

+         this.errMsg = dgData;

+         return;

+       }

+ 

+       this.messages = this.messages.concat(dgData.messages);

+       this.pages = dgData.pages;

+       this.currentPage = dgData.page;

+     },

+     setupObserver() {

+       const observer = new IntersectionObserver(this.loadMore, { threshold: 1 });

+       const scrollTrigger = document.querySelector('#scrollTrigger');

+       if (scrollTrigger) {

+         observer.observe(scrollTrigger);

+       }

+     },

+     async loadMore(entries: IntersectionObserverEntry[]) {

+       if (this.errMsg || !this.messages.length) {

+         return;

+       }

+ 

+       if (this.currentPage === this.pages) {

+         return;

+       }

+ 

+       if (!entries[0].isIntersecting) {

+         return;

+       }

+ 

+       await this.loadPage(this.currentPage + 1);

+     }

+   },

+ });

+ </script>

@@ -0,0 +1,53 @@ 

+ import { DatagrepperResult, Meta } from "./types/datagrepper";

+ 

+ export class DgConnector {

+     endpoint: string;

+ 

+     constructor(dgEndpoint: string) {

+         this.endpoint = dgEndpoint;

+     }

+ 

+     async getMessages(packageName: string, opts?: { page?: number }) {

+         const queryURL = new URL(this.endpoint);

+         queryURL.pathname += "/raw";

+         queryURL.searchParams.append("package", packageName);

+         queryURL.searchParams.append("meta", "subtitle");

+         queryURL.searchParams.append("meta", "link");

+         queryURL.searchParams.append("meta", "icon");

+         queryURL.searchParams.append("meta", "date");

+         queryURL.searchParams.append("not_topic", "org.fedoraproject.prod.mdapi.repo.update");

+         queryURL.searchParams.append("not_topic", "org.fedoraproject.prod.buildsys.rpm.sign");

+         queryURL.searchParams.append("not_topic", "org.fedoraproject.prod.buildsys.tag");

+         queryURL.searchParams.append("not_topic", "org.fedoraproject.prod.buildsys.untag");

+         queryURL.searchParams.append("not_topic", "org.fedoraproject.prod.buildsys.package.list.change");

+         if (opts?.page) {

+             queryURL.searchParams.append("page", String(opts.page));

+         }

+ 

+         try {

+             const request = await fetch(queryURL.href);

+             if (!request.ok) {

+                 console.error("Request error:", request);

+                 return "Error: Could not connect to Datagrepper";

+             }

+             const response = await request.json() as DatagrepperResult;

+ 

+             let messages = [] as Messages[];

+             for (const msg of response.raw_messages) {

+                 messages.push({...msg.meta, id: msg.msg_id});

+             }

+             

+             return {

+                 messages,

+                 pages: response.pages,

+                 page: response.arguments.page,

+             }

+         } catch (e) {

+             return String(e);

+         }

+     }

+ }

+ 

+ export interface Messages extends Meta {

+     id: string;

+ } 

file added
+21
@@ -0,0 +1,21 @@ 

+ import Vue from "vue";

+ import Datagrepper from "./Datagrepper.vue";

+ 

+ function init(): void {

+     const packageName = window.location.pathname.match(/\/pkgs\/(.+)\//);

+     if (!packageName) {

+         console.error("Could not find package name!");

+         return;

+     }

+ 

+     Vue.prototype.$package = packageName[1];

+ 

+     new Vue({

+         el: "#vue",

+         components: {

+             Datagrepper

+         }

+     });

+ }

+ 

+ init();

@@ -0,0 +1,54 @@ 

+ export interface DatagrepperResult {

+     arguments:    Arguments;

+     count:        number;

+     pages:        number;

+     raw_messages: RawMessage[];

+     total:        number;

+ }

+ 

+ export interface Arguments {

+     categories:     string[];

+     contains:       string[];

+     delta?:         number;

+     end?:           number;

+     grouped:        boolean;

+     meta:           string[];

+     not_categories: string[];

+     not_packages:   string[];

+     not_topics:     string[];

+     not_users:      string[];

+     order:          string;

+     packages:       string[];

+     page:           number;

+     rows_per_page:  number;

+     start?:         number;

+     topics:         string[];

+     users:          string[];

+ }

+ 

+ export interface RawMessage {

+     certificate:    string;

+     crypto:         string;

+     headers:        {};

+     i:              number;

+     meta:           Meta;

+     msg:            Msg;

+     msg_id:         string;

+     signature:      string;

+     source_name:    string;

+     source_version: string;

+     timestamp:      number;

+     topic:          string;

+     username:       string;

+ }

+ 

+ export interface Meta {

+     icon:     string;

+     link:     string;

+     subtitle: string;

+     date:     string;

+ }

+ 

+ export interface Msg {

+     [key: string]: any;

+ }

@@ -0,0 +1,4 @@ 

+ declare module "*.vue" {

+     import Vue, { VueConstructor } from "vue";

+     export default Vue;

+ }

file added
+66
@@ -0,0 +1,66 @@ 

+ {

+   "compilerOptions": {

+     /* Basic Options */

+     // "incremental": true,                   /* Enable incremental compilation */

+     "target": "es5",                          /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */

+     "module": "es2015",                     /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */

+     "lib": ["DOM", "ES6"],                             /* Specify library files to be included in the compilation. */

+     // "allowJs": true,                       /* Allow javascript files to be compiled. */

+     // "checkJs": true,                       /* Report errors in .js files. */

+     // "jsx": "preserve",                     /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */

+     // "declaration": true,                   /* Generates corresponding '.d.ts' file. */

+     // "declarationMap": true,                /* Generates a sourcemap for each corresponding '.d.ts' file. */

+     // "sourceMap": true,                     /* Generates corresponding '.map' file. */

+     // "outFile": "./",                       /* Concatenate and emit output to single file. */

+     // "outDir": "./",                        /* Redirect output structure to the directory. */

+     // "rootDir": "./",                       /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */

+     // "composite": true,                     /* Enable project compilation */

+     // "tsBuildInfoFile": "./",               /* Specify file to store incremental compilation information */

+     // "removeComments": true,                /* Do not emit comments to output. */

+     // "noEmit": true,                        /* Do not emit outputs. */

+     // "importHelpers": true,                 /* Import emit helpers from 'tslib'. */

+     // "downlevelIteration": true,            /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */

+     // "isolatedModules": true,               /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */

+ 

+     /* Strict Type-Checking Options */

+     "strict": true,                           /* Enable all strict type-checking options. */

+     // "noImplicitAny": true,                 /* Raise error on expressions and declarations with an implied 'any' type. */

+     // "strictNullChecks": true,              /* Enable strict null checks. */

+     // "strictFunctionTypes": true,           /* Enable strict checking of function types. */

+     // "strictBindCallApply": true,           /* Enable strict 'bind', 'call', and 'apply' methods on functions. */

+     // "strictPropertyInitialization": true,  /* Enable strict checking of property initialization in classes. */

+     // "noImplicitThis": true,                /* Raise error on 'this' expressions with an implied 'any' type. */

+     // "alwaysStrict": true,                  /* Parse in strict mode and emit "use strict" for each source file. */

+ 

+     /* Additional Checks */

+     // "noUnusedLocals": true,                /* Report errors on unused locals. */

+     // "noUnusedParameters": true,            /* Report errors on unused parameters. */

+     // "noImplicitReturns": true,             /* Report error when not all code paths in function return a value. */

+     // "noFallthroughCasesInSwitch": true,    /* Report errors for fallthrough cases in switch statement. */

+ 

+     /* Module Resolution Options */

+     "moduleResolution": "node",            /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */

+     // "baseUrl": "./",                       /* Base directory to resolve non-absolute module names. */

+     // "paths": {},                           /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */

+     // "rootDirs": [],                        /* List of root folders whose combined content represents the structure of the project at runtime. */

+     // "typeRoots": [],                       /* List of folders to include type definitions from. */

+     // "types": [],                           /* Type declaration files to be included in compilation. */

+     // "allowSyntheticDefaultImports": true,  /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */

+     "esModuleInterop": true,                  /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */

+     // "preserveSymlinks": true,              /* Do not resolve the real path of symlinks. */

+     // "allowUmdGlobalAccess": true,          /* Allow accessing UMD globals from modules. */

+ 

+     /* Source Map Options */

+     // "sourceRoot": "",                      /* Specify the location where debugger should locate TypeScript files instead of source locations. */

+     // "mapRoot": "",                         /* Specify the location where debugger should locate map files instead of generated locations. */

+     // "inlineSourceMap": true,               /* Emit a single file with source maps instead of having a separate file. */

+     // "inlineSources": true,                 /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */

+ 

+     /* Experimental Options */

+     // "experimentalDecorators": true,        /* Enables experimental support for ES7 decorators. */

+     // "emitDecoratorMetadata": true,         /* Enables experimental support for emitting type metadata for decorators. */

+ 

+     /* Advanced Options */

+     "forceConsistentCasingInFileNames": true  /* Disallow inconsistently-cased references to the same file. */

+   }

+ }

@@ -0,0 +1,44 @@ 

+ const path = require("path");

+ const VueLoaderPlugin = require("vue-loader/lib/plugin");

+ const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");

+ 

+ module.exports = {

+   mode: "development",

+   devtool: "source-map",

+   entry: "./src/index.ts",

+   module: {

+     rules: [

+       {

+         test: /\.tsx?$/,

+         loader: "ts-loader",

+         options: {

+           appendTsSuffixTo: [/\.vue$/],

+           transpileOnly: true

+         },

+         exclude: /node_modules/

+       },

+       {

+         test: /\.vue$/,

+         loader: "vue-loader"

+       }

+     ]

+   },

+   plugins: [

+     new VueLoaderPlugin(),

+     new ForkTsCheckerWebpackPlugin()

+   ],

+   resolve: {

+     extensions: [

+       ".js",

+       ".jsx",

+       ".vue",

+       ".json",

+       ".ts",

+       ".tsx"

+     ],

+     modules: ["node_modules"],

+     alias: {

+       'vue$': 'vue/dist/vue.esm.js'

+     }

+   }

+ };

file added
+7
@@ -0,0 +1,7 @@ 

+ const merge = require('webpack-merge');

+ const common = require('./webpack.config.js');

+ 

+ module.exports = merge(common, {

+   mode: "production",

+   devtool: "none"

+ });

I built a proof of concept for using Vue to get extra data on packages pages. I have a demo where it grabs some bodhi data here: demo removed

It doesn't break anything if you don't have JS enabled. This also means that if the JS part of packages-static becomes unmaintained, you would only have to comment out the script in the template to disable it.

My post on the mailing list didn't get any comments, so I wanted to know what you think about this. It's pretty barebones at the moment, but it would be easy to build pagination, make it prettier, and show more relevant fields when I have some more free time.

It doesn't break anything if you don't have JS enabled. This also means that if the JS part of packages-static becomes unmaintained, you would only have to comment out the script in the template to disable it.

That's great! I wish things to be as simple / resilient as possible.

I built a proof of concept for using Vue to get extra data on packages pages. I have a demo where it grabs some bodhi data here: https://mymindstorm.fedorapeople.org/packages-vue-demo/pkgs/kernel/

I am not fond of the tab thing, can you put the JS-generated content under the package revision table?

To be honest, I don't think having the list of koji builds, bohdi updates and friends here are worth the work required to make it happen: they already are a click away by following the koji/bohdi/.. links from the top of the page. The only JS-thing I think could be useful is a list of fedmsg events regarding the package.

1 new commit added

  • datagrepper
3 years ago

1 new commit added

  • update scripts
3 years ago

I am not fond of the tab thing, can you put the JS-generated content under the package revision table?

I didn't want to overload bodhi with requests by auto loading it. The Bodhi API is already pretty slow.

The only JS-thing I think could be useful is a list of fedmsg events regarding the package.

That makes sense. I did that below, it loads more if you scroll.

https://mymindstorm.fedorapeople.org/packages-vue-demo/pkgs/mumble/

It looks great! I'll take a look at the code and merge later this week.

Thanks!

1 new commit added

  • - add dockerfile
3 years ago

Do you mind taking a look at this? It looks like we might be able to deploy this to some testing instances soon. If you don't have the time, then I am willing to help maintain.

https://lists.fedoraproject.org/archives/list/infrastructure@lists.fedoraproject.org/message/YD5TFWZHBITXZBA35KDELKDGXANCH5E6/

rebased onto 7d00ddf

3 years ago

3 new commits added

  • Update npm dependencies
  • - add dockerfile
  • Add Vue.js to show fedmsg information on package pages
3 years ago

1 new commit added

  • Merge branch 'master' into vue
3 years ago

Pull-Request has been merged by mymindstorm

3 years ago