save
This commit is contained in:
parent
d3893c682e
commit
427ffba725
8
.gitignore
vendored
8
.gitignore
vendored
@ -21,3 +21,11 @@ pnpm-debug.log*
|
|||||||
*.njsproj
|
*.njsproj
|
||||||
*.sln
|
*.sln
|
||||||
*.sw?
|
*.sw?
|
||||||
|
|
||||||
|
.tmp
|
||||||
|
|
||||||
|
.s.*
|
||||||
|
log*
|
||||||
|
config.json
|
||||||
|
.direnv
|
||||||
|
.envrc
|
4
.prettierrc
Normal file
4
.prettierrc
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"tabWidth": 4,
|
||||||
|
"useTabs": false
|
||||||
|
}
|
24
README.md
24
README.md
@ -1,24 +0,0 @@
|
|||||||
# mail
|
|
||||||
|
|
||||||
## Project setup
|
|
||||||
```
|
|
||||||
yarn install
|
|
||||||
```
|
|
||||||
|
|
||||||
### Compiles and hot-reloads for development
|
|
||||||
```
|
|
||||||
yarn serve
|
|
||||||
```
|
|
||||||
|
|
||||||
### Compiles and minifies for production
|
|
||||||
```
|
|
||||||
yarn build
|
|
||||||
```
|
|
||||||
|
|
||||||
### Lints and fixes files
|
|
||||||
```
|
|
||||||
yarn lint
|
|
||||||
```
|
|
||||||
|
|
||||||
### Customize configuration
|
|
||||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
|
@ -1,5 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
presets: [
|
|
||||||
'@vue/cli-plugin-babel/preset'
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,95 +1,138 @@
|
|||||||
const Imap = require('imap');
|
const Imap = require("imap");
|
||||||
const {simpleParser} = require('mailparser');
|
const { simpleParser } = require("mailparser");
|
||||||
const inspect = require('util').inspect;
|
const inspect = require("util").inspect;
|
||||||
const saveMessage = require('./storeMessage').saveMessage;
|
const saveMessage = require("./storeMessage").saveMessage;
|
||||||
|
const imapConfig = require("./config.json").mail;
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
const imap = new Imap({
|
const imap = new Imap({
|
||||||
user: '',
|
user: imapConfig.user,
|
||||||
password: '',
|
password: imapConfig.password,
|
||||||
tlsOptions: {servername: "imap.gmail.com"},
|
tlsOptions: { servername: "imap.gmail.com" },
|
||||||
host: 'imap.gmail.com',
|
host: "imap.gmail.com",
|
||||||
port: 993,
|
port: 993,
|
||||||
tls: true
|
tls: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
imap.once("ready", function () {
|
||||||
imap.once('ready', function() {
|
|
||||||
const readOnly = true;
|
const readOnly = true;
|
||||||
imap.openBox('INBOX', readOnly, (err, box) => {
|
imap.openBox("INBOX", readOnly, (err, box) => {
|
||||||
// console.log(box); // uidvalidty uidnext, messages total and new
|
// console.log(box); // uidvalidty uidnext, messages total and new
|
||||||
|
imap.search(["ALL"], function (err, results) {
|
||||||
if (err) throw err;
|
console.log(results[results.length - 1]);
|
||||||
const f = imap.seq.fetch('2:2', {
|
|
||||||
bodies: ['HEADER.FIELDS (FROM)','TEXT'],
|
|
||||||
struct: true,
|
|
||||||
envelope: true,
|
|
||||||
extensions: true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
f.on('message', function(msg, seqno) {
|
|
||||||
// console.log('Message #%d', seqno);
|
|
||||||
var prefix = '(#' + seqno + ') ';
|
|
||||||
let attributes = undefined;
|
|
||||||
let body = undefined;
|
|
||||||
|
|
||||||
msg.on('body', function(stream, info) {
|
|
||||||
simpleParser(stream, async (err, parsed) => {
|
|
||||||
body = parsed;
|
|
||||||
if (attributes) {
|
|
||||||
saveMessage(body, attributes);
|
|
||||||
};
|
|
||||||
// console.log(parsed.headers)
|
|
||||||
// const {from, subject, textAsHtml, text} = parsed;
|
|
||||||
// console.log(parsed.attachments)
|
|
||||||
// console.log(prefix + parsed.text)
|
|
||||||
// console.log(parsed.from.value);
|
|
||||||
// console.log(parsed.subject);
|
|
||||||
// console.log(parsed.date)
|
|
||||||
// console.log(parsed.replyTo.value);
|
|
||||||
// console.log(parsed.messageId);
|
|
||||||
// console.log(parsed.html);
|
|
||||||
// console.log(parsed.text);
|
|
||||||
// console.log(parsed.textAsHtml);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
const f = imap.fetch(969, { size: true, struct: true, envelope: true });
|
||||||
|
// var f = imap.seq.fetch('1:3', {
|
||||||
|
// bodies: 'HEADER.FIELDS (FROM TO SUBJECT DATE)',
|
||||||
|
// struct: true
|
||||||
|
// });
|
||||||
|
f.on("message", function (msg, seqno) {
|
||||||
|
// console.log("Message #%d", seqno);
|
||||||
|
// var prefix = "(#" + seqno + ") ";
|
||||||
|
// msg.on("body", function (stream, info) {
|
||||||
|
// simpleParser(stream, async (err, parsed) => {
|
||||||
|
// // find box id;
|
||||||
|
// console.log(parsed)
|
||||||
|
// const boxId = 1;
|
||||||
|
// // saveMessage(parsed, boxId);
|
||||||
|
// console.log(parsed.subject);
|
||||||
|
// fs.writeFileSync("./test.json", JSON.stringify(parsed));
|
||||||
|
// });
|
||||||
|
// // console.log(prefix + 'Body');
|
||||||
|
// // stream.pipe(fs.createWriteStream('msg-' + seqno + '-body.txt'));
|
||||||
|
// });
|
||||||
msg.once('attributes', attrs => {
|
msg.once('attributes', attrs => {
|
||||||
attributes = attrs;
|
// todo find boxId
|
||||||
if (body) {
|
const boxId = 1;
|
||||||
saveMessage(body, attributes);
|
saveMessage(attrs, boxId, imap);
|
||||||
};
|
|
||||||
// console.log(prefix + 'Attributes: %s', inspect(attrs, false, 8));
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
msg.once('end', function() {
|
|
||||||
console.log(prefix + 'Finished');
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
f.once('error', function(err) {
|
|
||||||
console.log('Fetch error: ' + err);
|
|
||||||
});
|
|
||||||
|
|
||||||
f.once('end', function() {
|
|
||||||
console.log('Done fetching all messages!');
|
|
||||||
imap.end();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
f.once("error", function (err) {
|
||||||
|
console.log("Fetch error: " + err);
|
||||||
|
});
|
||||||
|
f.once("end", function () {
|
||||||
|
console.log("Done fetching all messages!");
|
||||||
|
// imap.end();
|
||||||
|
});
|
||||||
|
// });
|
||||||
|
return;
|
||||||
|
// if (err) throw err;
|
||||||
|
// const f = imap.seq.fetch('2:2', {
|
||||||
|
// bodies: ['HEADER.FIELDS (FROM)','TEXT'],
|
||||||
|
// struct: true,
|
||||||
|
// envelope: true,
|
||||||
|
// extensions: true
|
||||||
|
// });
|
||||||
|
|
||||||
|
// f.on('message', function(msg, seqno) {
|
||||||
|
// // console.log('Message #%d', seqno);
|
||||||
|
// var prefix = '(#' + seqno + ') ';
|
||||||
|
// let attributes = undefined;
|
||||||
|
// let body = undefined;
|
||||||
|
|
||||||
|
// msg.on('body', function(stream, info) {
|
||||||
|
// simpleParser(stream, async (err, parsed) => {
|
||||||
|
// body = parsed;
|
||||||
|
// // console.log(body)
|
||||||
|
// if (attributes) {
|
||||||
|
// saveMessage(body, attributes);
|
||||||
|
// };
|
||||||
|
// // console.log(parsed.headers)
|
||||||
|
// // const {from, subject, textAsHtml, text} = parsed;
|
||||||
|
// // console.log(parsed.attachments)
|
||||||
|
// // console.log(prefix + parsed.text)
|
||||||
|
// // console.log(parsed.from.value);
|
||||||
|
// // console.log(parsed.subject);
|
||||||
|
// // console.log(parsed.date)
|
||||||
|
// // console.log(parsed.replyTo.value);
|
||||||
|
// // console.log(parsed.messageId);
|
||||||
|
// // console.log(parsed.html);
|
||||||
|
// // console.log(parsed.text);
|
||||||
|
// // console.log(parsed.textAsHtml);
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
|
||||||
|
// msg.once('attributes', attrs => {
|
||||||
|
// attributes = attrs;
|
||||||
|
// console.log(attributes)
|
||||||
|
// if (body) {
|
||||||
|
// saveMessage(body, attributes);
|
||||||
|
// };
|
||||||
|
// // console.log(prefix + 'Attributes: %s', inspect(attrs, false, 8));
|
||||||
|
|
||||||
|
// });
|
||||||
|
|
||||||
|
// msg.once('end', function() {
|
||||||
|
// console.log(prefix + 'Finished');
|
||||||
|
// });
|
||||||
|
|
||||||
|
// });
|
||||||
|
|
||||||
|
// f.once('error', function(err) {
|
||||||
|
// console.log('Fetch error: ' + err);
|
||||||
|
// });
|
||||||
|
|
||||||
|
// f.once('end', function() {
|
||||||
|
// console.log('Done fetching all messages!');
|
||||||
|
// imap.end();
|
||||||
|
// });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
imap.once('error', function(err) {
|
imap.once("error", function (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
});
|
});
|
||||||
|
|
||||||
imap.once('end', function() {
|
imap.once("end", function () {
|
||||||
console.log('Connection ended');
|
console.log("Connection ended");
|
||||||
});
|
});
|
||||||
|
|
||||||
imap.connect();
|
imap.connect();
|
||||||
|
|
||||||
// const getEmails = () => {
|
// const getEmails = () => {
|
||||||
// imap.once('ready', () => {
|
// imap.once('ready', () => {
|
||||||
@ -116,7 +159,7 @@ imap.once('ready', function() {
|
|||||||
// // 'mime-version' => '1.0',
|
// // 'mime-version' => '1.0',
|
||||||
// // 'content-type' => { value: 'text/html', params: [Object] },
|
// // 'content-type' => { value: 'text/html', params: [Object] },
|
||||||
// // 'content-transfer-encoding' => 'quoted-printable'
|
// // 'content-transfer-encoding' => 'quoted-printable'
|
||||||
|
|
||||||
// });
|
// });
|
||||||
// });
|
// });
|
||||||
// msg.once('attributes', attrs => {
|
// msg.once('attributes', attrs => {
|
||||||
@ -149,14 +192,14 @@ imap.once('ready', function() {
|
|||||||
|
|
||||||
// imap.connect();
|
// imap.connect();
|
||||||
// };
|
// };
|
||||||
|
|
||||||
// getEmails();
|
// getEmails();
|
||||||
|
|
||||||
function isValidEmail(email) {
|
function isValidEmail(email) {
|
||||||
// todo
|
// todo
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
isValidEmail
|
isValidEmail,
|
||||||
}
|
};
|
||||||
|
@ -1,62 +1,129 @@
|
|||||||
const { getAddresseId } = require("../sql/mail");
|
const { getAddresseId } = require("../sql/mail");
|
||||||
const { DEBUG } = require("../utils/debug");
|
const { DEBUG } = require("../utils/debug");
|
||||||
|
const { simpleParser } = require("mailparser");
|
||||||
|
|
||||||
const { registerMessage, registerMailbox_message, saveHeader_fields, saveAddress_fields } = require('../sql/saveMessage');
|
const {
|
||||||
const { getMailboxId, getField } = require('../sql/mail');
|
registerMessage,
|
||||||
|
registerMailbox_message,
|
||||||
|
saveHeader_fields,
|
||||||
|
saveAddress_fields,
|
||||||
|
} = require("../sql/saveMessage");
|
||||||
|
const { getMailboxId, getField } = require("../sql/mail");
|
||||||
|
|
||||||
function saveMessage(message, attributes, mailbox) {
|
function saveMessage(attrs, mailboxId, imap) {
|
||||||
const timestamp = new Date(attributes.envelope.date).getTime();
|
console.log("SAVE MSG")
|
||||||
const rfc822size = 0; // todo
|
// console.log(attrs.struct);
|
||||||
registerMessage(timestamp, rfc822size).then((messageId) => {
|
const envelope = attrs.envelope;
|
||||||
getMailboxId(mailbox).then((mailboxId) => {
|
const timestamp = new Date(envelope.date).getTime();
|
||||||
const seen = attributes.flags.includes('Seen') ? 1 : 0; // todo verify
|
const rfc822size = attrs.size;
|
||||||
const deleted = attributes.flags.includes('Deleted') ? 1 : 0; // todo verify
|
registerMessage(timestamp, rfc822size, envelope.messageId).then(
|
||||||
registerMailbox_message(mailboxId, attributes.uid, messageId, attributes.modseq, seen, deleted).then(() => {
|
(messageId) => {
|
||||||
attributes.struct.forEach(part => {
|
const seen = attrs.flags.includes("Seen") ? 1 : 0; // todo verify
|
||||||
// saveBodyparts().then((bodypartId) => {
|
const deleted = attrs.flags.includes("Deleted") ? 1 : 0; // todo verify
|
||||||
// const partText = undefined;
|
|
||||||
// savePart_numbers(messageId, partText, bodypartId, part.size, part.lines)
|
registerMailbox_message(
|
||||||
// });
|
mailboxId,
|
||||||
});
|
attrs.uid,
|
||||||
const part = ''; // todo
|
messageId,
|
||||||
Object.keys(attributes.envelope).forEach(key => {
|
attrs.modseq,
|
||||||
const newKey = keyNormalizer(key);
|
seen,
|
||||||
if (isHeader(newKey)) {
|
deleted
|
||||||
getField(newKey).then((fieldId) => {
|
);
|
||||||
saveHeader_fields(messageId, part, 2, fieldId, attributes.envelope[key]);
|
// // attributes.struct.forEach(part => {
|
||||||
|
// // // saveBodyparts().then((bodypartId) => {
|
||||||
|
// // // const partText = undefined;
|
||||||
|
// // // savePart_numbers(messageId, partText, bodypartId, part.size, part.lines)
|
||||||
|
// // // });
|
||||||
|
// // });
|
||||||
|
const len = attrs.struct.length;
|
||||||
|
console.log(attrs.struct);
|
||||||
|
// // attrs.struct.forEach((part) => {
|
||||||
|
// // console.log(part)
|
||||||
|
// console.log("----------");
|
||||||
|
// if (len > 1) part = part[0];
|
||||||
|
// if (part?.type == "text") {
|
||||||
|
// console.log(part.partID);
|
||||||
|
// console.log(attrs.uid);
|
||||||
|
// const uid = attrs.uid;
|
||||||
|
// const bodies = ["HEADER", "1.TEXT", "2.TEXT", "2.HTML"];
|
||||||
|
|
||||||
|
// const fetchOptions = {
|
||||||
|
// bodies: bodies,
|
||||||
|
// };
|
||||||
|
|
||||||
|
const fetch = imap.fetch(attrs.uid, { bodies: ["HEADER.FIELDS (FROM)", 2] });
|
||||||
|
|
||||||
|
fetch.on("message", (msg) => {
|
||||||
|
msg.on("body", (stream, info) => {
|
||||||
|
simpleParser(stream, async (err, parsed) => {
|
||||||
|
console.log(parsed);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
getField(newKey).then((fieldId) => {
|
msg.once("end", () => {
|
||||||
if (attributes.envelope[key]) {
|
console.log("Finished fetching message");
|
||||||
attributes.envelope[key].forEach((elt, index) => {
|
|
||||||
saveAddress_fields(messageId, part, fieldId, index, getAddresseId(`${elt.mailbox}@${elt.host}`, elt.name));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
});
|
||||||
});
|
|
||||||
// todo add date field
|
fetch.once("error", (err) => {
|
||||||
});
|
console.log(err);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
fetch.once("end", () => {
|
||||||
|
console.log("Done fetching all messages");
|
||||||
|
});
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
// // const part = ''; // todo when transfered
|
||||||
|
|
||||||
|
// // save envelope (header + from, to, subject, date, cc)
|
||||||
|
// Object.keys(attributes.envelope).forEach(key => {
|
||||||
|
// const newKey = keyNormalizer(key);
|
||||||
|
// if (isHeader(newKey)) {
|
||||||
|
// getField(newKey).then((fieldId) => {
|
||||||
|
// saveHeader_fields(messageId, part, 2, fieldId, attributes.envelope[key]);
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
// getField(newKey).then((fieldId) => {
|
||||||
|
// if (attributes.envelope[key]) {
|
||||||
|
// attributes.envelope[key].forEach((elt, index) => {
|
||||||
|
// saveAddress_fields(messageId, part, fieldId, index, getAddresseId(`${elt.mailbox}@${elt.host}`, elt.name));
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
// // // save more header
|
||||||
|
// // message.headerLines.forEach(elt => {
|
||||||
|
// // const newKey = keyNormalizer(elt.key);
|
||||||
|
// // getField(newKey).then((fieldId) => {
|
||||||
|
// // saveHeader_fields(messageId, part, 2, fieldId, elt[line]);
|
||||||
|
// // });
|
||||||
|
// // });
|
||||||
|
|
||||||
|
// // // todo add date field
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function isHeader(key) {
|
function isHeader(key) {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'date':
|
case "date":
|
||||||
case 'subject':
|
case "subject":
|
||||||
case 'messageId':
|
case "messageId":
|
||||||
return true;
|
return true;
|
||||||
case 'from':
|
case "from":
|
||||||
case 'sender':
|
case "sender":
|
||||||
case 'replyTo':
|
case "replyTo":
|
||||||
case 'to':
|
case "to":
|
||||||
case 'cc':
|
case "cc":
|
||||||
case 'bcc':
|
case "bcc":
|
||||||
case 'inReplyTo':
|
case "inReplyTo":
|
||||||
return false;
|
return false;
|
||||||
default:
|
default:
|
||||||
DEBUG.log("Unknown header key: "+key);
|
DEBUG.log("Unknown header key: " + key);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -66,7 +133,6 @@ function keyNormalizer(key) {
|
|||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
saveMessage
|
saveMessage,
|
||||||
}
|
};
|
||||||
|
@ -1,26 +1,21 @@
|
|||||||
const bdd = require("./bdd.js").bdd;
|
const bdd = require("./bdd.js").bdd;
|
||||||
const DEBUG = require("../utils/debug").DEBUG;
|
const DEBUG = require("../utils/debug").DEBUG;
|
||||||
|
|
||||||
function registerMessage(timestamp, rfc822size) {
|
function registerMessage(timestamp, rfc822size, messageId) {
|
||||||
|
// todo messageId
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(0);
|
const query = `INSERT INTO messages (idate, rfc822size) VALUES (${timestamp}, '${rfc822size}')`;
|
||||||
//todo
|
|
||||||
const query = `INSERT INTO messages (idate, rfc822size) VALUES (UNIX_TIMESTAMP('${timestamp}'), '${rfc822size}')`;
|
|
||||||
bdd.query(query, (err, results, fields) => {
|
bdd.query(query, (err, results, fields) => {
|
||||||
if (err) reject(err);
|
if (err) reject(err);
|
||||||
// resolve(results.insertId);
|
resolve(results.insertId);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function registerMailbox_message(mailboxId, uid, messageId, modseq, seen, deleted) {
|
function registerMailbox_message(mailboxId, uid, messageId, modseq, seen, deleted) {
|
||||||
return new Promise((resolve, reject) => {
|
const query = `INSERT IGNORE INTO mailbox_messages (mailbox, uid, message, modseq, seen, deleted) VALUES ('${mailboxId}', '${uid}', '${messageId}', '${modseq}', '${seen}', '${deleted}')`;
|
||||||
const query = `INSERT IGNORE INTO mailbox_messages (mailbox, uid, message, modseq, seen, deleted) VALUES ('${mailboxId}', '${uid}', '${messageId}', '${modseq}', '${seen}', '${deleted}')`;
|
bdd.query(query, (err, results, fields) => {
|
||||||
bdd.query(query, (err, results, fields) => {
|
if (err) DEBUG.log(err);
|
||||||
if (err) reject(err);
|
|
||||||
resolve();
|
|
||||||
// resolve(results.insertId);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"target": "es5",
|
|
||||||
"module": "esnext",
|
|
||||||
"baseUrl": "./",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"paths": {
|
|
||||||
"@/*": [
|
|
||||||
"src/*"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"lib": [
|
|
||||||
"esnext",
|
|
||||||
"dom",
|
|
||||||
"dom.iterable",
|
|
||||||
"scripthost"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
43
package.json
43
package.json
@ -1,43 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "mail",
|
|
||||||
"version": "0.1.0",
|
|
||||||
"private": true,
|
|
||||||
"scripts": {
|
|
||||||
"serve": "vue-cli-service serve",
|
|
||||||
"build": "vue-cli-service build",
|
|
||||||
"lint": "vue-cli-service lint"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"core-js": "^3.8.3",
|
|
||||||
"vue": "^3.2.13"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@babel/core": "^7.12.16",
|
|
||||||
"@babel/eslint-parser": "^7.12.16",
|
|
||||||
"@vue/cli-plugin-babel": "~5.0.0",
|
|
||||||
"@vue/cli-plugin-eslint": "~5.0.0",
|
|
||||||
"@vue/cli-service": "~5.0.0",
|
|
||||||
"eslint": "^7.32.0",
|
|
||||||
"eslint-plugin-vue": "^8.0.3"
|
|
||||||
},
|
|
||||||
"eslintConfig": {
|
|
||||||
"root": true,
|
|
||||||
"env": {
|
|
||||||
"node": true
|
|
||||||
},
|
|
||||||
"extends": [
|
|
||||||
"plugin:vue/vue3-essential",
|
|
||||||
"eslint:recommended"
|
|
||||||
],
|
|
||||||
"parserOptions": {
|
|
||||||
"parser": "@babel/eslint-parser"
|
|
||||||
},
|
|
||||||
"rules": {}
|
|
||||||
},
|
|
||||||
"browserslist": [
|
|
||||||
"> 1%",
|
|
||||||
"last 2 versions",
|
|
||||||
"not dead",
|
|
||||||
"not ie 11"
|
|
||||||
]
|
|
||||||
}
|
|
Binary file not shown.
Before Width: | Height: | Size: 4.2 KiB |
@ -1,17 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
||||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
|
||||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<noscript>
|
|
||||||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
|
||||||
</noscript>
|
|
||||||
<div id="app"></div>
|
|
||||||
<!-- built files will be auto injected -->
|
|
||||||
</body>
|
|
||||||
</html>
|
|
26
src/App.vue
26
src/App.vue
@ -1,26 +0,0 @@
|
|||||||
<template>
|
|
||||||
<img alt="Vue logo" src="./assets/logo.png">
|
|
||||||
<HelloWorld msg="Welcome to Your Vue.js App"/>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import HelloWorld from './components/HelloWorld.vue'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'App',
|
|
||||||
components: {
|
|
||||||
HelloWorld
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
#app {
|
|
||||||
font-family: Avenir, Helvetica, Arial, sans-serif;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
-moz-osx-font-smoothing: grayscale;
|
|
||||||
text-align: center;
|
|
||||||
color: #2c3e50;
|
|
||||||
margin-top: 60px;
|
|
||||||
}
|
|
||||||
</style>
|
|
Binary file not shown.
Before Width: | Height: | Size: 6.7 KiB |
@ -1,58 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="hello">
|
|
||||||
<h1>{{ msg }}</h1>
|
|
||||||
<p>
|
|
||||||
For a guide and recipes on how to configure / customize this project,<br>
|
|
||||||
check out the
|
|
||||||
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
|
|
||||||
</p>
|
|
||||||
<h3>Installed CLI Plugins</h3>
|
|
||||||
<ul>
|
|
||||||
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
|
|
||||||
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
|
|
||||||
</ul>
|
|
||||||
<h3>Essential Links</h3>
|
|
||||||
<ul>
|
|
||||||
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
|
|
||||||
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
|
|
||||||
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
|
|
||||||
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
|
|
||||||
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
|
|
||||||
</ul>
|
|
||||||
<h3>Ecosystem</h3>
|
|
||||||
<ul>
|
|
||||||
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
|
|
||||||
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
|
|
||||||
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
|
|
||||||
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
|
|
||||||
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'HelloWorld',
|
|
||||||
props: {
|
|
||||||
msg: String
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
|
||||||
<style scoped>
|
|
||||||
h3 {
|
|
||||||
margin: 40px 0 0;
|
|
||||||
}
|
|
||||||
ul {
|
|
||||||
list-style-type: none;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
li {
|
|
||||||
display: inline-block;
|
|
||||||
margin: 0 10px;
|
|
||||||
}
|
|
||||||
a {
|
|
||||||
color: #42b983;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,4 +0,0 @@
|
|||||||
import { createApp } from 'vue'
|
|
||||||
import App from './App.vue'
|
|
||||||
|
|
||||||
createApp(App).mount('#app')
|
|
@ -1,4 +0,0 @@
|
|||||||
const { defineConfig } = require('@vue/cli-service')
|
|
||||||
module.exports = defineConfig({
|
|
||||||
transpileDependencies: true
|
|
||||||
})
|
|
Loading…
Reference in New Issue
Block a user