Skip to content

Commit

Permalink
rough out RDM plugin interaction #3
Browse files Browse the repository at this point in the history
  • Loading branch information
chrabyrd committed Jan 15, 2024
1 parent 39d2fb5 commit 87934da
Show file tree
Hide file tree
Showing 19 changed files with 6,997 additions and 25 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.eslintrc.js
64 changes: 64 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
module.exports = {
"extends": [
"eslint:recommended",
'plugin:@typescript-eslint/recommended',
'plugin:vue/vue3-recommended',
],
"root": true,
"env": {
"browser": true,
"es6": true,
"node": true
},
"parser": "vue-eslint-parser",
"parserOptions": {
"ecmaVersion": 11,
"sourceType": "module",
"requireConfigFile": false,
"parser": {
"ts": "@typescript-eslint/parser"
}
},
"globals": {
"define": false,
"require": false,
"window": false,
"console": false,
"history": false,
"location": false,
"Promise": false,
"setTimeout": false,
"URL": false,
"URLSearchParams": false,
"fetch": false
},
"ignorePatterns": [".eslintrc.js", "**/media/plugins/*"],
"rules": {
"semi": ["error", "always"],
},
"overrides": [
{
"files": [ "*.vue" ],
"rules": {
"vue/html-indent": [2, 4]
}
},
{
"files": [ "*.js" ],
"rules": {
"indent": ["error", 4],
"space-before-function-paren": ["error", "never"],
"no-extra-boolean-cast": 0, // 0=silence, 1=warning, 2=error
// allow async-await
'generator-star-spacing': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-unused-vars': [1, {
argsIgnorePattern: '^_'
}],
"camelcase": [1, {"properties": "always"}],
}
}
]
};

40 changes: 40 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
# push: -- just run on PRs for now
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgis/postgis:13-3.0
env:
POSTGRES_PASSWORD: postgis
POSTGRES_DB: package
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
check-latest: true

- name: Check frontend files
run: |
echo "Removing yarn.lock due to yarn v1 package resolution issues"
echo "https://github.com/iarna/wide-align/issues/63"
rm yarn.lock
yarn && yarn eslint:check && yarn typescript:check
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
*.egg-info
*.pyc
*.log
*.DS_Store
arches_rdm/logs
arches_rdm/export_deliverables
arches_rdm/staticfiles
arches_rdm/media/node_modules
arches_rdm/media/build/*
arches_rdm/uploadedfiles/*
.vscode/
*.egg-info
.DS_STORE
CACHE
2 changes: 2 additions & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--install.modules-folder "./arches_rdm/media/node_modules"
--add.modules-folder "./arches_rdm/media/node_modules"
1 change: 1 addition & 0 deletions arches_rdm/locale/de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"de":{}}
10 changes: 10 additions & 0 deletions arches_rdm/locale/de/app.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: PACKAGE VERSION\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
1 change: 1 addition & 0 deletions arches_rdm/locale/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"en":{}}
10 changes: 10 additions & 0 deletions arches_rdm/locale/en/app.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: PACKAGE VERSION\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
3 changes: 3 additions & 0 deletions arches_rdm/locale/messages.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import ko from 'knockout';
import { createApp } from 'vue';
import PrimeVue from 'primevue/config';
import RDMApp from '@/App.vue';
import RDMAppTepmlate from 'templates/views/components/plugins/reference-data-manager.htm';
// import RDMVueApplication from '@/components/App.vue';
import createVueApplication from 'utils/create-vue-application';
import RDMAppTemplate from 'templates/views/components/plugins/reference-data-manager.htm';

import packageJSON from 'arches_rdm/package.json'


ko.components.register('reference-data-manager', {
viewModel: function() {
const app = createApp(RDMApp);
app.use(PrimeVue);
app.mount('#rdm-mounting-point');
// createVueApplication(packageJSON.name, RDMVueApplication).then(vueApp => {
// vueApp.mount('#rdm-mounting-point');
// });
},
template: RDMAppTepmlate,
template: RDMAppTemplate,
});
7 changes: 0 additions & 7 deletions arches_rdm/src/App.vue

This file was deleted.

7 changes: 0 additions & 7 deletions arches_rdm/src/components/Foo.vue

This file was deleted.

1 change: 1 addition & 0 deletions arches_rdm/src/shims-vue.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module '*.vue';
43 changes: 43 additions & 0 deletions gettext.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

module.exports = {
input: {
path: "./arches_rdm/src", // only files in this directory are considered for extraction
include: ["**/*.vue"], // glob patterns to select files for extraction
exclude: [], // glob patterns to exclude files from extraction
jsExtractorOpts:[ // custom extractor keyword. default empty.
{
keyword: "__", // only extractor default keyword such as $gettext,use keyword to custom
options: { // see https://github.com/lukasgeiter/gettext-extractor
content: {
replaceNewLines: "\n",
},
arguments: {
text: 0,
},
},
},
{
keyword: "_n", // $ngettext
options: {
content: {
replaceNewLines: "\n",
},
arguments: {
text: 0,
textPlural: 1,
},
},
},
],
compileTemplate: false, // do not compile <template> tag when its lang is not html
},
output: {
path: "./arches_rdm/locale", // output path of all created files
potPath: "./messages.pot", // relative to output.path, so by default "./src/language/messages.pot"
jsonPath: "./", // relative to output.path, so by default "./src/language/translations.json"
locales: ["en", "de"],
flat: false, // don't create subdirectories for locales
linguas: false, // create a LINGUAS file
splitJson: true, // create separate json files for each locale. If used, jsonPath must end with a directory, not a file
},
};
5 changes: 5 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"events": {
"start": "clear"
}
}
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
{
"name": "arches_rdm",
"license": "AGPL-3.0-only",
"version": "0.0.1",
"scripts": {
"eslint:check": "./arches_rdm/media/node_modules/.bin/eslint ./arches_rdm/src --resolve-plugins-relative-to ./arches_rdm/media --ext .vue,.ts --parser ./arches_rdm/media/node_modules/vue-eslint-parser/index.js",
"eslint:watch": "./arches_rdm/media/node_modules/.bin/nodemon --watch ./src --ext ts,vue --exec yarn --silent eslint:check",
"gettext:extract": "./arches_rdm/media/node_modules/.bin/vue-gettext-extract",
"gettext:compile": "./arches_rdm/media/node_modules/.bin/vue-gettext-compile",
"typescript:check": "./arches_rdm/media/node_modules/.bin/vue-tsc --noEmit",
"typescript:watch": "./arches_rdm/media/node_modules/.bin/vue-tsc --watch --noEmit"
},
"dependencies": {
"primevue": "^3.35.0"
"vue": "^3.3.4",
"vue3-gettext": "^3.0.0-beta.4"
},
"devDependencies": {
"arches-dev-dependencies": "archesproject/arches-dev-dependencies#dev/7.6.x"
},
"nodeModulesPaths": {
}
Expand Down
29 changes: 29 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"compilerOptions": {
"noEmit": true,
"module": "ESNext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"jsx": "preserve",
"jsxImportSource": "vue",
"noImplicitThis": true,
"strict": true,
"verbatimModuleSyntax": true,
"target": "ESNext",
"useDefineForClassFields": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"baseUrl": "./arches_rdm/src/",
"paths": {
"@/*": [
"*.ts",
"*.vue",
],
},
},
"include": [
"**/*.ts",
"**/*.vue",
],
}
Loading

0 comments on commit 87934da

Please sign in to comment.