teenie.jo

add sample project code

Showing 55 changed files with 1181 additions and 0 deletions
1 +# Logs
2 +logs
3 +*.log
4 +npm-debug.log*
5 +yarn-debug.log*
6 +yarn-error.log*
7 +
8 +# Runtime data
9 +pids
10 +*.pid
11 +*.seed
12 +*.pid.lock
13 +
14 +# Directory for instrumented libs generated by jscoverage/JSCover
15 +lib-cov
16 +
17 +# Coverage directory used by tools like istanbul
18 +coverage
19 +
20 +# nyc test coverage
21 +.nyc_output
22 +
23 +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24 +.grunt
25 +
26 +# Bower dependency directory (https://bower.io/)
27 +bower_components
28 +
29 +# node-waf configuration
30 +.lock-wscript
31 +
32 +# Compiled binary addons (https://nodejs.org/api/addons.html)
33 +build/Release
34 +
35 +# Dependency directories
36 +node_modules/
37 +jspm_packages/
38 +
39 +# TypeScript v1 declaration files
40 +typings/
41 +
42 +# Optional npm cache directory
43 +.npm
44 +
45 +# Optional eslint cache
46 +.eslintcache
47 +
48 +# Optional REPL history
49 +.node_repl_history
50 +
51 +# Output of 'npm pack'
52 +*.tgz
53 +
54 +# Yarn Integrity file
55 +.yarn-integrity
56 +
57 +# dotenv environment variables file
58 +.env
59 +
60 +# next.js build output
61 +.next
62 +dist
63 +
64 +# Editor directories and files
65 +.idea
66 +.vscode
67 +*.suo
68 +*.ntvs*
69 +*.njsproj
70 +*.sln
71 +*.sw?
72 +.DS_Store
1 +{
2 + "extends": [
3 + "react-important-stuff",
4 + "plugin:prettier/recommended"
5 + ],
6 + "parser": "babel-eslint"
7 +}
1 +# Logs
2 +logs
3 +*.log
4 +npm-debug.log*
5 +yarn-debug.log*
6 +yarn-error.log*
7 +
8 +# Runtime data
9 +pids
10 +*.pid
11 +*.seed
12 +*.pid.lock
13 +
14 +# Directory for instrumented libs generated by jscoverage/JSCover
15 +lib-cov
16 +
17 +# Coverage directory used by tools like istanbul
18 +coverage
19 +
20 +# nyc test coverage
21 +.nyc_output
22 +
23 +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24 +.grunt
25 +
26 +# Bower dependency directory (https://bower.io/)
27 +bower_components
28 +
29 +# node-waf configuration
30 +.lock-wscript
31 +
32 +# Compiled binary addons (https://nodejs.org/api/addons.html)
33 +build/Release
34 +
35 +# Dependency directories
36 +node_modules/
37 +jspm_packages/
38 +
39 +# TypeScript v1 declaration files
40 +typings/
41 +
42 +# Optional npm cache directory
43 +.npm
44 +
45 +# Optional eslint cache
46 +.eslintcache
47 +
48 +# Optional REPL history
49 +.node_repl_history
50 +
51 +# Output of 'npm pack'
52 +*.tgz
53 +
54 +# Yarn Integrity file
55 +.yarn-integrity
56 +
57 +# dotenv environment variables file
58 +.env
59 +
60 +# next.js build output
61 +.next
62 +dist
63 +
64 +# Editor directories and files
65 +.idea
66 +.vscode
67 +*.suo
68 +*.ntvs*
69 +*.njsproj
70 +*.sln
71 +*.sw?
72 +.DS_Store
1 +.gitignore
2 +.prettierignore
3 +yarn.lock
4 +yarn-error.log
5 +package-lock.json
6 +dist
...\ No newline at end of file ...\ No newline at end of file
1 +{
2 + "presets": ["@babel/preset-env", "@babel/preset-react"],
3 + "plugins": [
4 + [
5 + "@babel/plugin-transform-runtime",
6 + {
7 + "useESModules": true,
8 + "regenerator": false
9 + }
10 + ]
11 + ],
12 + "env": {
13 + "test": {
14 + "presets": [
15 + [
16 + "@babel/preset-env",
17 + {
18 + "targets": "current node"
19 + }
20 + ]
21 + ]
22 + }
23 + }
24 +}
1 +module.exports = {
2 + rootDir: "src",
3 + transform: {
4 + "^.+\\.(j|t)sx?$": "babel-jest",
5 + },
6 + moduleNameMapper: {
7 + "\\.(css)$": "identity-obj-proxy",
8 + },
9 + setupFilesAfterEnv: [
10 + "../node_modules/@testing-library/jest-dom/dist/index.js",
11 + ],
12 +};
1 +{
2 + "name": "@capstone-design/comment",
3 + "scripts": {
4 + "start": "webpack-dev-server",
5 + "build": "webpack --mode=production",
6 + "analyze": "webpack --mode=production --env.analyze=true",
7 + "lint": "eslint src --ext js",
8 + "format": "prettier --write \"./**\"",
9 + "test": "cross-env BABEL_ENV=test jest",
10 + "watch-tests": "cross-env BABEL_ENV=test jest --watch",
11 + "coverage": "cross-env BABEL_ENV=test jest --coverage"
12 + },
13 + "devDependencies": {
14 + "@babel/core": "^7.7.5",
15 + "@babel/plugin-transform-runtime": "^7.8.3",
16 + "@babel/preset-env": "^7.7.6",
17 + "@babel/preset-react": "^7.7.4",
18 + "@babel/runtime": "^7.8.7",
19 + "@testing-library/jest-dom": "^5.5.0",
20 + "@testing-library/react": "^9.4.0",
21 + "@types/jest": "^25.2.1",
22 + "@types/systemjs": "^6.1.0",
23 + "babel-eslint": "^11.0.0-beta.2",
24 + "babel-jest": "^24.9.0",
25 + "concurrently": "^5.0.1",
26 + "cross-env": "^7.0.2",
27 + "eslint": "^6.7.2",
28 + "eslint-config-prettier": "^6.7.0",
29 + "eslint-config-react-important-stuff": "^2.0.0",
30 + "eslint-plugin-prettier": "^3.1.1",
31 + "husky": "^3.1.0",
32 + "identity-obj-proxy": "^3.0.0",
33 + "jest": "^25.2.7",
34 + "jest-cli": "^25.2.7",
35 + "prettier": "^2.0.4",
36 + "pretty-quick": "^2.0.1",
37 + "single-spa-react": "^2.14.0",
38 + "systemjs-webpack-interop": "^2.1.2",
39 + "webpack": "^4.41.2",
40 + "webpack-cli": "^3.3.10",
41 + "webpack-config-single-spa-react": "^1.0.3",
42 + "webpack-dev-server": "^3.9.0",
43 + "webpack-merge": "^4.2.2"
44 + },
45 + "dependencies": {
46 + "react": "^16.12.0",
47 + "react-dom": "^16.12.0"
48 + }
49 +}
1 +import "./set-public-path";
2 +import React from "react";
3 +import ReactDOM from "react-dom";
4 +import singleSpaReact from "single-spa-react";
5 +import Root from "./root.component";
6 +
7 +const lifecycles = singleSpaReact({
8 + React,
9 + ReactDOM,
10 + rootComponent: Root,
11 + errorBoundary(err, info, props) {
12 + // Customize the root error boundary for your microfrontend here.
13 + return null;
14 + },
15 +});
16 +
17 +export const { bootstrap, mount, unmount } = lifecycles;
1 +import React from "react";
2 +
3 +export default function Root(props) {
4 + return <div>댓글 컴포넌트</div>;
5 +}
1 +import { setPublicPath } from "systemjs-webpack-interop";
2 +
3 +setPublicPath("@capstone-design/comment");
1 +const webpackMerge = require("webpack-merge");
2 +const singleSpaDefaults = require("webpack-config-single-spa-react");
3 +
4 +module.exports = (webpackConfigEnv) => {
5 + const defaultConfig = singleSpaDefaults({
6 + orgName: "capstone-design",
7 + projectName: "comment",
8 + webpackConfigEnv,
9 + });
10 +
11 + return webpackMerge.smart(defaultConfig, {
12 + // modify the webpack config however you'd like to by adding to this object
13 + });
14 +};
This diff could not be displayed because it is too large.
1 +{
2 + "extends": [
3 + "react-important-stuff",
4 + "plugin:prettier/recommended"
5 + ],
6 + "parser": "babel-eslint"
7 +}
1 +# Logs
2 +logs
3 +*.log
4 +npm-debug.log*
5 +yarn-debug.log*
6 +yarn-error.log*
7 +
8 +# Runtime data
9 +pids
10 +*.pid
11 +*.seed
12 +*.pid.lock
13 +
14 +# Directory for instrumented libs generated by jscoverage/JSCover
15 +lib-cov
16 +
17 +# Coverage directory used by tools like istanbul
18 +coverage
19 +
20 +# nyc test coverage
21 +.nyc_output
22 +
23 +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24 +.grunt
25 +
26 +# Bower dependency directory (https://bower.io/)
27 +bower_components
28 +
29 +# node-waf configuration
30 +.lock-wscript
31 +
32 +# Compiled binary addons (https://nodejs.org/api/addons.html)
33 +build/Release
34 +
35 +# Dependency directories
36 +node_modules/
37 +jspm_packages/
38 +
39 +# TypeScript v1 declaration files
40 +typings/
41 +
42 +# Optional npm cache directory
43 +.npm
44 +
45 +# Optional eslint cache
46 +.eslintcache
47 +
48 +# Optional REPL history
49 +.node_repl_history
50 +
51 +# Output of 'npm pack'
52 +*.tgz
53 +
54 +# Yarn Integrity file
55 +.yarn-integrity
56 +
57 +# dotenv environment variables file
58 +.env
59 +
60 +# next.js build output
61 +.next
62 +dist
63 +
64 +# Editor directories and files
65 +.idea
66 +.vscode
67 +*.suo
68 +*.ntvs*
69 +*.njsproj
70 +*.sln
71 +*.sw?
72 +.DS_Store
1 +.gitignore
2 +.prettierignore
3 +yarn.lock
4 +yarn-error.log
5 +package-lock.json
6 +dist
...\ No newline at end of file ...\ No newline at end of file
1 +{
2 + "presets": [
3 + "@babel/preset-env",
4 + "@babel/preset-react",
5 + ],
6 + "plugins": [
7 + [
8 + "@babel/plugin-transform-runtime",
9 + {
10 + "useESModules": true,
11 + "regenerator": false
12 + }
13 + ]
14 + ],
15 + "env": {
16 + "test": {
17 + "presets": [
18 + ["@babel/preset-env", {
19 + "targets": "current node"
20 + }]
21 + ]
22 + }
23 + }
24 +}
1 +module.exports = {
2 + rootDir: "src",
3 + transform: {
4 + "^.+\\.(j|t)sx?$": "babel-jest",
5 + },
6 + moduleNameMapper: {
7 + "\\.(css)$": "identity-obj-proxy",
8 + },
9 + setupFilesAfterEnv: [
10 + "../node_modules/@testing-library/jest-dom/dist/index.js",
11 + ],
12 +};
1 +{
2 + "name": "@capstone-design/navbar",
3 + "scripts": {
4 + "start": "webpack-dev-server",
5 + "build": "webpack --mode=production",
6 + "analyze": "webpack --mode=production --env.analyze=true",
7 + "lint": "eslint src --ext js",
8 + "format": "prettier --write \"./**\"",
9 + "test": "cross-env BABEL_ENV=test jest",
10 + "watch-tests": "cross-env BABEL_ENV=test jest --watch",
11 + "coverage": "cross-env BABEL_ENV=test jest --coverage"
12 + },
13 + "devDependencies": {
14 + "@babel/core": "^7.7.5",
15 + "@babel/plugin-transform-runtime": "^7.8.3",
16 + "@babel/preset-env": "^7.7.6",
17 + "@babel/preset-react": "^7.7.4",
18 + "@babel/runtime": "^7.8.7",
19 + "@testing-library/jest-dom": "^5.5.0",
20 + "@testing-library/react": "^9.4.0",
21 + "@types/jest": "^25.2.1",
22 + "@types/systemjs": "^6.1.0",
23 + "babel-eslint": "^11.0.0-beta.2",
24 + "babel-jest": "^24.9.0",
25 + "concurrently": "^5.0.1",
26 + "cross-env": "^7.0.2",
27 + "eslint": "^6.7.2",
28 + "eslint-config-prettier": "^6.7.0",
29 + "eslint-config-react-important-stuff": "^2.0.0",
30 + "eslint-plugin-prettier": "^3.1.1",
31 + "husky": "^3.1.0",
32 + "identity-obj-proxy": "^3.0.0",
33 + "jest": "^25.2.7",
34 + "jest-cli": "^25.2.7",
35 + "prettier": "^2.0.4",
36 + "pretty-quick": "^2.0.1",
37 + "single-spa-react": "^2.14.0",
38 + "systemjs-webpack-interop": "^2.1.2",
39 + "webpack": "^4.41.2",
40 + "webpack-cli": "^3.3.10",
41 + "webpack-config-single-spa-react": "^1.0.3",
42 + "webpack-dev-server": "^3.9.0",
43 + "webpack-merge": "^4.2.2"
44 + },
45 + "dependencies": {
46 + "react": "^16.12.0",
47 + "react-dom": "^16.12.0"
48 + }
49 +}
1 +import "./set-public-path";
2 +import React from "react";
3 +import ReactDOM from "react-dom";
4 +import singleSpaReact from "single-spa-react";
5 +import Root from "./root.component";
6 +
7 +const lifecycles = singleSpaReact({
8 + React,
9 + ReactDOM,
10 + rootComponent: Root,
11 + errorBoundary(err, info, props) {
12 + // Customize the root error boundary for your microfrontend here.
13 + return null;
14 + },
15 +});
16 +
17 +export const { bootstrap, mount, unmount } = lifecycles;
1 +import React from "react";
2 +
3 +export default function Root(props) {
4 + return <div>상단 네비게이션 컴포넌트</div>;
5 +}
1 +import { setPublicPath } from "systemjs-webpack-interop";
2 +
3 +setPublicPath("@capstone-design/navbar");
1 +const webpackMerge = require("webpack-merge");
2 +const singleSpaDefaults = require("webpack-config-single-spa-react");
3 +
4 +module.exports = (webpackConfigEnv) => {
5 + const defaultConfig = singleSpaDefaults({
6 + orgName: "capstone-design",
7 + projectName: "navbar",
8 + webpackConfigEnv,
9 + });
10 +
11 + return webpackMerge.smart(defaultConfig, {
12 + // modify the webpack config however you'd like to by adding to this object
13 + });
14 +};
This diff could not be displayed because it is too large.
1 +{
2 + "extends": [
3 + "react-important-stuff",
4 + "plugin:prettier/recommended"
5 + ],
6 + "parser": "babel-eslint"
7 +}
1 +# Logs
2 +logs
3 +*.log
4 +npm-debug.log*
5 +yarn-debug.log*
6 +yarn-error.log*
7 +
8 +# Runtime data
9 +pids
10 +*.pid
11 +*.seed
12 +*.pid.lock
13 +
14 +# Directory for instrumented libs generated by jscoverage/JSCover
15 +lib-cov
16 +
17 +# Coverage directory used by tools like istanbul
18 +coverage
19 +
20 +# nyc test coverage
21 +.nyc_output
22 +
23 +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24 +.grunt
25 +
26 +# Bower dependency directory (https://bower.io/)
27 +bower_components
28 +
29 +# node-waf configuration
30 +.lock-wscript
31 +
32 +# Compiled binary addons (https://nodejs.org/api/addons.html)
33 +build/Release
34 +
35 +# Dependency directories
36 +node_modules/
37 +jspm_packages/
38 +
39 +# TypeScript v1 declaration files
40 +typings/
41 +
42 +# Optional npm cache directory
43 +.npm
44 +
45 +# Optional eslint cache
46 +.eslintcache
47 +
48 +# Optional REPL history
49 +.node_repl_history
50 +
51 +# Output of 'npm pack'
52 +*.tgz
53 +
54 +# Yarn Integrity file
55 +.yarn-integrity
56 +
57 +# dotenv environment variables file
58 +.env
59 +
60 +# next.js build output
61 +.next
62 +dist
63 +
64 +# Editor directories and files
65 +.idea
66 +.vscode
67 +*.suo
68 +*.ntvs*
69 +*.njsproj
70 +*.sln
71 +*.sw?
72 +.DS_Store
1 +.gitignore
2 +.prettierignore
3 +yarn.lock
4 +yarn-error.log
5 +package-lock.json
6 +dist
...\ No newline at end of file ...\ No newline at end of file
1 +{
2 + "presets": [
3 + "@babel/preset-env",
4 + "@babel/preset-react",
5 + ],
6 + "plugins": [
7 + [
8 + "@babel/plugin-transform-runtime",
9 + {
10 + "useESModules": true,
11 + "regenerator": false
12 + }
13 + ]
14 + ],
15 + "env": {
16 + "test": {
17 + "presets": [
18 + ["@babel/preset-env", {
19 + "targets": "current node"
20 + }]
21 + ]
22 + }
23 + }
24 +}
1 +module.exports = {
2 + rootDir: "src",
3 + transform: {
4 + "^.+\\.(j|t)sx?$": "babel-jest",
5 + },
6 + moduleNameMapper: {
7 + "\\.(css)$": "identity-obj-proxy",
8 + },
9 + setupFilesAfterEnv: [
10 + "../node_modules/@testing-library/jest-dom/dist/index.js",
11 + ],
12 +};
1 +{
2 + "name": "@capstone-design/news",
3 + "scripts": {
4 + "start": "webpack-dev-server",
5 + "build": "webpack --mode=production",
6 + "analyze": "webpack --mode=production --env.analyze=true",
7 + "lint": "eslint src --ext js",
8 + "format": "prettier --write \"./**\"",
9 + "test": "cross-env BABEL_ENV=test jest",
10 + "watch-tests": "cross-env BABEL_ENV=test jest --watch",
11 + "coverage": "cross-env BABEL_ENV=test jest --coverage"
12 + },
13 + "devDependencies": {
14 + "@babel/core": "^7.7.5",
15 + "@babel/plugin-transform-runtime": "^7.8.3",
16 + "@babel/preset-env": "^7.7.6",
17 + "@babel/preset-react": "^7.7.4",
18 + "@babel/runtime": "^7.8.7",
19 + "@testing-library/jest-dom": "^5.5.0",
20 + "@testing-library/react": "^9.4.0",
21 + "@types/jest": "^25.2.1",
22 + "@types/systemjs": "^6.1.0",
23 + "babel-eslint": "^11.0.0-beta.2",
24 + "babel-jest": "^24.9.0",
25 + "concurrently": "^5.0.1",
26 + "cross-env": "^7.0.2",
27 + "eslint": "^6.7.2",
28 + "eslint-config-prettier": "^6.7.0",
29 + "eslint-config-react-important-stuff": "^2.0.0",
30 + "eslint-plugin-prettier": "^3.1.1",
31 + "husky": "^3.1.0",
32 + "identity-obj-proxy": "^3.0.0",
33 + "jest": "^25.2.7",
34 + "jest-cli": "^25.2.7",
35 + "prettier": "^2.0.4",
36 + "pretty-quick": "^2.0.1",
37 + "single-spa-react": "^2.14.0",
38 + "systemjs-webpack-interop": "^2.1.2",
39 + "webpack": "^4.41.2",
40 + "webpack-cli": "^3.3.10",
41 + "webpack-config-single-spa-react": "^1.0.3",
42 + "webpack-dev-server": "^3.9.0",
43 + "webpack-merge": "^4.2.2"
44 + },
45 + "dependencies": {
46 + "react": "^16.12.0",
47 + "react-dom": "^16.12.0"
48 + }
49 +}
1 +import "./set-public-path";
2 +import React from "react";
3 +import ReactDOM from "react-dom";
4 +import singleSpaReact from "single-spa-react";
5 +import Root from "./root.component";
6 +
7 +const lifecycles = singleSpaReact({
8 + React,
9 + ReactDOM,
10 + rootComponent: Root,
11 + errorBoundary(err, info, props) {
12 + // Customize the root error boundary for your microfrontend here.
13 + return null;
14 + },
15 +});
16 +
17 +export const { bootstrap, mount, unmount } = lifecycles;
1 +import React from "react";
2 +
3 +export default function Root(props) {
4 + return <div>뉴스 본문 컴포넌트</div>;
5 +}
1 +import { setPublicPath } from "systemjs-webpack-interop";
2 +
3 +setPublicPath("@capstone-design/news");
1 +const webpackMerge = require("webpack-merge");
2 +const singleSpaDefaults = require("webpack-config-single-spa-react");
3 +
4 +module.exports = (webpackConfigEnv) => {
5 + const defaultConfig = singleSpaDefaults({
6 + orgName: "capstone-design",
7 + projectName: "news",
8 + webpackConfigEnv,
9 + });
10 +
11 + return webpackMerge.smart(defaultConfig, {
12 + // modify the webpack config however you'd like to by adding to this object
13 + });
14 +};
This diff could not be displayed because it is too large.
1 +{
2 + "extends": [
3 + "react-important-stuff",
4 + "plugin:prettier/recommended"
5 + ],
6 + "parser": "babel-eslint"
7 +}
1 +# Logs
2 +logs
3 +*.log
4 +npm-debug.log*
5 +yarn-debug.log*
6 +yarn-error.log*
7 +
8 +# Runtime data
9 +pids
10 +*.pid
11 +*.seed
12 +*.pid.lock
13 +
14 +# Directory for instrumented libs generated by jscoverage/JSCover
15 +lib-cov
16 +
17 +# Coverage directory used by tools like istanbul
18 +coverage
19 +
20 +# nyc test coverage
21 +.nyc_output
22 +
23 +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24 +.grunt
25 +
26 +# Bower dependency directory (https://bower.io/)
27 +bower_components
28 +
29 +# node-waf configuration
30 +.lock-wscript
31 +
32 +# Compiled binary addons (https://nodejs.org/api/addons.html)
33 +build/Release
34 +
35 +# Dependency directories
36 +node_modules/
37 +jspm_packages/
38 +
39 +# TypeScript v1 declaration files
40 +typings/
41 +
42 +# Optional npm cache directory
43 +.npm
44 +
45 +# Optional eslint cache
46 +.eslintcache
47 +
48 +# Optional REPL history
49 +.node_repl_history
50 +
51 +# Output of 'npm pack'
52 +*.tgz
53 +
54 +# Yarn Integrity file
55 +.yarn-integrity
56 +
57 +# dotenv environment variables file
58 +.env
59 +
60 +# next.js build output
61 +.next
62 +dist
63 +
64 +# Editor directories and files
65 +.idea
66 +.vscode
67 +*.suo
68 +*.ntvs*
69 +*.njsproj
70 +*.sln
71 +*.sw?
72 +.DS_Store
1 +.gitignore
2 +.prettierignore
3 +yarn.lock
4 +yarn-error.log
5 +package-lock.json
6 +dist
...\ No newline at end of file ...\ No newline at end of file
1 +{
2 + "presets": [
3 + "@babel/preset-env",
4 + "@babel/preset-react",
5 + ],
6 + "plugins": [
7 + [
8 + "@babel/plugin-transform-runtime",
9 + {
10 + "useESModules": true,
11 + "regenerator": false
12 + }
13 + ]
14 + ],
15 + "env": {
16 + "test": {
17 + "presets": [
18 + ["@babel/preset-env", {
19 + "targets": "current node"
20 + }]
21 + ]
22 + }
23 + }
24 +}
1 +module.exports = {
2 + rootDir: "src",
3 + transform: {
4 + "^.+\\.(j|t)sx?$": "babel-jest",
5 + },
6 + moduleNameMapper: {
7 + "\\.(css)$": "identity-obj-proxy",
8 + },
9 + setupFilesAfterEnv: [
10 + "../node_modules/@testing-library/jest-dom/dist/index.js",
11 + ],
12 +};
1 +{
2 + "name": "@capstone-design/recommend",
3 + "scripts": {
4 + "start": "webpack-dev-server",
5 + "build": "webpack --mode=production",
6 + "analyze": "webpack --mode=production --env.analyze=true",
7 + "lint": "eslint src --ext js",
8 + "format": "prettier --write \"./**\"",
9 + "test": "cross-env BABEL_ENV=test jest",
10 + "watch-tests": "cross-env BABEL_ENV=test jest --watch",
11 + "coverage": "cross-env BABEL_ENV=test jest --coverage"
12 + },
13 + "devDependencies": {
14 + "@babel/core": "^7.7.5",
15 + "@babel/plugin-transform-runtime": "^7.8.3",
16 + "@babel/preset-env": "^7.7.6",
17 + "@babel/preset-react": "^7.7.4",
18 + "@babel/runtime": "^7.8.7",
19 + "@testing-library/jest-dom": "^5.5.0",
20 + "@testing-library/react": "^9.4.0",
21 + "@types/jest": "^25.2.1",
22 + "@types/systemjs": "^6.1.0",
23 + "babel-eslint": "^11.0.0-beta.2",
24 + "babel-jest": "^24.9.0",
25 + "concurrently": "^5.0.1",
26 + "cross-env": "^7.0.2",
27 + "eslint": "^6.7.2",
28 + "eslint-config-prettier": "^6.7.0",
29 + "eslint-config-react-important-stuff": "^2.0.0",
30 + "eslint-plugin-prettier": "^3.1.1",
31 + "husky": "^3.1.0",
32 + "identity-obj-proxy": "^3.0.0",
33 + "jest": "^25.2.7",
34 + "jest-cli": "^25.2.7",
35 + "prettier": "^2.0.4",
36 + "pretty-quick": "^2.0.1",
37 + "single-spa-react": "^2.14.0",
38 + "systemjs-webpack-interop": "^2.1.2",
39 + "webpack": "^4.41.2",
40 + "webpack-cli": "^3.3.10",
41 + "webpack-config-single-spa-react": "^1.0.3",
42 + "webpack-dev-server": "^3.9.0",
43 + "webpack-merge": "^4.2.2"
44 + },
45 + "dependencies": {
46 + "react": "^16.12.0",
47 + "react-dom": "^16.12.0"
48 + }
49 +}
1 +import "./set-public-path";
2 +import React from "react";
3 +import ReactDOM from "react-dom";
4 +import singleSpaReact from "single-spa-react";
5 +import Root from "./root.component";
6 +
7 +const lifecycles = singleSpaReact({
8 + React,
9 + ReactDOM,
10 + rootComponent: Root,
11 + errorBoundary(err, info, props) {
12 + // Customize the root error boundary for your microfrontend here.
13 + return null;
14 + },
15 +});
16 +
17 +export const { bootstrap, mount, unmount } = lifecycles;
1 +import React from "react";
2 +
3 +export default function Root(props) {
4 + return <div>뉴스 추천 컴포넌트</div>;
5 +}
1 +import { setPublicPath } from "systemjs-webpack-interop";
2 +
3 +setPublicPath("@capstone-design/recommend");
1 +const webpackMerge = require("webpack-merge");
2 +const singleSpaDefaults = require("webpack-config-single-spa-react");
3 +
4 +module.exports = (webpackConfigEnv) => {
5 + const defaultConfig = singleSpaDefaults({
6 + orgName: "capstone-design",
7 + projectName: "recommend",
8 + webpackConfigEnv,
9 + });
10 +
11 + return webpackMerge.smart(defaultConfig, {
12 + // modify the webpack config however you'd like to by adding to this object
13 + });
14 +};
This diff could not be displayed because it is too large.
1 +{
2 + "extends": ["important-stuff", "plugin:prettier/recommended"],
3 + "parser": "babel-eslint"
4 +}
1 +# Logs
2 +logs
3 +*.log
4 +npm-debug.log*
5 +yarn-debug.log*
6 +yarn-error.log*
7 +
8 +# Runtime data
9 +pids
10 +*.pid
11 +*.seed
12 +*.pid.lock
13 +
14 +# Directory for instrumented libs generated by jscoverage/JSCover
15 +lib-cov
16 +
17 +# Coverage directory used by tools like istanbul
18 +coverage
19 +
20 +# nyc test coverage
21 +.nyc_output
22 +
23 +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24 +.grunt
25 +
26 +# Bower dependency directory (https://bower.io/)
27 +bower_components
28 +
29 +# node-waf configuration
30 +.lock-wscript
31 +
32 +# Compiled binary addons (https://nodejs.org/api/addons.html)
33 +build/Release
34 +
35 +# Dependency directories
36 +node_modules/
37 +jspm_packages/
38 +
39 +# TypeScript v1 declaration files
40 +typings/
41 +
42 +# Optional npm cache directory
43 +.npm
44 +
45 +# Optional eslint cache
46 +.eslintcache
47 +
48 +# Optional REPL history
49 +.node_repl_history
50 +
51 +# Output of 'npm pack'
52 +*.tgz
53 +
54 +# Yarn Integrity file
55 +.yarn-integrity
56 +
57 +# dotenv environment variables file
58 +.env
59 +
60 +# next.js build output
61 +.next
62 +dist
63 +
64 +# Editor directories and files
65 +.idea
66 +.vscode
67 +*.suo
68 +*.ntvs*
69 +*.njsproj
70 +*.sln
71 +*.sw?
72 +.DS_Store
1 +.gitignore
2 +.prettierignore
3 +yarn.lock
4 +yarn-error.log
5 +package-lock.json
6 +LICENSE
7 +*.ejs
8 +dist
...\ No newline at end of file ...\ No newline at end of file
1 +{
2 + "presets": [
3 + "@babel/preset-env",
4 + ],
5 + "plugins": [
6 + [
7 + "@babel/plugin-transform-runtime",
8 + {
9 + "useESModules": true,
10 + "regenerator": false
11 + }
12 + ]
13 + ],
14 + "env": {
15 + "test": {
16 + "presets": [
17 + ["@babel/preset-env", {
18 + "targets": "current node"
19 + }]
20 + ]
21 + }
22 + }
23 +}
1 +{
2 + "name": "@capstone-design/root",
3 + "scripts": {
4 + "start": "webpack-dev-server --mode=development --port 9000 --env.isLocal=true",
5 + "lint": "eslint src --ext js",
6 + "test": "cross-env BABEL_ENV=test jest --passWithNoTests",
7 + "format": "prettier --write \"./**\"",
8 + "build": "webpack --mode=production"
9 + },
10 + "devDependencies": {
11 + "@babel/core": "^7.7.4",
12 + "@babel/plugin-transform-runtime": "^7.8.3",
13 + "@babel/preset-env": "^7.7.4",
14 + "@babel/runtime": "^7.8.7",
15 + "@types/jest": "^25.2.1",
16 + "@types/systemjs": "^6.1.0",
17 + "babel-eslint": "^11.0.0-beta.2",
18 + "concurrently": "^5.1.0",
19 + "cross-env": "^7.0.2",
20 + "eslint": "^6.7.2",
21 + "eslint-config-important-stuff": "^1.1.0",
22 + "eslint-config-prettier": "^6.7.0",
23 + "eslint-plugin-prettier": "^3.1.1",
24 + "html-webpack-plugin": "^4.0.4",
25 + "husky": "^4.2.3",
26 + "jest": "^25.2.7",
27 + "jest-cli": "^25.2.7",
28 + "prettier": "^2.0.4",
29 + "pretty-quick": "^2.0.1",
30 + "serve": "^11.2.0",
31 + "webpack": "^4.41.2",
32 + "webpack-cli": "^3.3.10",
33 + "webpack-config-single-spa": "^1.4.1",
34 + "webpack-dev-server": "^3.9.0",
35 + "webpack-merge": "^4.2.2"
36 + },
37 + "dependencies": {
38 + "single-spa": "^5.3.1"
39 + }
40 +}
1 +import { registerApplication, start } from "single-spa";
2 +
3 +registerApplication({
4 + name: "@capstone-design/navbar",
5 + app: () => System.import("@capstone-design/navbar"),
6 + activeWhen: ["/"],
7 +});
8 +
9 +registerApplication({
10 + name: "@capstone-design/news",
11 + app: () => System.import("@capstone-design/news"),
12 + activeWhen: [(location) => location.pathname === "/"],
13 +});
14 +
15 +registerApplication({
16 + name: "@capstone-design/comment",
17 + app: () => System.import("@capstone-design/comment"),
18 + activeWhen: ["/"],
19 +});
20 +
21 +registerApplication({
22 + name: "@capstone-design/recommend",
23 + app: () => System.import("@capstone-design/recommend"),
24 + activeWhen: ["/"],
25 +});
26 +
27 +start({
28 + urlRerouteOnly: true,
29 +});
1 +<!DOCTYPE html>
2 +<html lang="en">
3 +<head>
4 + <meta charset="UTF-8">
5 + <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 + <meta http-equiv="X-UA-Compatible" content="ie=edge">
7 + <title>Capstone Design</title>
8 + <meta http-equiv="Content-Security-Policy" content="default-src 'self' https: localhost:*; script-src 'unsafe-inline' https: localhost:*; connect-src https: localhost:* ws://localhost:*; style-src 'unsafe-inline' https:; object-src 'none';">
9 + <meta name="importmap-type" content="systemjs-importmap" />
10 + <script type="systemjs-importmap">
11 + {
12 + "imports": {
13 + "single-spa": "https://cdn.jsdelivr.net/npm/single-spa@5.5.5/lib/system/single-spa.min.js"
14 + }
15 + }
16 + </script>
17 + <% if (isLocal) { %>
18 + <script type="systemjs-importmap">
19 + {
20 + "imports": {
21 + "react": "https://cdn.jsdelivr.net/npm/react@16.13.1/umd/react.development.js",
22 + "react-dom": "https://cdn.jsdelivr.net/npm/react-dom@16.13.1/umd/react-dom.development.js",
23 + "@capstone-design/root": "http://localhost:9000/capstone-design-root.js",
24 + "@capstone-design/navbar": "http://localhost:9001/capstone-design-navbar.js",
25 + "@capstone-design/news": "http://localhost:9002/capstone-design-news.js",
26 + "@capstone-design/comment": "http://localhost:9003/capstone-design-comment.js",
27 + "@capstone-design/recommend": "http://localhost:9004/capstone-design-recommend.js"
28 + }
29 + }
30 + </script>
31 + <% } %>
32 + <link rel="preload" href="https://cdn.jsdelivr.net/npm/single-spa@5.5.5/lib/system/single-spa.min.js" as="script">
33 +
34 + <% if (isLocal) { %>
35 + <script type="systemjs-importmap">
36 + {
37 + "imports": {
38 + "@capstone-design/root": "//localhost:9000/capstone-design-root.js"
39 + }
40 + }
41 + </script>
42 + <% } %>
43 +
44 + <% if (isLocal) { %>
45 + <script src="https://cdn.jsdelivr.net/npm/import-map-overrides@1.16.0/dist/import-map-overrides.js"></script>
46 + <script src="https://cdn.jsdelivr.net/npm/systemjs@6.4.0/dist/system.js"></script>
47 + <script src="https://cdn.jsdelivr.net/npm/systemjs@6.4.0/dist/extras/amd.js"></script>
48 + <script src="https://cdn.jsdelivr.net/npm/systemjs@6.4.0/dist/extras/named-exports.js"></script>
49 + <% } else { %>
50 + <script src="https://cdn.jsdelivr.net/npm/import-map-overrides@1.16.0/dist/import-map-overrides.js"></script>
51 + <script src="https://cdn.jsdelivr.net/npm/systemjs@6.4.0/dist/system.min.js"></script>
52 + <script src="https://cdn.jsdelivr.net/npm/systemjs@6.4.0/dist/extras/amd.min.js"></script>
53 + <script src="https://cdn.jsdelivr.net/npm/systemjs@6.4.0/dist/extras/named-exports.min.js"></script>
54 + <% } %>
55 +</head>
56 +<body>
57 + <div id="single-spa-application:@capstone-design/navbar"></div>
58 + <div class="home" id="single-spa-application:@capstone-design/news"></div>
59 + <div class="comment" id="single-spa-application:@capstone-design/comment"></div>
60 + <div class="contact" id="single-spa-application:@capstone-design/recommend"></div>
61 +
62 + <script>
63 + System.import('@capstone-design/root');
64 + </script>
65 + <import-map-overrides-full show-when-local-storage="devtools" dev-libs></import-map-overrides-full>
66 +</body>
67 +</html>
1 +const webpackMerge = require("webpack-merge");
2 +const singleSpaDefaults = require("webpack-config-single-spa");
3 +const HtmlWebpackPlugin = require("html-webpack-plugin");
4 +
5 +module.exports = (webpackConfigEnv) => {
6 + const orgName = "capstone-design";
7 + const defaultConfig = singleSpaDefaults({
8 + orgName,
9 + projectName: "root",
10 + webpackConfigEnv,
11 + });
12 +
13 + return webpackMerge.smart(defaultConfig, {
14 + // modify the webpack config however you'd like to by adding to this object
15 + devServer: {
16 + historyApiFallback: true,
17 + },
18 + plugins: [
19 + new HtmlWebpackPlugin({
20 + inject: false,
21 + template: "src/index.ejs",
22 + templateParameters: {
23 + isLocal: webpackConfigEnv && webpackConfigEnv.isLocal === "true",
24 + orgName,
25 + },
26 + }),
27 + ],
28 + });
29 +};
This diff could not be displayed because it is too large.