Skip to content

Commit

Permalink
stash
Browse files Browse the repository at this point in the history
  • Loading branch information
Myllaume committed Jun 22, 2024
1 parent 4261dc0 commit d1ef7e4
Show file tree
Hide file tree
Showing 8 changed files with 152 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
- name: Install Dependencies
run: npm install

- name: Build Cosma
run: npm run build:back

- name: Install Cosma
run: npm install . --global

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
**/temp
.DS_Store
/build
/dist
cosmoscope.html
4 changes: 2 additions & 2 deletions controllers/autorecord.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import Config from '../core/models/config.js';
import makeRecord from './record.js';
import createRecord from './create-record.js';

/**
* Prompt config and pass record data
Expand Down Expand Up @@ -33,7 +33,7 @@ function autorecord(title = '', type = 'undefined', tags = '', saveIdOnYmlFrontM
saveIdOnYmlFrontMatter = config.opts['generate_id'] === 'always' || !!saveIdOnYmlFrontMatter;
}

makeRecord(title, type, tags, config, saveIdOnYmlFrontMatter);
createRecord(title, type, tags, config, saveIdOnYmlFrontMatter);
}

export default autorecord;
59 changes: 59 additions & 0 deletions core/static/fake/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
record_types:
undefined:
fill: '#858585'
stroke: '#858585'
super idea:
fill: '#1b9e77'
stroke: '#1b9e77'
concept:
fill: '#d95f02'
stroke: '#d95f02'
note:
fill: '#7570b3'
stroke: '#7570b3'
person:
fill: '#e7298a'
stroke: '#e7298a'
place:
fill: '#66a61e'
stroke: '#66a61e'
event:
fill: '#e6ab02'
stroke: '#e6ab02'
task:
fill: '#a6761d'
stroke: '#a6761d'
object:
fill: '#666666'
stroke: '#666666'
references:
fill: '#000'
stroke: '#000'
link_types:
undefined:
stroke: simple
color: '#e1e1e1'
g:
stroke: dotted
color: '#e1e1e1'
s:
stroke: dash
color: '#e1e1e1'
attraction_force: 500
attraction_distance_max: 1400
title: 'Test'
description: 'This cosmoscope was automatically generated with example data in order to test the functionality of the software.'
keywords:
- 'test'
- 'sample'
lang: 'en'
focus_max: 3
node_size: 10
record_metas:
- phone number
- begin
- end
chronological_record_meta: created
link_context: inline
references_as_nodes: false
references_type_label: 'references'
8 changes: 3 additions & 5 deletions e2e/cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'node:path';
import { defineConfig } from 'cypress';
const path = require('path');
const { defineConfig } = require('cypress');

const webpackConfig = defineConfig({
module.exports = defineConfig({
downloadsFolder: path.join(__dirname, '../temp'),
screenshotsFolder: path.join(__dirname, '../temp'),
videosFolder: path.join(__dirname, '../temp'),
Expand All @@ -14,5 +14,3 @@ const webpackConfig = defineConfig({
},
},
});

export default webpackConfig;
54 changes: 53 additions & 1 deletion package-lock.json

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

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
"url": "https://github.com/graphlab-fr/cosma/issues"
},
"main": "app.js",
"type": "module",
"bin": {
"cosma": "app.js"
"cosma": "dist/bundle.cjs"
},
"scripts": {
"test:unit": "./node_modules/.bin/mocha 'core/test/**.js' --timeout 30000",
Expand All @@ -22,7 +21,8 @@
"fake": "node ./core/index.js",
"format": "./node_modules/.bin/prettier --write --list-different './**/**+(.js|.css)'",
"man": "mkdir -p man && pandoc docs/user-manual.md -f markdown -t man -s --lua-filter man/manfilter.lua --include-before-body man/cosma.1.before --include-after-body man/cosma.1.after --metadata author=\"\" -o man/cosma.1",
"build": "./node_modules/.bin/webpack-cli build --config ./core/utils/webpack.config.js"
"build:front": "./node_modules/.bin/webpack-cli build --config ./core/utils/webpack.config.js",
"build:back": "./node_modules/.bin/webpack-cli build --config ./webpack.config.mjs --mode production"
},
"contributors": [
"Arthur Perret",
Expand Down Expand Up @@ -58,6 +58,7 @@
"chai-fs": "^2.0.0",
"cypress": "^13.9.0",
"mocha": "^10.4.0",
"node-loader": "^2.0.0",
"prettier": "3.2.5",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4",
Expand Down
27 changes: 27 additions & 0 deletions webpack.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import webpack from 'webpack';
import path from 'node:path';
import { fileURLToPath } from 'url';

const __dirname = path.dirname(fileURLToPath(import.meta.url));

export default {
entry: path.resolve(__dirname, 'app.js'),
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.cjs',
},
target: 'node',
module: {
rules: [
{
test: /\.node$/,
use: 'node-loader',
},
],
},
plugins: [new webpack.BannerPlugin({ banner: '#!/usr/bin/env node', raw: true })],
resolve: {
extensions: ['.js'],
},
mode: 'development',
};

0 comments on commit d1ef7e4

Please sign in to comment.