From 40b831a3f0240e3c43584c40921fc25df462f20c Mon Sep 17 00:00:00 2001 From: Mysteriedev Date: Sun, 6 Mar 2022 15:58:49 +0100 Subject: [PATCH] start command for developers --- cypress.json | 3 +++ cypress/plugins/index.js | 28 ++++++++++++++++------------ package.json | 19 +++++++++++++++++++ 3 files changed, 38 insertions(+), 12 deletions(-) create mode 100644 cypress.json create mode 100644 package.json diff --git a/cypress.json b/cypress.json new file mode 100644 index 0000000..91eeb63 --- /dev/null +++ b/cypress.json @@ -0,0 +1,3 @@ +{ + "baseUrl": "http://localhost/EDIT_THIS_URL_FOR_YOUR_LOCAL_SETUP" +} \ No newline at end of file diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js index 5aaa3da..10d3bef 100644 --- a/cypress/plugins/index.js +++ b/cypress/plugins/index.js @@ -19,16 +19,20 @@ const fs = require("fs"); */ // eslint-disable-next-line no-unused-vars module.exports = (on, config) => { - on("task", { - resetSetup() { - fs.rmSync("settings/users", { recursive: true, force: true }); - fs.rmSync("settings/settings.yaml"); - fs.copyFileSync( - "cypress/fixtures/01_setup/default-settings.yaml", - "settings/settings.yaml" - ); + on("task", { + resetSetup() { + const users = "settings/users"; + const settings = "settings/settings.yaml"; + if (fs.existsSync(settings) && fs.existsSync(users)) { + fs.rmSync(users, { recursive: true, force: true }); + fs.rmSync(settings); + fs.copyFileSync( + "cypress/fixtures/01_setup/default-settings.yaml", + "settings/settings.yaml" + ); + } - return null; - }, - }); -}; \ No newline at end of file + return null; + }, + }); +}; diff --git a/package.json b/package.json new file mode 100644 index 0000000..e858ce0 --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "name": "typemill", + "version": "1.0.0", + "description": "TYPEMILL is a lightweight flat file cms for micro-publishers. You can use it for documentations, manuals, special interest websites, and any other information-driven web-project. You can also enhance Typemill with plugins and generate professional e-books in pdf-format with it. The website http://typemill.net runs with Typemill.", + "main": "index.js", + "scripts": { + "e2e": "composer update && cypress open --project ." + }, + "repository": { + "type": "git", + "url": "git+https://github.com/typemill/typemill.git" + }, + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/typemill/typemill/issues" + }, + "homepage": "https://github.com/typemill/typemill#readme" +} \ No newline at end of file