Skip to content
Permalink
Browse files

[now-static-build][frameworks][examples] Fixes examples and adjust fr…

…ameworks (#3584)

* [examples] Fix ionic-react example

* [examples] Fix vue example

* [examples] Fix mithril example

* [examples] Fix riot example

* Fix readmes

* [now-static-build] Add Zola

* Add tests

* [now-build-utils][frameworks] Adjust detect framework

* Move zola back

* Undo Hugo detection changes

* [examples] Fix Vue logo path

* [now-static-build] Use package.json script if defined instead of framework command

* [now-static-build] Add buildCommand everywhere

* Remove devCommand from frameworks.ts

* Fix type

* Change output directory

* [now-static-build] Remove minNodeRange

* Remove devCommand
  • Loading branch information
AndyBitz committed Jan 15, 2020
1 parent 0a63bd4 commit 96dbc6d3483bd294bdaf55edb681aaa911c5e2b3
Showing with 2,051 additions and 3,605 deletions.
  1. +1 −1 examples/angular/README.md
  2. +1 −1 examples/create-react-app/README.md
  3. +1 −1 examples/docusaurus/README.md
  4. +1 −1 examples/eleventy/README.md
  5. +1 −1 examples/ember/README.md
  6. +1 −1 examples/gatsby/README.md
  7. +1 −1 examples/gridsome/README.md
  8. +1 −1 examples/hexo/README.md
  9. +0 −15 examples/ionic-react/.editorconfig
  10. +4 −63 examples/ionic-react/.gitignore
  11. +0 −8 examples/ionic-react/capacitor.config.json
  12. +2 −4 examples/ionic-react/ionic.config.json
  13. +34 −31 examples/ionic-react/package.json
  14. +4 −8 examples/ionic-react/src/App.test.tsx
  15. +13 −83 examples/ionic-react/src/App.tsx
  16. +0 −280 examples/ionic-react/src/__snapshots__/App.test.tsx.snap
  17. +0 −36 examples/ionic-react/src/components/AboutPopover.tsx
  18. +0 −18 examples/ionic-react/src/components/HomeOrTutorial.tsx
  19. +0 −56 examples/ionic-react/src/components/Map.tsx
  20. +0 −119 examples/ionic-react/src/components/Menu.tsx
  21. +0 −92 examples/ionic-react/src/components/SessionList.tsx
  22. +0 −4 examples/ionic-react/src/components/SessionListFilter.css
  23. +0 −108 examples/ionic-react/src/components/SessionListFilter.tsx
  24. +0 −83 examples/ionic-react/src/components/SessionListItem.tsx
  25. +0 −46 examples/ionic-react/src/components/ShareSocialFab.tsx
  26. +0 −125 examples/ionic-react/src/components/SpeakerItem.tsx
  27. +0 −8 examples/ionic-react/src/components/Time.tsx
  28. +0 −26 examples/ionic-react/src/data/AppContext.tsx
  29. +0 −14 examples/ionic-react/src/data/combineReducers.ts
  30. +0 −49 examples/ionic-react/src/data/connect.tsx
  31. +0 −73 examples/ionic-react/src/data/dataApi.ts
  32. +0 −139 examples/ionic-react/src/data/selectors.ts
  33. +0 −54 examples/ionic-react/src/data/sessions/sessions.actions.ts
  34. +0 −31 examples/ionic-react/src/data/sessions/sessions.reducer.ts
  35. +0 −14 examples/ionic-react/src/data/sessions/sessions.state.ts
  36. +0 −29 examples/ionic-react/src/data/state.ts
  37. +0 −76 examples/ionic-react/src/data/user/user.actions.ts
  38. +0 −19 examples/ionic-react/src/data/user/user.reducer.ts
  39. +0 −7 examples/ionic-react/src/data/user/user.state.ts
  40. +0 −5 examples/ionic-react/src/declarations.ts
  41. +6 −0 examples/ionic-react/src/index.tsx
  42. +0 −6 examples/ionic-react/src/models/Location.ts
  43. +0 −10 examples/ionic-react/src/models/Session.ts
  44. +0 −5 examples/ionic-react/src/models/SessionGroup.ts
  45. +0 −10 examples/ionic-react/src/models/Speaker.ts
  46. +0 −26 examples/ionic-react/src/pages/About.scss
  47. +0 −81 examples/ionic-react/src/pages/About.tsx
  48. +0 −6 examples/ionic-react/src/pages/Account.scss
  49. +0 −87 examples/ionic-react/src/pages/Account.tsx
  50. +26 −0 examples/ionic-react/src/pages/Home.tsx
  51. +0 −16 examples/ionic-react/src/pages/Login.scss
  52. +0 −108 examples/ionic-react/src/pages/Login.tsx
  53. +0 −54 examples/ionic-react/src/pages/MainTabs.tsx
  54. +0 −18 examples/ionic-react/src/pages/MapView.scss
  55. +0 −44 examples/ionic-react/src/pages/MapView.tsx
  56. +0 −42 examples/ionic-react/src/pages/SchedulePage.scss
  57. +0 −120 examples/ionic-react/src/pages/SchedulePage.tsx
  58. +0 −73 examples/ionic-react/src/pages/SessionDetail.scss
  59. +0 −108 examples/ionic-react/src/pages/SessionDetail.tsx
  60. +0 −111 examples/ionic-react/src/pages/Signup.tsx
  61. +0 −11 examples/ionic-react/src/pages/SpeakerDetail.scss
  62. +0 −64 examples/ionic-react/src/pages/SpeakerDetail.tsx
  63. +0 −24 examples/ionic-react/src/pages/SpeakerList.scss
  64. +0 −61 examples/ionic-react/src/pages/SpeakerList.tsx
  65. +0 −83 examples/ionic-react/src/pages/Support.tsx
  66. +0 −38 examples/ionic-react/src/pages/Tutorial.scss
  67. +0 −87 examples/ionic-react/src/pages/Tutorial.tsx
  68. +145 −0 examples/ionic-react/src/serviceWorker.ts
  69. +5 −0 examples/ionic-react/src/setupTests.ts
  70. +0 −179 examples/ionic-react/src/theme.css
  71. +12 −255 examples/ionic-react/src/theme/variables.css
  72. +0 −15 examples/ionic-react/src/util/types.ts
  73. +1 −1 examples/ionic-react/tsconfig.json
  74. +0 −3 examples/ionic-react/tslint.json
  75. +6 −6 examples/mithril/src/index.js
  76. +1 −1 examples/nextjs/README.md
  77. +1 −1 examples/polymer/README.md
  78. +1 −1 examples/preact/README.md
  79. +1 −1 examples/riot/src/main.js
  80. +11 −11 examples/riot/webpack.config.js
  81. +1 −1 examples/saber/README.md
  82. +1 −1 examples/umijs/README.md
  83. +1 −1 examples/vue/README.md
  84. +4 −2 examples/vue/babel.config.js
  85. +14 −0 examples/vue/package.json
  86. +4 −4 examples/vue/src/main.js
  87. +0 −14 examples/zola/package.json
  88. +1 −1 package.json
  89. +55 −36 packages/frameworks/frameworks.json
  90. +1 −1 packages/frameworks/index.d.ts
  91. +8 −4 packages/now-build-utils/src/detect-framework.ts
  92. +19 −7 packages/now-build-utils/src/detectors/filesystem.ts
  93. +14 −1 packages/now-build-utils/test/unit.framework-detector.test.ts
  94. +69 −17 packages/now-static-build/src/frameworks.ts
  95. +8 −17 packages/now-static-build/src/index.ts
  96. +3 −0 packages/now-static-build/test/fixtures/32-zola-with-framework/.gitignore
  97. +14 −0 packages/now-static-build/test/fixtures/32-zola-with-framework/config.toml
  98. +17 −0 packages/now-static-build/test/fixtures/32-zola-with-framework/content/1/index.md
  99. BIN packages/now-static-build/test/fixtures/32-zola-with-framework/content/1/thumb.jpg
  100. +19 −0 packages/now-static-build/test/fixtures/32-zola-with-framework/content/2/index.md
  101. BIN packages/now-static-build/test/fixtures/32-zola-with-framework/content/2/thumb.jpg
  102. +4 −0 packages/now-static-build/test/fixtures/32-zola-with-framework/content/_index.md
  103. +19 −0 packages/now-static-build/test/fixtures/32-zola-with-framework/now.json
  104. +1 −0 packages/now-static-build/test/fixtures/32-zola-with-framework/static/robots.txt
  105. +3 −0 packages/now-static-build/test/fixtures/32-zola-with-framework/themes/feather/.gitignore
  106. +29 −0 packages/now-static-build/test/fixtures/32-zola-with-framework/themes/feather/LICENSE
  107. +75 −0 packages/now-static-build/test/fixtures/32-zola-with-framework/themes/feather/README.md
  108. +29 −0 packages/now-static-build/test/fixtures/32-zola-with-framework/themes/feather/config.toml
  109. +3 −0 packages/now-static-build/test/fixtures/32-zola-with-framework/themes/feather/content/_index.md
  110. +9 −0 ...s/now-static-build/test/fixtures/32-zola-with-framework/themes/feather/content/category-post-2.md
  111. +9 −0 ...ges/now-static-build/test/fixtures/32-zola-with-framework/themes/feather/content/category-post.md
  112. +132 −0 ...ges/now-static-build/test/fixtures/32-zola-with-framework/themes/feather/content/my-first-post.md
  113. +381 −0 packages/now-static-build/test/fixtures/32-zola-with-framework/themes/feather/sass/feather.scss
  114. +37 −0 packages/now-static-build/test/fixtures/32-zola-with-framework/themes/feather/sass/reset.scss
  115. BIN packages/now-static-build/test/fixtures/32-zola-with-framework/themes/feather/screenshot.png
  116. +52 −0 packages/now-static-build/test/fixtures/32-zola-with-framework/themes/feather/static/js/images.js
  117. +17 −0 packages/now-static-build/test/fixtures/32-zola-with-framework/themes/feather/static/js/main.js
  118. BIN ...-static-build/test/fixtures/32-zola-with-framework/themes/feather/static/theme_images/default.gif
  119. +19 −0 ...es/now-static-build/test/fixtures/32-zola-with-framework/themes/feather/templates/categories.html
  120. +22 −0 ...ages/now-static-build/test/fixtures/32-zola-with-framework/themes/feather/templates/category.html
  121. +99 −0 packages/now-static-build/test/fixtures/32-zola-with-framework/themes/feather/templates/index.html
  122. +27 −0 packages/now-static-build/test/fixtures/32-zola-with-framework/themes/feather/templates/page.html
  123. +5 −0 ...tatic-build/test/fixtures/32-zola-with-framework/themes/feather/templates/shortcodes/youtube.html
  124. +19 −0 packages/now-static-build/test/fixtures/32-zola-with-framework/themes/feather/templates/tag.html
  125. +19 −0 packages/now-static-build/test/fixtures/32-zola-with-framework/themes/feather/templates/tags.html
  126. +15 −0 packages/now-static-build/test/fixtures/32-zola-with-framework/themes/feather/theme.toml
  127. +26 −0 packages/now-static-build/test/fixtures/50-ionic-react/.gitignore
  128. +5 −0 packages/now-static-build/test/fixtures/50-ionic-react/ionic.config.json
  129. +12 −0 packages/now-static-build/test/fixtures/50-ionic-react/now.json
  130. +44 −0 packages/now-static-build/test/fixtures/50-ionic-react/package.json
  131. BIN packages/now-static-build/test/fixtures/50-ionic-react/public/assets/icon/favicon.png
  132. BIN packages/now-static-build/test/fixtures/50-ionic-react/public/assets/icon/icon.png
  133. +1 −0 packages/now-static-build/test/fixtures/50-ionic-react/public/assets/shapes.svg
  134. +30 −0 packages/now-static-build/test/fixtures/50-ionic-react/public/index.html
  135. +21 −0 packages/now-static-build/test/fixtures/50-ionic-react/public/manifest.json
  136. +27 −0 packages/now-static-build/test/fixtures/50-ionic-react/readme.md
  137. +8 −0 packages/now-static-build/test/fixtures/50-ionic-react/src/App.test.tsx
  138. +37 −0 packages/now-static-build/test/fixtures/50-ionic-react/src/App.tsx
  139. +11 −0 packages/now-static-build/test/fixtures/50-ionic-react/src/index.tsx
  140. +26 −0 packages/now-static-build/test/fixtures/50-ionic-react/src/pages/Home.tsx
  141. +1 −0 packages/now-static-build/test/fixtures/50-ionic-react/src/react-app-env.d.ts
  142. +142 −0 packages/now-static-build/test/fixtures/50-ionic-react/src/serviceWorker.ts
  143. +5 −0 packages/now-static-build/test/fixtures/50-ionic-react/src/setupTests.ts
  144. +77 −0 packages/now-static-build/test/fixtures/50-ionic-react/src/theme/variables.css
  145. +19 −0 packages/now-static-build/test/fixtures/50-ionic-react/tsconfig.json
@@ -1,4 +1,4 @@
![Angular Logo](../packages/frameworks/logos/angular.svg)
![Angular Logo](../../packages/frameworks/logos/angular.svg)

# Angular Example

@@ -1,4 +1,4 @@
![React Logo](../packages/frameworks/logos/react.svg)
![React Logo](../../packages/frameworks/logos/react.svg)

# React Example

@@ -1,4 +1,4 @@
![Docusaurus Logo](../packages/frameworks/logos/docusaurus.svg)
![Docusaurus Logo](../../packages/frameworks/logos/docusaurus.svg)

# Docusaurus Example

@@ -1,4 +1,4 @@
![Eleventy Logo](../packages/frameworks/logos/eleventy.svg)
![Eleventy Logo](../../packages/frameworks/logos/eleventy.svg)

# Eleventy Example

@@ -1,4 +1,4 @@
![Ember Logo](../packages/frameworks/logos/ember.svg)
![Ember Logo](../../packages/frameworks/logos/ember.svg)

# Ember Example

@@ -1,4 +1,4 @@
![Gatsby Logo](../packages/frameworks/logos/gatsby.svg)
![Gatsby Logo](../../packages/frameworks/logos/gatsby.svg)

# Gatsby Example

@@ -1,4 +1,4 @@
![Gridsome Logo](../packages/frameworks/logos/gridsome.svg)
![Gridsome Logo](../../packages/frameworks/logos/gridsome.svg)

# Gridsome Example

@@ -1,4 +1,4 @@
![Hexo Logo](../packages/frameworks/logos/hexo.svg)
![Hexo Logo](../../packages/frameworks/logos/hexo.svg)

# Hexo Example

This file was deleted.

@@ -1,67 +1,9 @@
# Logs
.firebase
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

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

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

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

# Dependency directories
node_modules/
jspm_packages/

# 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

# See https://help.github.com/ignore-files/ for more about ignoring files.
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage
@@ -75,9 +17,8 @@ typings/
.env.development.local
.env.test.local
.env.production.local
.vscode

npm-debug.log*
yarn-debug.log*
yarn-error.log*

.stencil/

This file was deleted.

@@ -1,7 +1,5 @@
{
"name": "ionic-react-conference-app",
"integrations": {
"capacitor": {}
},
"name": "ionic-react",
"integrations": {},
"type": "react"
}
@@ -1,44 +1,47 @@
{
"name": "ionic-react-conference-app",
"name": "ionic-react",
"version": "0.0.1",
"private": true,
"dependencies": {
"@capacitor/core": "1.3.0",
"@ionic/react": "^4.11.4",
"@ionic/react-router": "^4.11.4",
"@types/jest": "24.0.18",
"@types/node": "12.7.5",
"@types/react": "^16.9.2",
"@types/react-dom": "^16.9.0",
"@types/react-router": "^5.0.3",
"@types/react-router-dom": "^4.3.1",
"date-fns": "^2.6.0",
"@ionic/react": "^4.11.0",
"@ionic/react-router": "^4.11.0",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.4.0",
"@testing-library/user-event": "^8.0.3",
"@types/jest": "^24.0.25",
"@types/node": "^12.12.24",
"@types/react": "^16.9.17",
"@types/react-dom": "^16.9.4",
"@types/react-router": "^5.1.4",
"@types/react-router-dom": "^5.1.3",
"ionicons": "^4.6.3",
"node-sass": "^4.13.0",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-router": "^5.0.1",
"react-router-dom": "^5.0.1",
"react-scripts": "3.2.0",
"reselect": "^4.0.0"
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
"react-scripts": "3.3.0",
"typescript": "3.7.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"description": "An Ionic project",
"devDependencies": {
"@capacitor/cli": "1.3.0",
"@testing-library/react": "^9.3.1",
"@types/googlemaps": "^3.38.0",
"typescript": "3.6.3"
}
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"description": "An Ionic project"
}
@@ -1,12 +1,8 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { render } from '@testing-library/react';
import App from './App';
import { render, fireEvent, waitForElement } from '@testing-library/react'

it('renders without crashing', () => {
// const div = document.createElement('div');
// ReactDOM.render(<App />, div);
// ReactDOM.unmountComponentAtNode(div);
const { asFragment, container } = render(<App />);
expect(asFragment()).toMatchSnapshot();
test('renders without crashing', () => {
const { baseElement } = render(<App />);
expect(baseElement).toBeDefined();
});
@@ -1,9 +1,8 @@
import React, { useEffect } from 'react';
import React from 'react';
import { Redirect, Route } from 'react-router-dom';
import { IonApp, IonRouterOutlet, IonSplitPane } from '@ionic/react';
import { IonApp, IonRouterOutlet } from '@ionic/react';
import { IonReactRouter } from '@ionic/react-router';

import Menu from './components/Menu';
import Home from './pages/Home';

/* Core CSS required for Ionic components to work properly */
import '@ionic/react/css/core.css';
@@ -23,85 +22,16 @@ import '@ionic/react/css/display.css';

/* Theme variables */
import './theme/variables.css';
import MainTabs from './pages/MainTabs';
import { connect } from './data/connect';
import { AppContextProvider } from './data/AppContext';
import { loadConfData } from './data/sessions/sessions.actions';
import { setIsLoggedIn, setUsername, loadUserData } from './data/user/user.actions';
import Account from './pages/Account';
import Login from './pages/Login';
import Signup from './pages/Signup';
import Support from './pages/Support';
import Tutorial from './pages/Tutorial';
import HomeOrTutorial from './components/HomeOrTutorial';
import { Session } from "./models/Session";

const App: React.FC = () => {
return (
<AppContextProvider>
<IonicAppConnected />
</AppContextProvider>
);
};

interface StateProps {
darkMode: boolean,
sessions: Session[],
}

interface DispatchProps {
loadConfData: typeof loadConfData;
loadUserData: typeof loadUserData;
setIsLoggedIn: typeof setIsLoggedIn;
setUsername: typeof setUsername;
}

interface IonicAppProps extends StateProps, DispatchProps { }

const IonicApp: React.FC<IonicAppProps> = ({ darkMode, sessions, setIsLoggedIn, setUsername, loadConfData, loadUserData }) => {

useEffect(() => {
loadUserData();
loadConfData();
// eslint-disable-next-line
}, []);

return (
sessions.length === 0 ? (
<div></div>
) : (
<IonApp className={`${darkMode ? 'dark-theme' : ''}`}>
<IonReactRouter>
<IonSplitPane contentId="main">
<Menu />
<IonRouterOutlet id="main">
<Route path="/tabs" component={MainTabs} />
<Route path="/account" component={Account} />
<Route path="/login" component={Login} />
<Route path="/signup" component={Signup} />
<Route path="/support" component={Support} />
<Route path="/tutorial" component={Tutorial} />
<Route path="/logout" render={() => {
setIsLoggedIn(false);
setUsername(undefined);
return <Redirect to="/tabs" />
}} />
<Route path="/" component={HomeOrTutorial} exact />
</IonRouterOutlet>
</IonSplitPane>
</IonReactRouter>
</IonApp>
)
)
}
const App: React.FC = () => (
<IonApp>
<IonReactRouter>
<IonRouterOutlet>
<Route path="/home" component={Home} exact={true} />
<Route exact path="/" render={() => <Redirect to="/home" />} />
</IonRouterOutlet>
</IonReactRouter>
</IonApp>
);

export default App;

const IonicAppConnected = connect<{}, StateProps, DispatchProps>({
mapStateToProps: (state) => ({
darkMode: state.user.darkMode,
sessions: state.data.sessions
}),
mapDispatchToProps: { loadConfData, loadUserData, setIsLoggedIn, setUsername },
component: IonicApp
});

1 comment on commit 96dbc6d

@now

This comment has been minimized.

Please sign in to comment.
You can’t perform that action at this time.