Skip to content

Commit

Permalink
Merge branch 'main' into jmc/10_add_rdm_to_clm_migrator_cli
Browse files Browse the repository at this point in the history
  • Loading branch information
johnatawnclementawn committed Aug 9, 2024
2 parents 6b14269 + 0744a50 commit 5e4cae8
Show file tree
Hide file tree
Showing 12 changed files with 525 additions and 535 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source =

omit =
*/python?.?/*
*/models/migrations/*
*/migrations/*
*/settings*.py
*/urls.py
*/wsgi.py
Expand Down
5 changes: 5 additions & 0 deletions .github/actions/build-and-test-branch/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ runs:
echo Python packages installed
shell: bash

- name: Ensure frontend configuration files exist
run: |
python manage.py check
shell: bash

- name: Install Arches applications
uses: ./.github/actions/install-arches-applications
with:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ webpack-stats.json
.vscode/
*.egg-info
.DS_STORE
CACHE
CACHE
.tsconfig-paths.json
.frontend-configuration-settings.json
8 changes: 8 additions & 0 deletions arches_references/apps.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
from django.apps import AppConfig
from django.conf import settings

from arches.settings_utils import generate_frontend_configuration


class ArchesReferencesConfig(AppConfig):
name = "arches_references"
verbose_name = "Arches References"
is_arches_application = True

def ready(self):
if settings.APP_NAME.lower() == self.name:
generate_frontend_configuration()
14 changes: 6 additions & 8 deletions arches_references/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
Django settings for arches_references project.
"""

import json
import os
import sys
import arches
import inspect
import semantic_version
import os
from datetime import datetime, timedelta

import semantic_version
from django.utils.translation import gettext_lazy as _

try:
Expand All @@ -19,9 +17,6 @@
APP_NAME = "arches_references"
APP_VERSION = semantic_version.Version(major=0, minor=0, patch=0)
APP_ROOT = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
MIN_ARCHES_VERSION = arches.__version__
MAX_ARCHES_VERSION = arches.__version__


WEBPACK_LOADER = {
"DEFAULT": {
Expand Down Expand Up @@ -424,6 +419,9 @@
# override this to permenantly display/hide the language switcher
SHOW_LANGUAGE_SWITCH = len(LANGUAGES) > 1

# TODO: remove when finalizing release
SILENCED_SYSTEM_CHECKS += ["arches.E002"]

try:
from .package_settings import *
except ImportError:
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ classifiers = [
]
requires-python = ">=3.10"
dependencies = [
"arches @ git+https://github.com/archesproject/arches.git@95bbe4a",
"arches @ git+https://github.com/archesproject/arches.git@dev/8.0.x",
]
version = "0.0.1"

Expand Down
23 changes: 7 additions & 16 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
{
"extends": "./.tsconfig-paths.json",
"compilerOptions": {
"noEmit": true,
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"jsx": "preserve",
"jsxImportSource": "vue",
"noImplicitThis": false,
"strict": true,
"noEmit": true,
"noImplicitThis": false,
"verbatimModuleSyntax": true,
"target": "ESNext",
"useDefineForClassFields": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"baseUrl": "arches_references/src/",
"paths": {
"@/*": [
"*.ts",
"*.vue"
]
}
},
"include": [
"**/*.ts",
"**/*.vue"
]
"allowImportingTsExtensions": true
}
}
96 changes: 62 additions & 34 deletions vitest.config.mts
Original file line number Diff line number Diff line change
@@ -1,36 +1,64 @@
import fs from 'fs';
import path from 'path';
import vue from "@vitejs/plugin-vue";
import { defineConfig } from "vitest/config";


const exclude = [
'**/node_modules/**',
'**/dist/**',
'**/cypress/**',
'**/.{idea,git,cache,output,temp}/**',
'**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
path.join(path.basename(__dirname), 'install', '**')
];

export default defineConfig({
plugins: [vue()],
test: {
alias: {
'@/': new URL(path.join(path.basename(__dirname), 'src', '/'), import.meta.url).pathname,
},
coverage: {
include: [path.join(path.basename(__dirname), 'src', '/')],
exclude: exclude,
reporter: [
['clover', { 'file': 'coverage.xml' }],
'text',
],
reportsDirectory: path.join(__dirname, 'coverage', 'frontend'),
},
environment: "jsdom",
globals: true,
exclude: exclude,
passWithNoTests: true,
setupFiles: ['vitest.setup.mts'],
},
});

import { defineConfig } from 'vite';

import type { UserConfigExport } from 'vite';


function generateConfig(): Promise<UserConfigExport> {
return new Promise((resolve, reject) => {
const exclude = [
'**/node_modules/**',
'**/dist/**',
'**/install/**',
'**/cypress/**',
'**/.{idea,git,cache,output,temp}/**',
'**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
];

const rawData = fs.readFileSync(path.join(__dirname, '.frontend-configuration-settings.json'), 'utf-8');
const parsedData = JSON.parse(rawData);

const alias: { [key: string]: string } = {
'@/arches': path.join(parsedData['ROOT_DIR'], 'app', 'src', 'arches'),
};

for (
const [archesApplicationName, archesApplicationPath]
of Object.entries(
parsedData['ARCHES_APPLICATIONS_PATHS'] as { [key: string]: string }
)
) {
alias[`@/${archesApplicationName}`] = path.join(archesApplicationPath, 'src', archesApplicationName);
}

resolve({
plugins: [vue()],
test: {
alias: alias,
coverage: {
include: [path.join(path.basename(__dirname), 'app', 'src', path.sep)],
exclude: exclude,
reporter: [
['clover', { 'file': 'coverage.xml' }],
'text',
],
reportsDirectory: path.join(__dirname, 'coverage', 'frontend'),
},
environment: "jsdom",
globals: true,
exclude: exclude,
passWithNoTests: true,
setupFiles: ['vitest.setup.mts'],
},
});

});
};

export default (async () => {
const config = await generateConfig();
return defineConfig(config);
})();
2 changes: 1 addition & 1 deletion vitest.setup.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { beforeAll, vi } from 'vitest';
// import '@/declarations.d.ts';
import '@/declarations.d.ts';


beforeAll(() => {
Expand Down
Loading

0 comments on commit 5e4cae8

Please sign in to comment.