Iniciant XaSuMu
This commit is contained in:
commit
ade8500740
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
node_modules/
|
||||
19
.meteor/.finished-upgraders
Normal file
19
.meteor/.finished-upgraders
Normal file
@ -0,0 +1,19 @@
|
||||
# This file contains information which helps Meteor properly upgrade your
|
||||
# app when you run 'meteor update'. You should check it into version control
|
||||
# with your project.
|
||||
|
||||
notices-for-0.9.0
|
||||
notices-for-0.9.1
|
||||
0.9.4-platform-file
|
||||
notices-for-facebook-graph-api-2
|
||||
1.2.0-standard-minifiers-package
|
||||
1.2.0-meteor-platform-split
|
||||
1.2.0-cordova-changes
|
||||
1.2.0-breaking-changes
|
||||
1.3.0-split-minifiers-package
|
||||
1.4.0-remove-old-dev-bundle-link
|
||||
1.4.1-add-shell-server-package
|
||||
1.4.3-split-account-service-packages
|
||||
1.5-add-dynamic-import-package
|
||||
1.7-split-underscore-from-meteor-base
|
||||
1.8.3-split-jquery-from-blaze
|
||||
1
.meteor/.gitignore
vendored
Normal file
1
.meteor/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
local
|
||||
7
.meteor/.id
Normal file
7
.meteor/.id
Normal file
@ -0,0 +1,7 @@
|
||||
# This file contains a token that is unique to your project.
|
||||
# Check it into your repository along with the rest of this directory.
|
||||
# It can be used for purposes such as:
|
||||
# - ensuring you don't accidentally deploy one app on top of another
|
||||
# - providing package authors with aggregated statistics
|
||||
|
||||
nurzindiwlol.c47yahddafsl
|
||||
21
.meteor/packages
Normal file
21
.meteor/packages
Normal file
@ -0,0 +1,21 @@
|
||||
# Meteor packages used by this project, one per line.
|
||||
# Check this file (and the other files in this directory) into your repository.
|
||||
#
|
||||
# 'meteor add' and 'meteor remove' will edit this file for you,
|
||||
# but you can also edit it by hand.
|
||||
|
||||
meteor-base@1.5.2 # Packages every Meteor app needs to have
|
||||
mobile-experience@1.1.2 # Packages for a great mobile UX
|
||||
mongo@2.0.2 # The database Meteor supports right now
|
||||
reactive-var@1.0.13 # Reactive variable for tracker
|
||||
|
||||
standard-minifier-css@1.9.3 # CSS minifier run for production mode
|
||||
standard-minifier-js@3.0.0 # JS minifier run for production mode
|
||||
es5-shim@4.8.1 # ECMAScript 5 compatibility for older browsers
|
||||
ecmascript@0.16.9 # Enable ECMAScript2015+ syntax in app code
|
||||
typescript@5.4.3 # Enable TypeScript syntax in .ts and .tsx modules
|
||||
shell-server@0.6.0 # Server-side component of the `meteor shell` command
|
||||
hot-module-replacement@0.5.4 # Update client in development without reloading the page
|
||||
|
||||
static-html@1.4.0 # Define static page content in .html files
|
||||
react-meteor-data # React higher-order component for reactively tracking Meteor data
|
||||
2
.meteor/platforms
Normal file
2
.meteor/platforms
Normal file
@ -0,0 +1,2 @@
|
||||
server
|
||||
browser
|
||||
1
.meteor/release
Normal file
1
.meteor/release
Normal file
@ -0,0 +1 @@
|
||||
METEOR@3.0.4
|
||||
68
.meteor/versions
Normal file
68
.meteor/versions
Normal file
@ -0,0 +1,68 @@
|
||||
allow-deny@2.0.0
|
||||
autoupdate@2.0.0
|
||||
babel-compiler@7.11.1
|
||||
babel-runtime@1.5.2
|
||||
base64@1.0.13
|
||||
binary-heap@1.0.12
|
||||
boilerplate-generator@2.0.0
|
||||
caching-compiler@2.0.1
|
||||
callback-hook@1.6.0
|
||||
check@1.4.4
|
||||
core-runtime@1.0.0
|
||||
ddp@1.4.2
|
||||
ddp-client@3.0.2
|
||||
ddp-common@1.4.4
|
||||
ddp-server@3.0.2
|
||||
diff-sequence@1.1.3
|
||||
dynamic-import@0.7.4
|
||||
ecmascript@0.16.9
|
||||
ecmascript-runtime@0.8.3
|
||||
ecmascript-runtime-client@0.12.2
|
||||
ecmascript-runtime-server@0.11.1
|
||||
ejson@1.1.4
|
||||
es5-shim@4.8.1
|
||||
facts-base@1.0.2
|
||||
fetch@0.1.5
|
||||
geojson-utils@1.0.12
|
||||
hot-code-push@1.0.5
|
||||
hot-module-replacement@0.5.4
|
||||
id-map@1.2.0
|
||||
inter-process-messaging@0.1.2
|
||||
launch-screen@2.0.1
|
||||
logging@1.3.5
|
||||
meteor@2.0.1
|
||||
meteor-base@1.5.2
|
||||
minifier-css@2.0.0
|
||||
minifier-js@3.0.0
|
||||
minimongo@2.0.1
|
||||
mobile-experience@1.1.2
|
||||
mobile-status-bar@1.1.1
|
||||
modern-browsers@0.1.11
|
||||
modules@0.20.2
|
||||
modules-runtime@0.13.2
|
||||
modules-runtime-hot@0.14.3
|
||||
mongo@2.0.2
|
||||
mongo-decimal@0.1.4
|
||||
mongo-dev-server@1.1.1
|
||||
mongo-id@1.0.9
|
||||
npm-mongo@4.17.4
|
||||
ordered-dict@1.2.0
|
||||
promise@1.0.0
|
||||
random@1.2.2
|
||||
react-fast-refresh@0.2.9
|
||||
react-meteor-data@3.0.2
|
||||
reactive-var@1.0.13
|
||||
reload@1.3.2
|
||||
retry@1.1.1
|
||||
routepolicy@1.1.2
|
||||
shell-server@0.6.0
|
||||
socket-stream-client@0.5.3
|
||||
standard-minifier-css@1.9.3
|
||||
standard-minifier-js@3.0.0
|
||||
static-html@1.4.0
|
||||
static-html-tools@1.0.0
|
||||
tracker@1.3.4
|
||||
typescript@5.4.3
|
||||
underscore@1.6.4
|
||||
webapp@2.0.3
|
||||
webapp-hashing@1.1.2
|
||||
4
client/main.css
Normal file
4
client/main.css
Normal file
@ -0,0 +1,4 @@
|
||||
body {
|
||||
padding: 10px;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
7
client/main.html
Normal file
7
client/main.html
Normal file
@ -0,0 +1,7 @@
|
||||
<head>
|
||||
<title>Meteor App</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="react-target"></div>
|
||||
</body>
|
||||
10
client/main.jsx
Normal file
10
client/main.jsx
Normal file
@ -0,0 +1,10 @@
|
||||
import React from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { App } from '/imports/ui/App';
|
||||
|
||||
Meteor.startup(() => {
|
||||
const container = document.getElementById('react-target');
|
||||
const root = createRoot(container);
|
||||
root.render(<App />);
|
||||
});
|
||||
3
imports/api/links.js
Normal file
3
imports/api/links.js
Normal file
@ -0,0 +1,3 @@
|
||||
import { Mongo } from 'meteor/mongo';
|
||||
|
||||
export const LinksCollection = new Mongo.Collection('links');
|
||||
11
imports/ui/App.jsx
Normal file
11
imports/ui/App.jsx
Normal file
@ -0,0 +1,11 @@
|
||||
import React from 'react';
|
||||
import { Hello } from './Hello.jsx';
|
||||
import { Info } from './Info.jsx';
|
||||
|
||||
export const App = () => (
|
||||
<div>
|
||||
<h1>Welcome to Meteor!</h1>
|
||||
<Hello/>
|
||||
<Info/>
|
||||
</div>
|
||||
);
|
||||
16
imports/ui/Hello.jsx
Normal file
16
imports/ui/Hello.jsx
Normal file
@ -0,0 +1,16 @@
|
||||
import React, { useState } from 'react';
|
||||
|
||||
export const Hello = () => {
|
||||
const [counter, setCounter] = useState(0);
|
||||
|
||||
const increment = () => {
|
||||
setCounter(counter + 1);
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<button onClick={increment}>Click Me</button>
|
||||
<p>You've pressed the button {counter} times.</p>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
23
imports/ui/Info.jsx
Normal file
23
imports/ui/Info.jsx
Normal file
@ -0,0 +1,23 @@
|
||||
import React from 'react';
|
||||
import { useFind, useSubscribe } from 'meteor/react-meteor-data';
|
||||
import { LinksCollection } from '../api/links';
|
||||
|
||||
export const Info = () => {
|
||||
const isLoading = useSubscribe('links');
|
||||
const links = useFind(() => LinksCollection.find());
|
||||
|
||||
if(isLoading()) {
|
||||
return <div>Loading...</div>;
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h2>Learn Meteor!</h2>
|
||||
<ul>{links.map(
|
||||
link => <li key={link._id}>
|
||||
<a href={link.url} target="_blank">{link.title}</a>
|
||||
</li>
|
||||
)}</ul>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
1255
package-lock.json
generated
Normal file
1255
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
23
package.json
Normal file
23
package.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "meteor-app",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "meteor run",
|
||||
"test": "meteor test --once --driver-package meteortesting:mocha",
|
||||
"test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha",
|
||||
"visualize": "meteor --production --extra-packages bundle-visualizer"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.7",
|
||||
"meteor-node-stubs": "^1.2.5",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0"
|
||||
},
|
||||
"meteor": {
|
||||
"mainModule": {
|
||||
"client": "client/main.jsx",
|
||||
"server": "server/main.js"
|
||||
},
|
||||
"testModule": "tests/main.js"
|
||||
}
|
||||
}
|
||||
37
server/main.js
Normal file
37
server/main.js
Normal file
@ -0,0 +1,37 @@
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { LinksCollection } from '/imports/api/links';
|
||||
|
||||
async function insertLink({ title, url }) {
|
||||
await LinksCollection.insertAsync({ title, url, createdAt: new Date() });
|
||||
}
|
||||
|
||||
Meteor.startup(async () => {
|
||||
// If the Links collection is empty, add some data.
|
||||
if (await LinksCollection.find().countAsync() === 0) {
|
||||
await insertLink({
|
||||
title: 'Do the Tutorial',
|
||||
url: 'https://www.meteor.com/tutorials/react/creating-an-app',
|
||||
});
|
||||
|
||||
await insertLink({
|
||||
title: 'Follow the Guide',
|
||||
url: 'https://guide.meteor.com',
|
||||
});
|
||||
|
||||
await insertLink({
|
||||
title: 'Read the Docs',
|
||||
url: 'https://docs.meteor.com',
|
||||
});
|
||||
|
||||
await insertLink({
|
||||
title: 'Discussions',
|
||||
url: 'https://forums.meteor.com',
|
||||
});
|
||||
}
|
||||
|
||||
// We publish the entire Links collection to all clients.
|
||||
// In order to be fetched in real-time to the clients
|
||||
Meteor.publish("links", function () {
|
||||
return LinksCollection.find();
|
||||
});
|
||||
});
|
||||
20
tests/main.js
Normal file
20
tests/main.js
Normal file
@ -0,0 +1,20 @@
|
||||
import assert from "assert";
|
||||
|
||||
describe("meteor-app", function () {
|
||||
it("package.json has correct name", async function () {
|
||||
const { name } = await import("../package.json");
|
||||
assert.strictEqual(name, "meteor-app");
|
||||
});
|
||||
|
||||
if (Meteor.isClient) {
|
||||
it("client is not server", function () {
|
||||
assert.strictEqual(Meteor.isServer, false);
|
||||
});
|
||||
}
|
||||
|
||||
if (Meteor.isServer) {
|
||||
it("server is not client", function () {
|
||||
assert.strictEqual(Meteor.isClient, false);
|
||||
});
|
||||
}
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user