Skip to content

Commit

Permalink
refactor: files name
Browse files Browse the repository at this point in the history
  • Loading branch information
Kholid060 committed Apr 29, 2022
1 parent 20a6085 commit 8b2aad5
Show file tree
Hide file tree
Showing 117 changed files with 94 additions and 93 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
secrets.production.js
secrets.development.js
get-pass-key.js
getPassKey.js

.idea
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import dataExporter from '@/utils/data-exporter';
import WorkflowEngine from '../workflow-engine/engine';
import blocksHandler from '../workflow-engine/blocks-handler';
import dataExporter from '@/utils/dataExporter';
import WorkflowEngine from '../workflowEngine/engine';
import blocksHandler from '../workflowEngine/blocksHandler';

export function workflow(flow) {
return new Promise((resolve, reject) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { nanoid } from 'nanoid';
import browser from 'webextension-polyfill';
import { toCamelCase } from '@/utils/helper';
import * as flowHandler from './flow-handler';
import blocksHandler from '../workflow-engine/blocks-handler';
import WorkflowEngine from '../workflow-engine/engine';
import * as flowHandler from './flowHandler';
import blocksHandler from '../workflowEngine/blocksHandler';
import WorkflowEngine from '../workflowEngine/engine';

const executedWorkflows = (workflows, options) => {
if (workflows.length === 0) return;
Expand Down
16 changes: 8 additions & 8 deletions src/background/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import browser from 'webextension-polyfill';
import { MessageListener } from '@/utils/message';
import { parseJSON, findTriggerBlock } from '@/utils/helper';
import getFile from '@/utils/get-file';
import decryptFlow, { getWorkflowPass } from '@/utils/decrypt-flow';
import getFile from '@/utils/getFile';
import decryptFlow, { getWorkflowPass } from '@/utils/decryptFlow';
import {
registerSpecificDay,
registerWorkflowTrigger,
} from '../utils/workflow-trigger';
import WorkflowState from './workflow-state';
import CollectionEngine from './collection-engine';
import WorkflowEngine from './workflow-engine/engine';
import blocksHandler from './workflow-engine/blocks-handler';
import WorkflowLogger from './workflow-logger';
} from '../utils/workflowTrigger';
import WorkflowState from './WorkflowState';
import CollectionEngine from './collectionEngine';
import WorkflowEngine from './workflowEngine/engine';
import blocksHandler from './workflowEngine/blocksHandler';
import WorkflowLogger from './WorkflowLogger';

const validateUrl = (str) => str?.startsWith('http');
const storage = {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { toCamelCase } from '@/utils/helper';

const blocksHandler = require.context('./blocks-handler', false, /\.js$/);
const blocksHandler = require.context('./blocksHandler', false, /\.js$/);
const handlers = blocksHandler.keys().reduce((acc, key) => {
const name = key.replace(/^\.\/handler-|\.js/g, '');
const name = key.replace(/^\.\/handler|\.js/g, '');

acc[toCamelCase(name)] = blocksHandler(key).default;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import browser from 'webextension-polyfill';
import { getBlockConnection } from '../helper';
import executeContentScript from '../execute-content-script';
import executeContentScript from '../executeContentScript';

async function activeTab(block) {
const nextBlockId = getBlockConnection(block);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import compareBlockValue from '@/utils/compare-block-value';
import mustacheReplacer from '@/utils/reference-data/mustache-replacer';
import testConditions from '@/utils/test-conditions';
import compareBlockValue from '@/utils/compareBlockValue';
import mustacheReplacer from '@/utils/referenceData/mustacheReplacer';
import testConditions from '@/utils/testConditions';
import { getBlockConnection } from '../helper';

async function conditions({ data, outputs }, { prevBlockData, refData }) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import browser from 'webextension-polyfill';
import { isWhitespace, parseJSON } from '@/utils/helper';
import decryptFlow, { getWorkflowPass } from '@/utils/decrypt-flow';
import decryptFlow, { getWorkflowPass } from '@/utils/decryptFlow';
import WorkflowEngine from '../engine';
import { getBlockConnection } from '../helper';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import browser from 'webextension-polyfill';
import { default as dataExporter, files } from '@/utils/data-exporter';
import { default as dataExporter, files } from '@/utils/dataExporter';
import { getBlockConnection } from '../helper';

async function exportData({ data, outputs }, { refData }) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { parseJSON } from '@/utils/helper';
import mustacheReplacer from '@/utils/reference-data/mustache-replacer';
import mustacheReplacer from '@/utils/referenceData/mustacheReplacer';
import { getBlockConnection } from '../helper';

function insertData({ outputs, data }, { refData }) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { objectHasKey } from '@/utils/helper';
import { getBlockConnection } from '../helper';
import executeContentScript, { getFrames } from '../execute-content-script';
import executeContentScript, { getFrames } from '../executeContentScript';

async function switchTo(block) {
const nextBlockId = getBlockConnection(block);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getBlockConnection } from '../helper';
import executeContentScript from '../execute-content-script';
import executeContentScript from '../executeContentScript';

async function trigger(block) {
const nextBlockId = getBlockConnection(block);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import testConditions from '@/utils/test-conditions';
import testConditions from '@/utils/testConditions';
import { getBlockConnection } from '../helper';

async function whileLoop({ data, outputs }, { refData }) {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import browser from 'webextension-polyfill';
import cloneDeep from 'lodash.clonedeep';
import { toCamelCase, sleep, objectHasKey, isObject } from '@/utils/helper';
import { tasks } from '@/utils/shared';
import referenceData from '@/utils/reference-data';
import referenceData from '@/utils/referenceData';
import { convertData, waitTabLoaded, getBlockConnection } from './helper';
import executeContentScript from './execute-content-script';
import executeContentScript from './executeContentScript';

class Worker {
constructor(engine) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/newtab/logs/LogsDataViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import { shallowReactive, computed, defineAsyncComponent } from 'vue';
import { useI18n } from 'vue-i18n';
import { dataExportTypes } from '@/utils/shared';
import { objectHasKey } from '@/utils/helper';
import dataExporter from '@/utils/data-exporter';
import dataExporter from '@/utils/dataExporter';
const SharedCodemirror = defineAsyncComponent(() =>
import('@/components/newtab/shared/SharedCodemirror.vue')
Expand Down
2 changes: 1 addition & 1 deletion src/components/newtab/settings/SettingsCloudBackup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ import { useStore } from 'vuex';
import { useToast } from 'vue-toastification';
import browser from 'webextension-polyfill';
import { fetchApi, cacheApi } from '@/utils/api';
import { convertWorkflow } from '@/utils/workflow-data';
import { convertWorkflow } from '@/utils/workflowData';
import { parseJSON } from '@/utils/helper';
import dayjs from '@/lib/dayjs';
import Workflow from '@/models/workflow';
Expand Down
2 changes: 1 addition & 1 deletion src/components/newtab/shared/SharedCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
import { onMounted, shallowReactive } from 'vue';
import { useI18n } from 'vue-i18n';
import dayjs from '@/lib/dayjs';
import triggerText from '@/utils/trigger-text';
import triggerText from '@/utils/triggerText';
const props = defineProps({
data: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/newtab/workflow/WorkflowProtect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { useI18n } from 'vue-i18n';
import { nanoid } from 'nanoid';
import AES from 'crypto-js/aes';
import hmacSHA256 from 'crypto-js/hmac-sha256';
import getPassKey from '@/utils/get-pass-key';
import getPassKey from '@/utils/getPassKey';
const props = defineProps({
workflow: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/newtab/workflow/WorkflowShare.vue
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ import { useToast } from 'vue-toastification';
import { fetchApi } from '@/utils/api';
import { workflowCategories } from '@/utils/shared';
import { parseJSON, debounce } from '@/utils/helper';
import { convertWorkflow } from '@/utils/workflow-data';
import { convertWorkflow } from '@/utils/workflowData';
import SharedWysiwyg from '@/components/newtab/shared/SharedWysiwyg.vue';
const props = defineProps({
Expand Down
2 changes: 1 addition & 1 deletion src/components/newtab/workflow/edit/EditTrigger.vue
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ import { useI18n } from 'vue-i18n';
import { useToast } from 'vue-toastification';
import dayjs from 'dayjs';
import { isObject } from '@/utils/helper';
import recordShortcut from '@/utils/record-shortcut';
import recordShortcut from '@/utils/recordShortcut';
const props = defineProps({
data: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<script setup>
import { shallowReactive, watch, onMounted } from 'vue';
import { objectHasKey } from '@/utils/helper';
import { keyDefinitions } from '@/utils/us-keyboard-layout';
import { keyDefinitions } from '@/utils/USKeyboardLayout';
const props = defineProps({
params: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { toCamelCase } from '@/utils/helper';

const blocksHandler = require.context('./blocks-handler', false, /\.js$/);
const blocksHandler = require.context('./blocksHandler', false, /\.js$/);
const handlers = blocksHandler.keys().reduce((acc, key) => {
const name = key.replace(/^\.\/handler-|\.js/g, '');
const name = key.replace(/^\.\/handler|\.js/g, '');

acc[toCamelCase(name)] = blocksHandler(key).default;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import handleSelector from '../handle-selector';
import handleSelector from '../handleSelector';

function attributeValue(block) {
return new Promise((resolve, reject) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import handleSelector from '../handle-selector';
import handleSelector from '../handleSelector';

function elementExists(block) {
return new Promise((resolve) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import handleSelector from '../handle-selector';
import handleSelector from '../handleSelector';

function elementScroll(block) {
function incScrollPos(element, data, vertical = true) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sendMessage } from '@/utils/message';
import handleSelector from '../handle-selector';
import handleSelector from '../handleSelector';

function eventClick(block) {
return new Promise((resolve, reject) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import handleFormElement from '@/utils/handle-form-element';
import handleSelector, { markElement } from '../handle-selector';
import handleFormElement from '@/utils/handleFormElement';
import handleSelector, { markElement } from '../handleSelector';

async function forms(block) {
const { data } = block;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import handleSelector from '../handle-selector';
import handleSelector from '../handleSelector';

function getText(block) {
return new Promise((resolve, reject) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sendMessage } from '@/utils/message';
import handleSelector from '../handle-selector';
import handleSelector from '../handleSelector';

function eventClick(block) {
return new Promise((resolve, reject) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import handleSelector, { markElement } from '../handle-selector';
import handleSelector, { markElement } from '../handleSelector';

async function link(block) {
const element = await handleSelector(block, { returnElement: true });
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import handleSelector from '../handle-selector';
import handleSelector from '../handleSelector';

async function saveAssets(block) {
let elements = await handleSelector(block, { returnElement: true });
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import handleSelector from '../handle-selector';
import handleSelector from '../handleSelector';

function switchTo(block) {
return new Promise((resolve, reject) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { sendMessage } from '@/utils/message';
import simulateEvent from '@/utils/simulate-event';
import simulateMouseEvent from '@/utils/simulate-event/mouse-event';
import handleSelector from '../handle-selector';
import simulateEvent from '@/utils/simulateEvent';
import simulateMouseEvent from '@/utils/simulateEvent/mouseEvent';
import handleSelector from '../handleSelector';

const modifiers = {
altKey: 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sendMessage } from '@/utils/message';
import handleSelector from '../handle-selector';
import handleSelector from '../handleSelector';

function injectFiles(element, files) {
const notFileTypeAttr = element.getAttribute('type') !== 'file';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ import { reactive, ref, watch, inject, nextTick } from 'vue';
import { getCssSelector } from 'css-selector-generator';
import { debounce } from '@/utils/helper';
import { finder } from '@medv/finder';
import findElement from '@/utils/find-element';
import findElement from '@/utils/FindElement';
import AppBlocks from './AppBlocks.vue';
import AppSelector from './AppSelector.vue';
import AppElementList from './AppElementList.vue';
import AppElementHighlighter from './AppElementHighlighter.vue';
import findElementList from './list-selector';
import findElementList from './listSelector';
const selectedElement = {
path: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ import { tasks } from '@/utils/shared';
import EditForms from '@/components/newtab/workflow/edit/EditForms.vue';
import EditTriggerEvent from '@/components/newtab/workflow/edit/EditTriggerEvent.vue';
import EditScrollElement from '@/components/newtab/workflow/edit/EditScrollElement.vue';
import handleForms from '../blocks-handler/handler-forms';
import handleGetText from '../blocks-handler/handler-get-text';
import handleEventClick from '../blocks-handler/handler-event-click';
import handelTriggerEvent from '../blocks-handler/handler-trigger-event';
import handleElementScroll from '../blocks-handler/handler-element-scroll';
import handleForms from '../blocksHandler/handlerForms';
import handleGetText from '../blocksHandler/handlerGetText';
import handleEventClick from '../blocksHandler/handlerEventClick';
import handelTriggerEvent from '../blocksHandler/handlerTriggerEvent';
import handleElementScroll from '../blocksHandler/handlerElementScroll';
const props = defineProps({
selector: {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { createApp } from 'vue';
import vRemixicon from 'v-remixicon';
import App from './App.vue';
import compsUi from './comps-ui';
import compsUi from './compsUi';
import icons from './icons';
import vueI18n from './vue-i18n';
import vueI18n from './vueI18n';
import '@/assets/css/tailwind.css';

export default function (rootElement) {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import FindElement from '@/utils/find-element';
import FindElement from '@/utils/FindElement';
import { scrollIfNeeded } from '@/utils/helper';

/* eslint-disable consistent-return */
Expand Down
6 changes: 3 additions & 3 deletions src/content/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import browser from 'webextension-polyfill';
import { nanoid } from 'nanoid';
import { toCamelCase } from '@/utils/helper';
import FindElement from '@/utils/find-element';
import executedBlock from './executed-block';
import blocksHandler from './blocks-handler';
import FindElement from '@/utils/FindElement';
import executedBlock from './executedBlock';
import blocksHandler from './blocksHandler';

function handleConditionBuilder({ data, type }) {
if (!type.startsWith('element')) return null;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/models/workflow.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Model } from '@vuex-orm/core';
import { nanoid } from 'nanoid';
import browser from 'webextension-polyfill';
import { cleanWorkflowTriggers } from '@/utils/workflow-trigger';
import { cleanWorkflowTriggers } from '@/utils/workflowTrigger';
import { fetchApi } from '@/utils/api';
import decryptFlow, { getWorkflowPass } from '@/utils/decrypt-flow';
import decryptFlow, { getWorkflowPass } from '@/utils/decryptFlow';
import Log from './log';

class Workflow extends Model {
Expand Down
2 changes: 1 addition & 1 deletion src/newtab/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import { useI18n } from 'vue-i18n';
import { compare } from 'compare-versions';
import browser from 'webextension-polyfill';
import { useTheme } from '@/composable/theme';
import { loadLocaleMessages, setI18nLanguage } from '@/lib/vue-i18n';
import { loadLocaleMessages, setI18nLanguage } from '@/lib/vueI18n';
import { fetchApi, getSharedWorkflows, getUserWorkflows } from '@/utils/api';
import dayjs from '@/lib/dayjs';
import Log from '@/models/log';
Expand Down
6 changes: 3 additions & 3 deletions src/newtab/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import store from '../store';
import compsUi from '../lib/comps-ui';
import vueI18n from '../lib/vue-i18n';
import vRemixicon, { icons } from '../lib/v-remixicon';
import compsUi from '../lib/compsUi';
import vueI18n from '../lib/vueI18n';
import vRemixicon, { icons } from '../lib/vRemixicon';
import vueToastification from '../lib/vue-toastification';
import '../assets/css/tailwind.css';
import '../assets/css/fonts.css';
Expand Down
Loading

0 comments on commit 8b2aad5

Please sign in to comment.