Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zuri plugin tools spa - The first PR of SPA format #506

Merged
merged 7 commits into from
Sep 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion client/.eslintignore

This file was deleted.

87 changes: 64 additions & 23 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -1,31 +1,72 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# dependencies
/node_modules
/.pnp
.pnp.js
# Runtime data
pids
*.pid
*.seed
*.pid.lock

# testing
/coverage
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# production
/build
.vercel
# Coverage directory used by tools like istanbul
coverage

.package.lock.
# nyc test coverage
.nyc_output

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

.yarn
# Dependency directories
node_modules/
jspm_packages/

# Local Netlify folder
.netlify
# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next
dist

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.DS_Store
4 changes: 4 additions & 0 deletions client/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn exec pretty-quick --staged && yarn exec concurrently yarn:test yarn:lint
8 changes: 8 additions & 0 deletions client/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.gitignore
.prettierignore
yarn.lock
yarn-error.log
package-lock.json
dist
coverage
pnpm-lock.yaml
29 changes: 29 additions & 0 deletions client/babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"presets": [
"@babel/preset-env",
[
"@babel/preset-react",
{
"runtime": "automatic"
}
],
],
"plugins": [
[
"@babel/plugin-transform-runtime",
{
"useESModules": true,
"regenerator": false
}
]
],
"env": {
"test": {
"presets": [
["@babel/preset-env", {
"targets": "current node"
}]
]
}
}
}
26 changes: 25 additions & 1 deletion client/craco.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,32 @@
// craco.config.js
singleSpaApplicationPlugin = require("craco-plugin-single-spa-application");

module.exports = {
style: {
postcss: {
plugins: [require("tailwindcss"), require("autoprefixer")],
},
},
devServer: {
headers: {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
"Access-Control-Allow-Headers":
"X-Requested-With, content-type, Authorization",
},
},
plugins: [
{
plugin: singleSpaApplicationPlugin,
options: {
orgName: "zuri",
projectName: "zuri-plugin-tools",
// entry: "src/index.js", //defaults to src/index.js,
entry: "src/zuri-zuri-plugin-tools.js", //defaults to src/index.js,
orgPackagesAsExternal: false, // defaults to false. marks packages that has @my-org prefix as external so they are not included in the bundle
reactPackagesAsExternal: true, // defaults to true. marks react and react-dom as external so they are not included in the bundle
externals: [], // defaults to []. marks the specified modules as external so they are not included in the bundle
minimize: false, // defaults to false, sets optimization.minimize value
},
},
],
};
12 changes: 12 additions & 0 deletions client/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
rootDir: "src",
testEnvironment: "jsdom",
transform: {
"^.+\\.(j|t)sx?$": "babel-jest",
},
moduleNameMapper: {
"\\.(css)$": "identity-obj-proxy",
"single-spa-react/parcel": "single-spa-react/lib/cjs/parcel.cjs",
},
setupFilesAfterEnv: ["@testing-library/jest-dom"],
};
Loading