Revert "Modification page liste offres"
This reverts commitcf59b8cede, reversing changes made to0c5c702f78. Retour en arrière pour enlever node modules
This commit is contained in:
-12
@@ -1,12 +0,0 @@
|
||||
SERVER_URL=http://localhost:3000
|
||||
MONGO_URI=mongodb://declic:declic42@ds115653.mlab.com:15653/next-auth
|
||||
FACEBOOK_ID=2332071840142634
|
||||
FACEBOOK_SECRET=afb8bbca72bd8c517c64f81e998e4f12
|
||||
LINKEDIN_ID=77k1m8qx7w6ygj
|
||||
LINKEDIN_SECRET=mbcnVjyy2vqAZz1B
|
||||
EMAIL_FROM=noreply@talentstube.com
|
||||
EMAIL_SERVER=mail.gandi.net
|
||||
EMAIL_PORT=465
|
||||
EMAIL_SECURE=true
|
||||
EMAIL_USERNAME=noreply@talentstube.com
|
||||
EMAIL_PASSWORD=zfYwOGBHweCQ8OI9ghF6lUyo
|
||||
@@ -1,2 +1 @@
|
||||
/.next
|
||||
/node_modules/
|
||||
Vendored
+5
-21
@@ -1,31 +1,15 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Chrome",
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"name": "Next: Chrome",
|
||||
"url": "http://localhost:3000",
|
||||
"webRoot": "${workspaceFolder}/nextjs/"
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Next: Node",
|
||||
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/next",
|
||||
"runtimeArgs": [
|
||||
"--inspect"
|
||||
],
|
||||
"port": 9229,
|
||||
"console": "integratedTerminal",
|
||||
|
||||
|
||||
}
|
||||
],
|
||||
"compounds": [
|
||||
{
|
||||
"name": "Next: Full",
|
||||
"configurations": ["Next: Node", "Next: Chrome"]
|
||||
"webRoot": "${workspaceRoot}"
|
||||
}
|
||||
]
|
||||
}
|
||||
+6
-1
@@ -2,11 +2,16 @@
|
||||
|
||||
## How to use
|
||||
|
||||
Download the example [or clone the repo](https://github.com/mui-org/material-ui):
|
||||
|
||||
```bash
|
||||
git clone
|
||||
```
|
||||
|
||||
Install it and run:
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
yarn build
|
||||
yarn dev
|
||||
```
|
||||
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
import React from 'react';
|
||||
import PropTypes from "prop-types";
|
||||
import Router from 'next/router'
|
||||
import { withStyles } from '@material-ui/core/styles';
|
||||
import Card from '@material-ui/core/Card';
|
||||
import CardContent from '@material-ui/core/CardContent';
|
||||
import CardHeader from '@material-ui/core/CardHeader';
|
||||
import CardMedia from '@material-ui/core/CardMedia';
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
|
||||
|
||||
const styles = theme => ({
|
||||
card: {
|
||||
display: 'flex',
|
||||
},
|
||||
details: {
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
},
|
||||
content: {
|
||||
flex: '1 0 auto',
|
||||
},
|
||||
cover: {
|
||||
width: 151,
|
||||
height: 151,
|
||||
},
|
||||
});
|
||||
|
||||
class CompanyRowComponent extends React.Component {
|
||||
|
||||
render() {
|
||||
const { classes, theme, rowData } = this.props;
|
||||
|
||||
const imgDefaultUrl = "https://www.talentstube.com/img/default_picture_company.svg"
|
||||
|
||||
const imgUrl = (rowData.presentation_video && rowData.presentation_video.thumbnails[0] && rowData.presentation_video.thumbnails[0].sizes[4]) ? rowData.presentation_video.thumbnails[0].sizes[4].link : imgDefaultUrl
|
||||
|
||||
|
||||
return (
|
||||
<Card onClick={() => Router.push(`/Company?id=${rowData.id}`)}>
|
||||
<CardHeader />
|
||||
<CardContent>
|
||||
<CardMedia
|
||||
className={classes.cover}
|
||||
image={imgUrl}
|
||||
title={rowData.presentation_video&&rowData.presentation_video.title}
|
||||
/>
|
||||
<Typography gutterBottom variant="headline" component="h3"
|
||||
className={classes.details}>
|
||||
{rowData.brand_name}
|
||||
</Typography>
|
||||
<Typography gutterBottom variant="headline" component="h4"
|
||||
className={classes.details}>
|
||||
{rowData.website}
|
||||
</Typography>
|
||||
<Typography gutterBottom variant="headline" component="h5"
|
||||
className={classes.details}>
|
||||
{rowData.description}
|
||||
</Typography>
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
CompanyRowComponent.propTypes = {
|
||||
classes: PropTypes.object.isRequired,
|
||||
theme: PropTypes.object.isRequired,
|
||||
rowData: PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
export default withStyles(styles, { withTheme: true })(CompanyRowComponent);
|
||||
@@ -1,20 +0,0 @@
|
||||
import Link from 'next/link'
|
||||
import { withStyles } from '@material-ui/core/styles'
|
||||
import BottomToolbar from './BottomToolbar';
|
||||
|
||||
const styles = theme => ({
|
||||
root: {
|
||||
position: 'relative',
|
||||
height: '10vh'
|
||||
},
|
||||
});
|
||||
|
||||
function Footer(props) {
|
||||
const { classes } = props;
|
||||
return (
|
||||
<BottomToolbar/>
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
export default withStyles(styles)(Footer)
|
||||
@@ -1,26 +0,0 @@
|
||||
import Link from 'next/link'
|
||||
import PropTypes from "prop-types";
|
||||
import { withStyles } from '@material-ui/core/styles'
|
||||
import PSAB from './PrimarySearchAppBar'
|
||||
|
||||
|
||||
const styles = theme => ({
|
||||
root: {
|
||||
position: 'relative',
|
||||
height: '10vh'
|
||||
},
|
||||
});
|
||||
|
||||
function Header(props) {
|
||||
return (
|
||||
<PSAB backLink={props.backLink}/>
|
||||
);
|
||||
|
||||
}
|
||||
Header.defaultProps = {
|
||||
backLink : ""
|
||||
}
|
||||
Header.propTypes = {
|
||||
backLink : PropTypes.string
|
||||
}
|
||||
export default withStyles(styles)(Header)
|
||||
@@ -133,7 +133,6 @@ class OffreRowComponent extends React.Component {
|
||||
<Chip label={rowData.extra.contract_type} className={classes.chip} />
|
||||
<Chip label={rowData.location.gmap_address.address_components[0].long_name} className={classes.chip} />
|
||||
</div>
|
||||
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
|
||||
@@ -4,6 +4,7 @@ import React, { Component } from 'react';
|
||||
import { connect } from "react-redux";
|
||||
import fetch from 'isomorphic-unfetch'
|
||||
|
||||
import api from '../../data/api'
|
||||
import GriddleCustomTable from "../organisms/GriddleCustomTableComponent";
|
||||
|
||||
|
||||
@@ -28,11 +29,13 @@ class Grid extends Component {
|
||||
|
||||
async componentDidMount() {
|
||||
try {
|
||||
let data = await this.props.dataFetcher(10);
|
||||
let data = await api.ads.fetchAds(10);
|
||||
this.setState({ data });
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
@@ -121,7 +124,7 @@ class Grid extends Component {
|
||||
}
|
||||
|
||||
Grid.propTypes = {
|
||||
dataFetcher: PropTypes.func.isRequired,
|
||||
//dataFetcher: PropTypes.func.isRequired,
|
||||
CustomRowComponent: PropTypes.func.isRequired,
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { withStyles } from '@material-ui/core/styles'
|
||||
import Header from '../organisms/Header'
|
||||
import Footer from '../organisms/Footer'
|
||||
import Header from './Header'
|
||||
import Footer from './Footer'
|
||||
|
||||
const styles = theme => ({
|
||||
root: {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import { withStyles } from '@material-ui/core/styles'
|
||||
import Header from '../organisms/Header'
|
||||
import Header from './Header'
|
||||
|
||||
const styles = theme => ({
|
||||
root: {
|
||||
|
||||
@@ -1,208 +0,0 @@
|
||||
import React from 'react'
|
||||
import Router from 'next/router'
|
||||
import Head from 'next/head'
|
||||
import Link from 'next/link'
|
||||
import { Container, Row, Col, Nav, NavItem, Button, Form, NavLink, Collapse,
|
||||
Navbar, NavbarToggler, NavbarBrand, Modal, ModalHeader, ModalBody,
|
||||
ModalFooter, ListGroup, ListGroupItem } from 'reactstrap'
|
||||
import Signin from './signin'
|
||||
import { NextAuth } from 'next-auth/client'
|
||||
import Cookies from 'universal-cookie'
|
||||
|
||||
export default class extends React.Component {
|
||||
|
||||
static propTypes() {
|
||||
return {
|
||||
session: React.PropTypes.object.isRequired,
|
||||
providers: React.PropTypes.object.isRequired,
|
||||
children: React.PropTypes.object.isRequired,
|
||||
fluid: React.PropTypes.boolean,
|
||||
navmenu: React.PropTypes.boolean,
|
||||
signinBtn: React.PropTypes.boolean
|
||||
}
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
navOpen: false,
|
||||
modal: false,
|
||||
providers: null
|
||||
}
|
||||
this.toggleModal = this.toggleModal.bind(this)
|
||||
}
|
||||
|
||||
async toggleModal(e) {
|
||||
if (e) e.preventDefault()
|
||||
|
||||
// Save current URL so user is redirected back here after signing in
|
||||
if (this.state.modal !== true) {
|
||||
const cookies = new Cookies()
|
||||
cookies.set('redirect_url', window.location.pathname, { path: '/' })
|
||||
}
|
||||
|
||||
this.setState({
|
||||
providers: this.state.providers || await NextAuth.providers(),
|
||||
modal: !this.state.modal
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
|
||||
<MainBody navmenu={this.props.navmenu} fluid={this.props.fluid} container={this.props.container}>
|
||||
{this.props.children}
|
||||
</MainBody>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export class MainBody extends React.Component {
|
||||
render() {
|
||||
if (this.props.container === false) {
|
||||
return (
|
||||
<React.Fragment>
|
||||
{this.props.children}
|
||||
</React.Fragment>
|
||||
)
|
||||
} else if (this.props.navmenu === false) {
|
||||
return (
|
||||
<Container fluid={this.props.fluid} style={{marginTop: '1em'}}>
|
||||
{this.props.children}
|
||||
</Container>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<Container fluid={this.props.fluid} style={{marginTop: '1em'}}>
|
||||
<Row>
|
||||
<Col xs="12" md="9" lg="10">
|
||||
{this.props.children}
|
||||
</Col>
|
||||
<Col xs="12" md="3" lg="2" style={{paddingTop: '1em'}}>
|
||||
<h5 className="text-muted text-uppercase">Examples</h5>
|
||||
<ListGroup>
|
||||
<ListGroupItem>
|
||||
<Link prefetch href="/examples/authentication"><a href="/examples/authentication" className="d-block">Auth</a></Link>
|
||||
</ListGroupItem>
|
||||
<ListGroupItem>
|
||||
<Link prefetch href="/examples/async"><a href="/examples/async" className="d-block">Async</a></Link>
|
||||
</ListGroupItem>
|
||||
<ListGroupItem>
|
||||
<Link prefetch href="/examples/layout"><a href="/examples/layout" className="d-block">Layout</a></Link>
|
||||
</ListGroupItem>
|
||||
<ListGroupItem>
|
||||
<Link prefetch href="/examples/routing"><a href="/examples/routing" className="d-block">Routing</a></Link>
|
||||
</ListGroupItem>
|
||||
<ListGroupItem>
|
||||
<Link prefetch href="/examples/styling"><a href="/examples/styling" className="d-block">Styling</a></Link>
|
||||
</ListGroupItem>
|
||||
</ListGroup>
|
||||
</Col>
|
||||
</Row>
|
||||
</Container>
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class UserMenu extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.handleSignoutSubmit = this.handleSignoutSubmit.bind(this)
|
||||
}
|
||||
|
||||
async handleSignoutSubmit(event) {
|
||||
event.preventDefault()
|
||||
|
||||
// Save current URL so user is redirected back here after signing out
|
||||
const cookies = new Cookies()
|
||||
cookies.set('redirect_url', window.location.pathname, { path: '/' })
|
||||
|
||||
await NextAuth.signout()
|
||||
Router.push('/')
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this.props.session && this.props.session.user) {
|
||||
// If signed in display user dropdown menu
|
||||
const session = this.props.session
|
||||
return (
|
||||
<Nav className="ml-auto" navbar>
|
||||
{/*<!-- Uses .nojs-dropdown CSS to for a dropdown that works without client side JavaScript ->*/}
|
||||
<div tabIndex="2" className="dropdown nojs-dropdown">
|
||||
<div className="nav-item">
|
||||
<span className="dropdown-toggle nav-link d-none d-md-block">
|
||||
<span className="icon ion-md-contact" style={{fontSize: '2em', position: 'absolute', top: -5, left: -25}}></span>
|
||||
</span>
|
||||
<span className="dropdown-toggle nav-link d-block d-md-none">
|
||||
<span className="icon ion-md-contact mr-2"></span>
|
||||
{session.user.name || session.user.email}
|
||||
</span>
|
||||
</div>
|
||||
<div className="dropdown-menu">
|
||||
<Link prefetch href="/account">
|
||||
<a href="/account" className="dropdown-item"><span className="icon ion-md-person mr-1"></span> Your Account</a>
|
||||
</Link>
|
||||
<AdminMenuItem {...this.props}/>
|
||||
<div className="dropdown-divider d-none d-md-block"/>
|
||||
<div className="dropdown-item p-0">
|
||||
<Form id="signout" method="post" action="/auth/signout" onSubmit={this.handleSignoutSubmit}>
|
||||
<input name="_csrf" type="hidden" value={this.props.session.csrfToken}/>
|
||||
<Button type="submit" block className="pl-4 rounded-0 text-left dropdown-item"><span className="icon ion-md-log-out mr-1"></span> Sign out</Button>
|
||||
</Form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Nav>
|
||||
)
|
||||
} if (this.props.signinBtn === false) {
|
||||
// If not signed in, don't display sign in button if disabled
|
||||
return null
|
||||
} else {
|
||||
// If not signed in, display sign in button
|
||||
return (
|
||||
<Nav className="ml-auto" navbar>
|
||||
<NavItem>
|
||||
{/**
|
||||
* @TODO Add support for passing current URL path as redirect URL
|
||||
* so that users without JavaScript are also redirected to the page
|
||||
* they were on before they signed in.
|
||||
**/}
|
||||
<a href="/auth?redirect=/" className="btn btn-outline-primary" onClick={this.props.toggleModal}><span className="icon ion-md-log-in mr-1"></span> Sign up / Sign in</a>
|
||||
</NavItem>
|
||||
</Nav>
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class AdminMenuItem extends React.Component {
|
||||
render() {
|
||||
if (this.props.session.user && this.props.session.user.admin === true) {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Link prefetch href="/admin">
|
||||
<a href="/admin" className="dropdown-item"><span className="icon ion-md-settings mr-1"></span> Admin</a>
|
||||
</Link>
|
||||
</React.Fragment>
|
||||
)
|
||||
} else {
|
||||
return(<div/>)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class SigninModal extends React.Component {
|
||||
render() {
|
||||
if (this.props.providers === null) return null
|
||||
|
||||
return (
|
||||
<Modal isOpen={this.props.modal} toggle={this.props.toggleModal} style={{maxWidth: 700}}>
|
||||
<ModalHeader>Sign up / Sign in</ModalHeader>
|
||||
<ModalBody style={{padding: '1em 2em'}}>
|
||||
<Signin session={this.props.session} providers={this.props.providers}/>
|
||||
</ModalBody>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
import React from 'react'
|
||||
|
||||
export default class extends React.Component {
|
||||
render() {
|
||||
if (this.props.fullscreen) {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<style jsx global>{`
|
||||
.circle-loader {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 50%;
|
||||
z-index: 100;
|
||||
text-align: center;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.circle-loader .circle {
|
||||
fill: transparent;
|
||||
stroke: rgba(0,0,0,0.2);
|
||||
stroke-width: 4px;
|
||||
animation: dash 2s ease infinite, rotate 2s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes dash {
|
||||
0% {
|
||||
stroke-dasharray: 1,95;
|
||||
stroke-dashoffset: 0;
|
||||
}
|
||||
50% {
|
||||
stroke-dasharray: 85,95;
|
||||
stroke-dashoffset: -25;
|
||||
}
|
||||
100% {
|
||||
stroke-dasharray: 85,95;
|
||||
stroke-dashoffset: -93;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotate {
|
||||
0% {transform: rotate(0deg); }
|
||||
100% {transform: rotate(360deg); }
|
||||
}
|
||||
`}</style>
|
||||
<span className="circle-loader">
|
||||
<svg className="circle" width="60" height="60" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="30" cy="30" r="15"/>
|
||||
</svg>
|
||||
</span>
|
||||
</React.Fragment>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<style jsx global>{`
|
||||
.circle-loader {
|
||||
display: block;
|
||||
text-center;
|
||||
padding-left: 50%;
|
||||
}
|
||||
|
||||
.circle-loader .circle {
|
||||
position: relative;
|
||||
left: -30px;
|
||||
fill: transparent;
|
||||
stroke: rgba(0,0,0,0.2);
|
||||
stroke-width: 4px;
|
||||
animation: dash 2s ease infinite, rotate 2s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes dash {
|
||||
0% {
|
||||
stroke-dasharray: 1,95;
|
||||
stroke-dashoffset: 0;
|
||||
}
|
||||
50% {
|
||||
stroke-dasharray: 85,95;
|
||||
stroke-dashoffset: -25;
|
||||
}
|
||||
100% {
|
||||
stroke-dasharray: 85,95;
|
||||
stroke-dashoffset: -93;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotate {
|
||||
0% {transform: rotate(0deg); }
|
||||
100% {transform: rotate(360deg); }
|
||||
}
|
||||
`}</style>
|
||||
<span className="circle-loader">
|
||||
<svg className="circle" width="60" height="60" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="30" cy="30" r="15"/>
|
||||
</svg>
|
||||
</span>
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
import React from 'react'
|
||||
import Layout from './layoutAuth'
|
||||
import { NextAuth } from 'next-auth/client'
|
||||
|
||||
export default class extends React.Component {
|
||||
|
||||
static async getInitialProps({req}) {
|
||||
return {
|
||||
session: await NextAuth.init({req}),// Add this.props.session to all pages
|
||||
lang: 'en'// Add a lang property for accessibility
|
||||
}
|
||||
}
|
||||
|
||||
adminAcccessOnly() {
|
||||
return (
|
||||
<Layout {...this.props} navmenu={false}>
|
||||
<div className="text-center pt-5 pb-5">
|
||||
<h1 className="display-4 mb-5">Access Denied</h1>
|
||||
<p className="lead">You must be signed in as an administrator to access this page.</p>
|
||||
</div>
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
import React from 'react'
|
||||
import Router from 'next/router'
|
||||
import { Row, Col, Form, Input, Label, Button } from 'reactstrap'
|
||||
import Cookies from 'universal-cookie'
|
||||
import { NextAuth } from 'next-auth/client'
|
||||
|
||||
export default class extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
email: '',
|
||||
session: this.props.session,
|
||||
providers: this.props.providers,
|
||||
submitting: false
|
||||
}
|
||||
this.handleSubmit = this.handleSubmit.bind(this)
|
||||
this.handleEmailChange = this.handleEmailChange.bind(this)
|
||||
|
||||
}
|
||||
|
||||
handleEmailChange(event) {
|
||||
this.setState({
|
||||
email: event.target.value.trim()
|
||||
})
|
||||
}
|
||||
|
||||
handleSubmit(event) {
|
||||
event.preventDefault()
|
||||
|
||||
if (!this.state.email) return
|
||||
|
||||
this.setState({
|
||||
submitting: true
|
||||
})
|
||||
|
||||
// Save current URL so user is redirected back here after signing in
|
||||
const cookies = new Cookies()
|
||||
cookies.set('redirect_url', window.location.pathname, { path: '/' })
|
||||
|
||||
NextAuth.signin(this.state.email)
|
||||
.then(() => {
|
||||
Router.push(`/auth/check-email?email=${this.state.email}`)
|
||||
})
|
||||
.catch(err => {
|
||||
Router.push(`/auth/error?action=signin&type=email&email=${this.state.email}`)
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this.props.session.user) {
|
||||
return(<div/>)
|
||||
} else {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<p className="text-center" style={{marginTop: 10, marginBottom: 30}}>{`If you don't have an account, one will be created when you sign in.`}</p>
|
||||
<Row>
|
||||
<Col xs={12} md={6}>
|
||||
<SignInButtons providers={this.props.providers}/>
|
||||
</Col>
|
||||
<Col xs={12} md={6}>
|
||||
<Form id="signin" method="post" action="/auth/email/signin" onSubmit={this.handleSubmit}>
|
||||
<Input name="_csrf" type="hidden" value={this.state.session.csrfToken}/>
|
||||
<p>
|
||||
<Label htmlFor="email">Email address</Label><br/>
|
||||
<Input name="email" disabled={this.state.submitting} type="text" placeholder="j.smith@example.com" id="email" className="form-control" value={this.state.email} onChange={this.handleEmailChange}/>
|
||||
</p>
|
||||
<p className="text-right">
|
||||
<Button id="submitButton" disabled={this.state.submitting} outline color="dark" type="submit">
|
||||
{this.state.submitting === true && <span className="icon icon-spin ion-md-refresh mr-2"/>}
|
||||
Sign in with email
|
||||
</Button>
|
||||
</p>
|
||||
</Form>
|
||||
</Col>
|
||||
</Row>
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class SignInButtons extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<React.Fragment>
|
||||
{
|
||||
Object.keys(this.props.providers).map((provider, i) => {
|
||||
if (!this.props.providers[provider].signin) return null
|
||||
|
||||
return (
|
||||
<p key={i}>
|
||||
<a className="btn btn-block btn-outline-secondary" href={this.props.providers[provider].signin}>
|
||||
Sign in with {provider}
|
||||
</a>
|
||||
</p>
|
||||
)
|
||||
})
|
||||
}
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
@charset "UTF-8";
|
||||
$ionicons-font-path: "/fonts/ionicons" !default;
|
||||
$ionicons-font-family: "Ionicons" !default;
|
||||
$ionicons-version: "3.0.0-alpha.3" !default;
|
||||
@import "../node_modules/ionicons/dist/scss/ionicons";
|
||||
@import "../node_modules/bootstrap/scss/bootstrap.scss";
|
||||
@import "../node_modules/react-bootstrap-table/dist/react-bootstrap-table-all.min";
|
||||
@import "nojs-menus.scss";
|
||||
|
||||
.lead {
|
||||
font-size: 1.4em;
|
||||
}
|
||||
|
||||
pre {
|
||||
background-color: #333;
|
||||
border-color: #333;
|
||||
color: #eee;
|
||||
padding: 10px 20px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.navbar,
|
||||
.navbar .btn,
|
||||
.navbar .dropdown-item,
|
||||
.navbar button {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.display-2 {
|
||||
font-size: 3em;
|
||||
}
|
||||
.display-3 {
|
||||
font-size: 2.5em;
|
||||
}
|
||||
.display-4 {
|
||||
font-size: 2em;
|
||||
}
|
||||
}
|
||||
|
||||
.icon-spin {
|
||||
display: inline-block;
|
||||
animation: spin 1s infinite linear;
|
||||
}
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a fix for Reactstrap 5.0.0-alpha.4 not displaying menus in the
|
||||
* navbar correcrtly on mobile devices.
|
||||
**/
|
||||
.navbar .dropdown {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.navbar .dropdown-menu {
|
||||
position: relative !important;
|
||||
display: block !important;
|
||||
transform: none !important;
|
||||
padding: 0 0 10px 0;
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix for Reactstrap
|
||||
**/
|
||||
.react-bs-table-sizePerPage-dropdown .dropdown-item a {
|
||||
display: block;
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.react-bs-table-sizePerPage-dropdown button {
|
||||
background: #fff;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
@@ -1,131 +0,0 @@
|
||||
/**
|
||||
* Pure CSS .nojs-dropdown & .nojs-navbar classes for Boostrap menus .
|
||||
*
|
||||
* @FIXME: While this works well for browsers without JavaScript, there are
|
||||
* accessibility issues for keyboard access and screen readers with this
|
||||
* implementation.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Add ".nojs-dropdown" class to any Bootstrap ".dropdown" for a pure CSS menu.
|
||||
* Note: Do not also add JavaScript to the dropdown.
|
||||
**/
|
||||
.nojs-dropdown {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
outline: none;
|
||||
}
|
||||
.nojs-dropdown .dropdown-toggle {
|
||||
cursor: pointer;
|
||||
}
|
||||
.nojs-dropdown .dropdown-menu {
|
||||
position: absolute !important;
|
||||
z-index: 1000 !important;
|
||||
display: block;
|
||||
visibility: hidden !important;
|
||||
transition: visibility 0.5s !important;
|
||||
}
|
||||
.nojs-dropdown:focus .dropdown-menu {
|
||||
visibility: visible !important;
|
||||
transition: opacity 0.1s !important;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.nojs-dropdown .dropdown-menu {
|
||||
top: 0px;
|
||||
visibility: visible !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* For right-align menus (automatic and override with .nojs-dropdown-right) */
|
||||
.nojs-dropdown.pull-right .dropdown-menu,
|
||||
.ml-auto .nojs-dropdown .dropdown-menu,
|
||||
.nojs-dropdown.nojs-dropdown-right .dropdown-menu {
|
||||
left: auto !important;
|
||||
right: 0px !important;
|
||||
}
|
||||
|
||||
/* Override default to left-align menus by adding .nojs-dropdown-left */
|
||||
.nojs-dropdown.nojs-dropdown-left .dropdown-menu {
|
||||
left: 0px !important;
|
||||
right: auto !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* .nojs-navbar navigation menu
|
||||
*
|
||||
* To use, add the following inside your navbar:
|
||||
*
|
||||
* <input class="nojs-navbar-check" id="nojs-navbar-check" type="checkbox" aria-label="Menu"/>
|
||||
* <label tabindex="1" htmlFor="nojs-navbar-check" class="nojs-navbar-label" />
|
||||
* <div class="nojs-navbar"> <!-- Add your Navbar Menu --> </div>
|
||||
**/
|
||||
.nojs-navbar {
|
||||
display: flex;
|
||||
flex-basis: auto;
|
||||
flex-grow: 1;
|
||||
}
|
||||
.nojs-navbar-label {
|
||||
display: none;
|
||||
}
|
||||
.nojs-navbar-check {
|
||||
display: none;
|
||||
}
|
||||
.nojs-navbar-check:checked ~ .nojs-navbar-label {
|
||||
border-bottom: 3px solid transparent;
|
||||
transition: border-bottom 0.8s ease-in-out;
|
||||
|
||||
&:before {
|
||||
transform: rotate(-405deg) translateY(0px) translateX(-1px);
|
||||
transition: transform 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
&:after {
|
||||
transform: rotate(405deg) translateY(-5px) translateX(-6px);
|
||||
transition: transform 0.5s ease-in-out;
|
||||
}
|
||||
}
|
||||
.nojs-navbar-check:checked ~ .nojs-navbar {
|
||||
max-height: 1000px;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.nojs-navbar {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-height: 0px;
|
||||
overflow: hidden;
|
||||
transition: max-height 0.5s ease-in-out !important;
|
||||
}
|
||||
.nojs-navbar-label {
|
||||
$width: 28px;
|
||||
|
||||
display: inline-block;
|
||||
outline: 0;
|
||||
cursor: pointer;
|
||||
border-bottom: 3px solid currentColor;
|
||||
width: $width;
|
||||
transition: border-bottom 1s ease-in-out;
|
||||
|
||||
&::-moz-focus-inner {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
&:before {
|
||||
content: "";
|
||||
display: block;
|
||||
border-bottom: 3px solid currentColor;
|
||||
width: 100%;
|
||||
margin-bottom: 5px;
|
||||
transition: transform 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
&:after {
|
||||
content: "";
|
||||
display: block;
|
||||
border-bottom: 3px solid currentColor;
|
||||
width: 100%;
|
||||
margin-bottom: 5px;
|
||||
transition: transform 0.5s ease-in-out;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -49,40 +49,5 @@ export default {
|
||||
return show.data;
|
||||
}
|
||||
|
||||
},
|
||||
companies:{
|
||||
fetchCompany: async (id) => {
|
||||
const res = await fetch(`http://localhost/app_dev.php/api/companies/${id}`)
|
||||
const company = await res.json()
|
||||
|
||||
return { company: company.data }
|
||||
},
|
||||
fetchCompanies: async (limit = "", order = "", keyword = "", offset = 1) => {
|
||||
var obj = {
|
||||
method: 'GET',
|
||||
//mode : 'no-cors',
|
||||
headers: {
|
||||
// 'Access-Control-Request-Headers': 'Authorization',
|
||||
// 'Authorization': 'Basic amFzcGVyYWRtaW46amFzcGVyYWRtaW4=',
|
||||
'Content-Type': 'application/json',
|
||||
'Origin': ''
|
||||
},
|
||||
credentials: 'include'
|
||||
};
|
||||
|
||||
let url = `http://localhost/app_dev.php/api/companies?offset=${offset}`;
|
||||
if (limit != "") {
|
||||
url = url + `&limit=${limit}`;
|
||||
}
|
||||
if (order != "") {
|
||||
url = url + `&order=${order}`;
|
||||
}
|
||||
if (keyword != "") {
|
||||
url = url + `&keyword=${keyword}`;
|
||||
}
|
||||
const res = await fetch(url, obj);
|
||||
const show = await res.json();
|
||||
return show.data;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
/**
|
||||
* next-auth.config.js Example
|
||||
*
|
||||
* Environment variables for this example:
|
||||
*
|
||||
* PORT=3000
|
||||
* SERVER_URL=http://localhost:3000
|
||||
* MONGO_URI=mongodb://localhost:27017/my-database
|
||||
*
|
||||
* If you wish, you can put these in a `.env` to seperate your environment
|
||||
* specific configuration from your code.
|
||||
**/
|
||||
|
||||
// Load environment variables from a .env file if one exists
|
||||
require('dotenv').load()
|
||||
|
||||
const nextAuthProviders = require('./next-auth.providers')
|
||||
const nextAuthFunctions = require('./next-auth.functions')
|
||||
|
||||
// If we want to pass a custom session store then we also need to pass an
|
||||
// instance of Express Session along with it.
|
||||
const expressSession = require('express-session')
|
||||
const MongoStore = require('connect-mongo')(expressSession)
|
||||
|
||||
// If no store set, NextAuth defaults to using Express Sessions in-memory
|
||||
// session store (the fallback is intended as fallback for testing only).
|
||||
let sessionStore
|
||||
if (process.env.MONGO_URI) {
|
||||
sessionStore = new MongoStore({
|
||||
url: process.env.MONGO_URI,
|
||||
autoRemove: 'interval',
|
||||
autoRemoveInterval: 10, // Removes expired sessions every 10 minutes
|
||||
collection: 'sessions',
|
||||
stringify: false
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = () => {
|
||||
// We connect to the User DB before we define our functions.
|
||||
// next-auth.functions.js returns an async method that does that and returns
|
||||
// an object with the functions needed for authentication.
|
||||
return nextAuthFunctions()
|
||||
.then(functions => {
|
||||
return new Promise((resolve, reject) => {
|
||||
// This is the config block we return, ready to be passed to NextAuth
|
||||
resolve({
|
||||
// Define a port (if none passed, will not start Express)
|
||||
// port: process.env.PORT || 3000,
|
||||
// Secret used to encrypt session data on the server.
|
||||
sessionSecret: 'fkjpeozr',
|
||||
// Maximum Session Age in ms (optional, default is 7 days).
|
||||
// The expiry time for a session is reset every time a user revisits
|
||||
// the site or revalidates their session token. This is the maximum
|
||||
// idle time value.
|
||||
sessionMaxAge: 60000 * 60 * 24 * 7,
|
||||
// Session Revalidation in X ms (optional, default is 60 seconds).
|
||||
// Specifies how often a Single Page App should revalidate a session.
|
||||
// Does not impact the session life on the server, but causes clients
|
||||
// to refetch session info (even if it is in a local cache) after N
|
||||
// seconds has elapsed since it was last checked so they always display
|
||||
// state correctly.
|
||||
// If set to 0 will revalidate a session before rendering every page.
|
||||
sessionRevalidateAge: 60000,
|
||||
// Canonical URL of the server (optiona, but recommended).
|
||||
// e.g. 'http://localhost:3000' or 'https://www.example.com'
|
||||
// Used in callbak URLs and email sign in links. It will be auto
|
||||
// generated if not specified, which may cause problems if your site
|
||||
// uses multiple aliases (e.g. 'example.com and 'www.examples.com').
|
||||
serverUrl: process.env.SERVER_URL || null,
|
||||
// Add an Express Session store.
|
||||
expressSession: expressSession,
|
||||
sessionStore: sessionStore,
|
||||
// Define oAuth Providers
|
||||
providers: nextAuthProviders(),
|
||||
// Define functions for manging users and sending email.
|
||||
functions: functions,
|
||||
sessionResave : true
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -1,273 +0,0 @@
|
||||
/**
|
||||
* next-auth.functions.js Example
|
||||
*
|
||||
* This file defines functions NextAuth to look up, add and update users.
|
||||
*
|
||||
* It returns a Promise with the functions matching these signatures:
|
||||
*
|
||||
* {
|
||||
* find: ({
|
||||
* id,
|
||||
* email,
|
||||
* emailToken,
|
||||
* provider,
|
||||
* poviderToken
|
||||
* } = {}) => {},
|
||||
* update: (user) => {},
|
||||
* insert: (user) => {},
|
||||
* remove: (id) => {},
|
||||
* serialize: (user) => {},
|
||||
* deserialize: (id) => {}
|
||||
* }
|
||||
*
|
||||
* Each function returns Promise.resolve() - or Promise.reject() on error.
|
||||
*
|
||||
* This specific example supports both MongoDB and NeDB, but can be refactored
|
||||
* to work with any database.
|
||||
*
|
||||
* Environment variables for this example:
|
||||
*
|
||||
* MONGO_URI=mongodb://localhost:27017/my-database
|
||||
* EMAIL_FROM=username@gmail.com
|
||||
* EMAIL_SERVER=smtp.gmail.com
|
||||
* EMAIL_PORT=465
|
||||
* EMAIL_USERNAME=username@gmail.com
|
||||
* EMAIL_PASSWORD=p4ssw0rd
|
||||
*
|
||||
* If you wish, you can put these in a `.env` to seperate your environment
|
||||
* specific configuration from your code.
|
||||
**/
|
||||
|
||||
// Load environment variables from a .env file if one exists
|
||||
require('dotenv').load()
|
||||
|
||||
// This config file uses MongoDB for User accounts, as well as session storage.
|
||||
// This config includes options for NeDB, which it defaults to if no DB URI
|
||||
// is specified. NeDB is an in-memory only database intended here for testing.
|
||||
const MongoClient = require('mongodb').MongoClient
|
||||
const NeDB = require('nedb')
|
||||
const MongoObjectId = (process.env.MONGO_URI) ? require('mongodb').ObjectId : (id) => { return id }
|
||||
|
||||
// Use Node Mailer for email sign in
|
||||
const nodemailer = require('nodemailer')
|
||||
const nodemailerSmtpTransport = require('nodemailer-smtp-transport')
|
||||
const nodemailerDirectTransport = require('nodemailer-direct-transport')
|
||||
|
||||
// Send email direct from localhost if no mail server configured
|
||||
let nodemailerTransport = nodemailerDirectTransport()
|
||||
if (process.env.EMAIL_SERVER && process.env.EMAIL_USERNAME && process.env.EMAIL_PASSWORD) {
|
||||
nodemailerTransport = nodemailerSmtpTransport({
|
||||
host: process.env.EMAIL_SERVER,
|
||||
port: process.env.EMAIL_PORT || 25,
|
||||
secure: process.env.EMAIL_SECURE || true,
|
||||
auth: {
|
||||
user: process.env.EMAIL_USERNAME,
|
||||
pass: process.env.EMAIL_PASSWORD
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (process.env.MONGO_URI) {
|
||||
// Connect to MongoDB Database and return user connection
|
||||
MongoClient.connect(process.env.MONGO_URI, (err, mongoClient) => {
|
||||
if (err) return reject(err)
|
||||
const dbName = process.env.MONGO_URI.split('/').pop().split('?').shift()
|
||||
const db = mongoClient.db(dbName)
|
||||
return resolve(db.collection('users'))
|
||||
})
|
||||
} else {
|
||||
// If no MongoDB URI string specified, use NeDB, an in-memory work-a-like.
|
||||
// NeDB is not persistant and is intended for testing only.
|
||||
let collection = new NeDB({ autoload: true })
|
||||
collection.loadDatabase(err => {
|
||||
if (err) return reject(err)
|
||||
resolve(collection)
|
||||
})
|
||||
}
|
||||
})
|
||||
.then(usersCollection => {
|
||||
return Promise.resolve({
|
||||
// If a user is not found find() should return null (with no error).
|
||||
find: ({id, email, emailToken, provider} = {}) => {
|
||||
let query = {}
|
||||
|
||||
// Find needs to support looking up a user by ID, Email, Email Token,
|
||||
// and Provider Name + Users ID for that Provider
|
||||
if (id) {
|
||||
query = { _id: MongoObjectId(id) }
|
||||
} else if (email) {
|
||||
query = { email: email }
|
||||
} else if (emailToken) {
|
||||
query = { emailToken: emailToken }
|
||||
} else if (provider) {
|
||||
query = { [`${provider.name}.id`]: provider.id }
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
usersCollection.findOne(query, (err, user) => {
|
||||
if (err) return reject(err)
|
||||
return resolve(user)
|
||||
})
|
||||
})
|
||||
},
|
||||
// The user parameter contains a basic user object to be added to the DB.
|
||||
// The oAuthProfile parameter is passed when signing in via oAuth.
|
||||
//
|
||||
// The optional oAuthProfile parameter contains all properties associated
|
||||
// with the users account on the oAuth service they are signing in with.
|
||||
//
|
||||
// You can use this to capture profile.avatar, profile.location, etc.
|
||||
insert: (user, oAuthProfile) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
usersCollection.insert(user, (err, response) => {
|
||||
if (err) return reject(err)
|
||||
|
||||
// Mongo Client automatically adds an id to an inserted object, but
|
||||
// if using a work-a-like we may need to add it from the response.
|
||||
if (!user._id && response._id) user._id = response._id
|
||||
|
||||
return resolve(user)
|
||||
})
|
||||
})
|
||||
},
|
||||
// The user parameter contains a basic user object to be added to the DB.
|
||||
// The oAuthProfile parameter is passed when signing in via oAuth.
|
||||
//
|
||||
// The optional oAuthProfile parameter contains all properties associated
|
||||
// with the users account on the oAuth service they are signing in with.
|
||||
//
|
||||
// You can use this to capture profile.avatar, profile.location, etc.
|
||||
update: (user, profile) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
usersCollection.update({_id: MongoObjectId(user._id)}, user, {}, (err) => {
|
||||
if (err) return reject(err)
|
||||
return resolve(user)
|
||||
})
|
||||
})
|
||||
},
|
||||
// The remove parameter is passed the ID of a user account to delete.
|
||||
//
|
||||
// This method is not used in the current version of next-auth but will
|
||||
// be in a future release, to provide an endpoint for account deletion.
|
||||
remove: (id) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
usersCollection.remove({_id: MongoObjectId(id)}, (err) => {
|
||||
if (err) return reject(err)
|
||||
return resolve(true)
|
||||
})
|
||||
})
|
||||
},
|
||||
// Seralize turns the value of the ID key from a User object
|
||||
serialize: (user) => {
|
||||
// Supports serialization from Mongo Object *and* deserialize() object
|
||||
if (user.id) {
|
||||
// Handle responses from deserialize()
|
||||
return Promise.resolve(user.id)
|
||||
} else if (user._id) {
|
||||
// Handle responses from find(), insert(), update()
|
||||
return Promise.resolve(user._id)
|
||||
} else {
|
||||
return Promise.reject(new Error("Unable to serialise user"))
|
||||
}
|
||||
},
|
||||
// Deseralize turns a User ID into a normalized User object that is
|
||||
// exported to clients. It should not return private/sensitive fields,
|
||||
// only fields you want to expose via the user interface.
|
||||
deserialize: (id) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
usersCollection.findOne({ _id: MongoObjectId(id) }, (err, user) => {
|
||||
if (err) return reject(err)
|
||||
|
||||
// If user not found (e.g. account deleted) return null object
|
||||
if (!user) return resolve(null)
|
||||
|
||||
return resolve({
|
||||
id: user._id,
|
||||
name: user.name,
|
||||
email: user.email,
|
||||
emailVerified: user.emailVerified,
|
||||
admin: user.admin || false
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
// Email Sign In
|
||||
//
|
||||
// Accounts are created automatically, as when signing in via oAuth.
|
||||
// Users are sent one-time use sign in tokens in links. This avoids
|
||||
// storing user supplied passwords anywhere, preventing password re-use.
|
||||
//
|
||||
// To disable this option, do not set sendSignInEmail (or set it to null).
|
||||
sendSignInEmail: ({email, url, req}) => {
|
||||
nodemailer
|
||||
.createTransport(nodemailerTransport)
|
||||
.sendMail({
|
||||
to: email,
|
||||
from: process.env.EMAIL_FROM,
|
||||
subject: 'Sign in link',
|
||||
text: `Use the link below to sign in:\n\n${url}\n\n`,
|
||||
html: `<p>Use the link below to sign in:</p><p>${url}</p>`
|
||||
}, (err) => {
|
||||
if (err) {
|
||||
console.error('Error sending email to ' + email, err)
|
||||
}
|
||||
})
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
console.log('Generated sign in link ' + url + ' for ' + email)
|
||||
}
|
||||
},
|
||||
// Credentials Sign In
|
||||
//
|
||||
// If you use this you will need to define your own way to validate
|
||||
// credentials. Unlike with oAuth or Email Sign In, accounts are not
|
||||
// created automatically so you will need to provide a way to create them.
|
||||
//
|
||||
// This feature is intended for strategies like Two Factor Authentication.
|
||||
//
|
||||
// To disable this option, do not set signin (or set it to null).
|
||||
/*
|
||||
signIn: ({form, req}) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
// Should validate credentials (e.g. hash password, compare 2FA token
|
||||
// etc) and return a valid user object from a database.
|
||||
return usersCollection.findOne({
|
||||
email: form.email
|
||||
}, (err, user) => {
|
||||
if (err) return reject(err)
|
||||
if (!user) return resolve(null)
|
||||
|
||||
// Check credentials - e.g. compare bcrypt password hashes
|
||||
if (form.password === "test1234") {
|
||||
// If valid, return user object - e.g. { id, name, email }
|
||||
return resolve(user)
|
||||
} else {
|
||||
// If invalid, return null
|
||||
return resolve(null)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
*/
|
||||
// Session Object (optional)
|
||||
//
|
||||
// The session object that gets returned to the client. You don't need to
|
||||
// specify this function here unless you want to override or extend the
|
||||
// default (e.g. with any other properties you have added to req.session)
|
||||
//
|
||||
// Note: The object returned will be stored in localStorage and visible
|
||||
// client side so do not return data you would not want the user to see.
|
||||
/*
|
||||
session: (session, req) => {
|
||||
if (req.session && req.session.someCustomProperty)
|
||||
session.someCustomProperty = req.session.someCustomProperty
|
||||
|
||||
session.someOtherCustomProperty = "Example custom property"
|
||||
|
||||
return session
|
||||
}
|
||||
*/
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
/**
|
||||
* next-auth.providers.js Example
|
||||
*
|
||||
* This file returns a simple array of oAuth Provider objects for NextAuth.
|
||||
*
|
||||
* This example returns an array based on what environment variables are set,
|
||||
* with explicit support for Facebook, Google and Twitter, but it can be used
|
||||
* to add strategies for other oAuth providers.
|
||||
*
|
||||
* Environment variables for this example:
|
||||
*
|
||||
* FACEBOOK_ID=
|
||||
* FACEBOOK_SECRET=
|
||||
* GOOGLE_ID=
|
||||
* GOOGLE_SECRET=
|
||||
* TWITTER_KEY=
|
||||
* TWITTER_SECRET=
|
||||
*
|
||||
* If you wish, you can put these in a `.env` to seperate your environment
|
||||
* specific configuration from your code.
|
||||
**/
|
||||
|
||||
// Load environment variables from a .env file if one exists
|
||||
require('dotenv').load()
|
||||
|
||||
module.exports = () => {
|
||||
let providers = []
|
||||
|
||||
if (process.env.FACEBOOK_ID && process.env.FACEBOOK_SECRET) {
|
||||
providers.push({
|
||||
providerName: 'Facebook',
|
||||
providerOptions: {
|
||||
scope: ['email', 'public_profile']
|
||||
},
|
||||
Strategy: require('passport-facebook').Strategy,
|
||||
strategyOptions: {
|
||||
clientID: process.env.FACEBOOK_ID,
|
||||
clientSecret: process.env.FACEBOOK_SECRET,
|
||||
profileFields: ['id', 'displayName', 'email', 'link']
|
||||
},
|
||||
getProfile(profile) {
|
||||
// Normalize profile into one with {id, name, email} keys
|
||||
return {
|
||||
id: profile.id,
|
||||
name: profile.displayName,
|
||||
email: profile._json.email
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (process.env.LINKEDIN_ID && process.env.LINKEDIN_SECRET) {
|
||||
providers.push({
|
||||
providerName: 'Linkedin',
|
||||
providerOptions: {
|
||||
scope: ['r_emailaddress', 'r_basicprofile']
|
||||
},
|
||||
Strategy: require('passport-linkedin-oauth2').Strategy,
|
||||
strategyOptions: {
|
||||
clientID: process.env.LINKEDIN_ID,
|
||||
clientSecret: process.env.LINKEDIN_SECRET,
|
||||
profileFields: ['r_emailaddress', 'r_basicprofile']
|
||||
},
|
||||
getProfile(profile) {
|
||||
console.log(profile);
|
||||
// Normalize profile into one with {id, name, email} keys
|
||||
return {
|
||||
id: profile.id,
|
||||
// name: profile.displayName,
|
||||
// email: profile._json.email
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return providers
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
// next.config.js
|
||||
const withPlugins = require('next-compose-plugins');
|
||||
const optimizedImages = require('next-optimized-images');
|
||||
const webpack = require("webpack");
|
||||
|
||||
module.exports = withPlugins([
|
||||
[optimizedImages, {
|
||||
@@ -9,44 +8,5 @@ module.exports = withPlugins([
|
||||
}],
|
||||
|
||||
// your other plugins here
|
||||
// {
|
||||
// webpack: (config, { isServer }) => {
|
||||
|
||||
// // config.module.noParse = /jpg/;
|
||||
|
||||
// // config.module.rules.push(
|
||||
// // {
|
||||
// // test: /\.js$/,
|
||||
// // loader: 'babel-loader',
|
||||
// // exclude: /node_modules/,
|
||||
|
||||
// // },
|
||||
// // {
|
||||
// // test: /\.css$/,
|
||||
// // loader: 'style!css'
|
||||
// // },
|
||||
// // {
|
||||
// // test: /\.html$/,
|
||||
// // loader: 'raw'
|
||||
// // }
|
||||
// // )
|
||||
|
||||
// // const videojsPlugin = new webpack.ProvidePlugin({
|
||||
// // videojs: "video.js/dist/video.cjs.js",
|
||||
// // RecordRTC: "recordrtc",
|
||||
// // MediaStreamRecorder: ["recordrtc", "MediaStreamRecorder"]
|
||||
// // });
|
||||
// // const videojsAlias = {
|
||||
// // videojs: "video.js",
|
||||
// // WaveSurfer: "wavesurfer.js",
|
||||
// // RecordRTC: "recordrtc"
|
||||
// // };
|
||||
|
||||
|
||||
// // config.resolve.alias = { ...config.resolve.alias, ...videojsAlias };
|
||||
// // config.plugins.push(videojsPlugin);
|
||||
|
||||
// return config
|
||||
// }
|
||||
|
||||
]);
|
||||
+2
-2
@@ -6,10 +6,10 @@ case `uname` in
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../babel-generator/node_modules/jsesc/bin/jsesc" "$@"
|
||||
"$basedir/node" "$basedir/../jsesc/bin/jsesc" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../babel-generator/node_modules/jsesc/bin/jsesc" "$@"
|
||||
node "$basedir/../jsesc/bin/jsesc" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\babel-generator\node_modules\jsesc\bin\jsesc" %*
|
||||
"%~dp0\node.exe" "%~dp0\..\jsesc\bin\jsesc" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\babel-generator\node_modules\jsesc\bin\jsesc" %*
|
||||
node "%~dp0\..\jsesc\bin\jsesc" %*
|
||||
)
|
||||
+125
-255
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
+2
-2
@@ -108,7 +108,7 @@ function buildRootChain(opts, context) {
|
||||
({
|
||||
ignore: ignoreFile,
|
||||
config: babelrcFile
|
||||
} = (0, _files.findRelativeConfig)(pkgData, context.envName, context.caller));
|
||||
} = (0, _files.findRelativeConfig)(pkgData, context.envName));
|
||||
|
||||
if (ignoreFile && shouldIgnore(context, ignoreFile.ignore, null, ignoreFile.dirname)) {
|
||||
return null;
|
||||
@@ -338,7 +338,7 @@ function normalizeOptions(opts) {
|
||||
delete options.include;
|
||||
delete options.exclude;
|
||||
|
||||
if (options.hasOwnProperty("sourceMap")) {
|
||||
if (options.sourceMap) {
|
||||
options.sourceMaps = options.sourceMap;
|
||||
delete options.sourceMap;
|
||||
}
|
||||
|
||||
-18
@@ -3,7 +3,6 @@
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.findConfigUpwards = findConfigUpwards;
|
||||
exports.findRelativeConfig = findRelativeConfig;
|
||||
exports.findRootConfig = findRootConfig;
|
||||
exports.loadConfig = loadConfig;
|
||||
@@ -74,23 +73,6 @@ const BABELRC_FILENAME = ".babelrc";
|
||||
const BABELRC_JS_FILENAME = ".babelrc.js";
|
||||
const BABELIGNORE_FILENAME = ".babelignore";
|
||||
|
||||
function findConfigUpwards(rootDir) {
|
||||
let dirname = rootDir;
|
||||
|
||||
while (true) {
|
||||
if (_fs().default.existsSync(_path().default.join(dirname, BABEL_CONFIG_JS_FILENAME))) {
|
||||
return dirname;
|
||||
}
|
||||
|
||||
const nextDir = _path().default.dirname(dirname);
|
||||
|
||||
if (dirname === nextDir) break;
|
||||
dirname = nextDir;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function findRelativeConfig(packageData, envName, caller) {
|
||||
let config = null;
|
||||
let ignore = null;
|
||||
|
||||
-5
@@ -3,7 +3,6 @@
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.findConfigUpwards = findConfigUpwards;
|
||||
exports.findPackageData = findPackageData;
|
||||
exports.findRelativeConfig = findRelativeConfig;
|
||||
exports.findRootConfig = findRootConfig;
|
||||
@@ -13,10 +12,6 @@ exports.resolvePreset = resolvePreset;
|
||||
exports.loadPlugin = loadPlugin;
|
||||
exports.loadPreset = loadPreset;
|
||||
|
||||
function findConfigUpwards(rootDir) {
|
||||
return null;
|
||||
}
|
||||
|
||||
function findPackageData(filepath) {
|
||||
return {
|
||||
filepath,
|
||||
|
||||
-6
@@ -9,12 +9,6 @@ Object.defineProperty(exports, "findPackageData", {
|
||||
return _package.findPackageData;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "findConfigUpwards", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _configuration.findConfigUpwards;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "findRelativeConfig", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
|
||||
+2
-30
@@ -28,36 +28,8 @@ var _environment = require("./helpers/environment");
|
||||
|
||||
var _options = require("./validation/options");
|
||||
|
||||
var _files = require("./files");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function resolveRootMode(rootDir, rootMode) {
|
||||
switch (rootMode) {
|
||||
case "root":
|
||||
return rootDir;
|
||||
|
||||
case "upward-optional":
|
||||
{
|
||||
const upwardRootDir = (0, _files.findConfigUpwards)(rootDir);
|
||||
return upwardRootDir === null ? rootDir : upwardRootDir;
|
||||
}
|
||||
|
||||
case "upward":
|
||||
{
|
||||
const upwardRootDir = (0, _files.findConfigUpwards)(rootDir);
|
||||
if (upwardRootDir !== null) return upwardRootDir;
|
||||
throw Object.assign(new Error(`Babel was run with rootMode:"upward" but a root could not ` + `be found when searching upward from "${rootDir}"`), {
|
||||
code: "BABEL_ROOT_NOT_FOUND",
|
||||
dirname: rootDir
|
||||
});
|
||||
}
|
||||
|
||||
default:
|
||||
throw new Error(`Assertion failure - unknown rootMode value`);
|
||||
}
|
||||
}
|
||||
|
||||
function loadPrivatePartialConfig(inputOpts) {
|
||||
if (inputOpts != null && (typeof inputOpts !== "object" || Array.isArray(inputOpts))) {
|
||||
throw new Error("Babel options must be an object, null, or undefined");
|
||||
@@ -68,13 +40,13 @@ function loadPrivatePartialConfig(inputOpts) {
|
||||
envName = (0, _environment.getEnv)(),
|
||||
cwd = ".",
|
||||
root: rootDir = ".",
|
||||
rootMode = "root",
|
||||
caller
|
||||
} = args;
|
||||
|
||||
const absoluteCwd = _path().default.resolve(cwd);
|
||||
|
||||
const absoluteRootDir = resolveRootMode(_path().default.resolve(absoluteCwd, rootDir), rootMode);
|
||||
const absoluteRootDir = _path().default.resolve(absoluteCwd, rootDir);
|
||||
|
||||
const context = {
|
||||
filename: typeof args.filename === "string" ? _path().default.resolve(cwd, args.filename) : undefined,
|
||||
cwd: absoluteCwd,
|
||||
|
||||
-9
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
||||
});
|
||||
exports.msg = msg;
|
||||
exports.access = access;
|
||||
exports.assertRootMode = assertRootMode;
|
||||
exports.assertSourceMaps = assertSourceMaps;
|
||||
exports.assertCompact = assertCompact;
|
||||
exports.assertSourceType = assertSourceType;
|
||||
@@ -52,14 +51,6 @@ function access(loc, name) {
|
||||
};
|
||||
}
|
||||
|
||||
function assertRootMode(loc, value) {
|
||||
if (value !== undefined && value !== "root" && value !== "upward" && value !== "upward-optional") {
|
||||
throw new Error(`${msg(loc)} must be a "root", "upward", "upward-optional" or undefined`);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
function assertSourceMaps(loc, value) {
|
||||
if (value !== undefined && typeof value !== "boolean" && value !== "inline" && value !== "both") {
|
||||
throw new Error(`${msg(loc)} must be a boolean, "inline", "both", or undefined`);
|
||||
|
||||
-1
@@ -16,7 +16,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
||||
const ROOT_VALIDATORS = {
|
||||
cwd: _optionAssertions.assertString,
|
||||
root: _optionAssertions.assertString,
|
||||
rootMode: _optionAssertions.assertRootMode,
|
||||
configFile: _optionAssertions.assertConfigFileSearch,
|
||||
caller: _optionAssertions.assertCallerMetadata,
|
||||
filename: _optionAssertions.assertString,
|
||||
|
||||
+1
-3
@@ -183,9 +183,7 @@ class File {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (typeof versionRange !== "string") return true;
|
||||
if (_semver().default.valid(versionRange)) versionRange = `^${versionRange}`;
|
||||
return !_semver().default.intersects(`<${minVersion}`, versionRange) && !_semver().default.intersects(`>=8.0.0`, versionRange);
|
||||
return typeof versionRange !== "string" || !_semver().default.intersects(`<${minVersion}`, versionRange) && !_semver().default.intersects(`>=8.0.0`, versionRange);
|
||||
}
|
||||
|
||||
addHelper(name) {
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ function mergeSourceMap(inputMap, map) {
|
||||
}
|
||||
|
||||
function makeMappingKey(item) {
|
||||
return `${item.line}/${item.columnStart}`;
|
||||
return JSON.stringify([item.line, item.columnStart]);
|
||||
}
|
||||
|
||||
function eachOverlappingGeneratedOutputRange(outputFile, inputGeneratedRange, callback) {
|
||||
|
||||
+7
-10
@@ -1,14 +1,11 @@
|
||||
{
|
||||
"name": "@babel/core",
|
||||
"version": "7.1.2",
|
||||
"version": "7.0.0",
|
||||
"description": "Babel compiler core.",
|
||||
"main": "lib/index.js",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-core",
|
||||
"keywords": [
|
||||
"6to5",
|
||||
@@ -34,12 +31,12 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.0.0",
|
||||
"@babel/generator": "^7.1.2",
|
||||
"@babel/helpers": "^7.1.2",
|
||||
"@babel/parser": "^7.1.2",
|
||||
"@babel/template": "^7.1.2",
|
||||
"@babel/traverse": "^7.1.0",
|
||||
"@babel/types": "^7.1.2",
|
||||
"@babel/generator": "^7.0.0",
|
||||
"@babel/helpers": "^7.0.0",
|
||||
"@babel/parser": "^7.0.0",
|
||||
"@babel/template": "^7.0.0",
|
||||
"@babel/traverse": "^7.0.0",
|
||||
"@babel/types": "^7.0.0",
|
||||
"convert-source-map": "^1.1.0",
|
||||
"debug": "^3.1.0",
|
||||
"json5": "^0.5.0",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
+8
-36
@@ -8,9 +8,15 @@ exports.Program = Program;
|
||||
exports.BlockStatement = BlockStatement;
|
||||
exports.Noop = Noop;
|
||||
exports.Directive = Directive;
|
||||
exports.DirectiveLiteral = DirectiveLiteral;
|
||||
exports.InterpreterDirective = InterpreterDirective;
|
||||
exports.Placeholder = Placeholder;
|
||||
Object.defineProperty(exports, "DirectiveLiteral", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _types.StringLiteral;
|
||||
}
|
||||
});
|
||||
|
||||
var _types = require("./types");
|
||||
|
||||
function File(node) {
|
||||
if (node.program) {
|
||||
@@ -58,40 +64,6 @@ function Directive(node) {
|
||||
this.semicolon();
|
||||
}
|
||||
|
||||
const unescapedSingleQuoteRE = /(?:^|[^\\])(?:\\\\)*'/;
|
||||
const unescapedDoubleQuoteRE = /(?:^|[^\\])(?:\\\\)*"/;
|
||||
|
||||
function DirectiveLiteral(node) {
|
||||
const raw = this.getPossibleRaw(node);
|
||||
|
||||
if (raw != null) {
|
||||
this.token(raw);
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
value
|
||||
} = node;
|
||||
|
||||
if (!unescapedDoubleQuoteRE.test(value)) {
|
||||
this.token(`"${value}"`);
|
||||
} else if (!unescapedSingleQuoteRE.test(value)) {
|
||||
this.token(`'${value}'`);
|
||||
} else {
|
||||
throw new Error("Malformed AST: it is not possible to print a directive containing" + " both unescaped single and double quotes.");
|
||||
}
|
||||
}
|
||||
|
||||
function InterpreterDirective(node) {
|
||||
this.token(`#!${node.value}\n`);
|
||||
}
|
||||
|
||||
function Placeholder(node) {
|
||||
this.token("%%");
|
||||
this.print(node.name);
|
||||
this.token("%%");
|
||||
|
||||
if (node.expectedNode === "Statement") {
|
||||
this.semicolon();
|
||||
}
|
||||
}
|
||||
-8
@@ -8,7 +8,6 @@ exports.ClassBody = ClassBody;
|
||||
exports.ClassProperty = ClassProperty;
|
||||
exports.ClassPrivateProperty = ClassPrivateProperty;
|
||||
exports.ClassMethod = ClassMethod;
|
||||
exports.ClassPrivateMethod = ClassPrivateMethod;
|
||||
exports._classMethodHead = _classMethodHead;
|
||||
|
||||
function t() {
|
||||
@@ -161,13 +160,6 @@ function ClassMethod(node) {
|
||||
this.print(node.body, node);
|
||||
}
|
||||
|
||||
function ClassPrivateMethod(node) {
|
||||
this._classMethodHead(node);
|
||||
|
||||
this.space();
|
||||
this.print(node.body, node);
|
||||
}
|
||||
|
||||
function _classMethodHead(node) {
|
||||
this.printJoin(node.decorators, node);
|
||||
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ var n = _interopRequireWildcard(require("../node"));
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
|
||||
function UnaryExpression(node) {
|
||||
if (node.operator === "void" || node.operator === "delete" || node.operator === "typeof" || node.operator === "throw") {
|
||||
if (node.operator === "void" || node.operator === "delete" || node.operator === "typeof") {
|
||||
this.word(node.operator);
|
||||
this.space();
|
||||
} else {
|
||||
|
||||
+1
-17
@@ -133,23 +133,7 @@ function ArrowFunctionExpression(node) {
|
||||
const firstParam = node.params[0];
|
||||
|
||||
if (node.params.length === 1 && t().isIdentifier(firstParam) && !hasTypes(node, firstParam)) {
|
||||
if (this.format.retainLines && node.loc && node.body.loc && node.loc.start.line < node.body.loc.start.line) {
|
||||
this.token("(");
|
||||
|
||||
if (firstParam.loc && firstParam.loc.start.line > node.loc.start.line) {
|
||||
this.indent();
|
||||
this.print(firstParam, node);
|
||||
this.dedent();
|
||||
|
||||
this._catchUp("start", node.body.loc);
|
||||
} else {
|
||||
this.print(firstParam, node);
|
||||
}
|
||||
|
||||
this.token(")");
|
||||
} else {
|
||||
this.print(firstParam, node);
|
||||
}
|
||||
this.print(firstParam, node);
|
||||
} else {
|
||||
this._params(node);
|
||||
}
|
||||
|
||||
-20
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.Identifier = Identifier;
|
||||
exports.ArgumentPlaceholder = ArgumentPlaceholder;
|
||||
exports.SpreadElement = exports.RestElement = RestElement;
|
||||
exports.ObjectPattern = exports.ObjectExpression = ObjectExpression;
|
||||
exports.ObjectMethod = ObjectMethod;
|
||||
@@ -16,9 +15,6 @@ exports.NullLiteral = NullLiteral;
|
||||
exports.NumericLiteral = NumericLiteral;
|
||||
exports.StringLiteral = StringLiteral;
|
||||
exports.BigIntLiteral = BigIntLiteral;
|
||||
exports.PipelineTopicExpression = PipelineTopicExpression;
|
||||
exports.PipelineBareFunction = PipelineBareFunction;
|
||||
exports.PipelinePrimaryTopicReference = PipelinePrimaryTopicReference;
|
||||
|
||||
function t() {
|
||||
const data = _interopRequireWildcard(require("@babel/types"));
|
||||
@@ -50,10 +46,6 @@ function Identifier(node) {
|
||||
});
|
||||
}
|
||||
|
||||
function ArgumentPlaceholder() {
|
||||
this.token("?");
|
||||
}
|
||||
|
||||
function RestElement(node) {
|
||||
this.token("...");
|
||||
this.print(node.argument, node);
|
||||
@@ -184,15 +176,3 @@ function BigIntLiteral(node) {
|
||||
|
||||
this.token(node.value);
|
||||
}
|
||||
|
||||
function PipelineTopicExpression(node) {
|
||||
this.print(node.expression, node);
|
||||
}
|
||||
|
||||
function PipelineBareFunction(node) {
|
||||
this.print(node.callee, node);
|
||||
}
|
||||
|
||||
function PipelinePrimaryTopicReference() {
|
||||
this.token("#");
|
||||
}
|
||||
+1
-40
@@ -17,7 +17,6 @@ exports.tsPrintPropertyOrMethodName = tsPrintPropertyOrMethodName;
|
||||
exports.TSMethodSignature = TSMethodSignature;
|
||||
exports.TSIndexSignature = TSIndexSignature;
|
||||
exports.TSAnyKeyword = TSAnyKeyword;
|
||||
exports.TSUnknownKeyword = TSUnknownKeyword;
|
||||
exports.TSNumberKeyword = TSNumberKeyword;
|
||||
exports.TSObjectKeyword = TSObjectKeyword;
|
||||
exports.TSBooleanKeyword = TSBooleanKeyword;
|
||||
@@ -39,8 +38,6 @@ exports.tsPrintTypeLiteralOrInterfaceBody = tsPrintTypeLiteralOrInterfaceBody;
|
||||
exports.tsPrintBraced = tsPrintBraced;
|
||||
exports.TSArrayType = TSArrayType;
|
||||
exports.TSTupleType = TSTupleType;
|
||||
exports.TSOptionalType = TSOptionalType;
|
||||
exports.TSRestType = TSRestType;
|
||||
exports.TSUnionType = TSUnionType;
|
||||
exports.TSIntersectionType = TSIntersectionType;
|
||||
exports.tsPrintUnionOrIntersectionType = tsPrintUnionOrIntersectionType;
|
||||
@@ -61,7 +58,6 @@ exports.TSEnumDeclaration = TSEnumDeclaration;
|
||||
exports.TSEnumMember = TSEnumMember;
|
||||
exports.TSModuleDeclaration = TSModuleDeclaration;
|
||||
exports.TSModuleBlock = TSModuleBlock;
|
||||
exports.TSImportType = TSImportType;
|
||||
exports.TSImportEqualsDeclaration = TSImportEqualsDeclaration;
|
||||
exports.TSExternalModuleReference = TSExternalModuleReference;
|
||||
exports.TSNonNullExpression = TSNonNullExpression;
|
||||
@@ -216,10 +212,6 @@ function TSAnyKeyword() {
|
||||
this.word("any");
|
||||
}
|
||||
|
||||
function TSUnknownKeyword() {
|
||||
this.word("unknown");
|
||||
}
|
||||
|
||||
function TSNumberKeyword() {
|
||||
this.word("number");
|
||||
}
|
||||
@@ -334,7 +326,7 @@ function tsPrintBraced(members, node) {
|
||||
}
|
||||
|
||||
function TSArrayType(node) {
|
||||
this.print(node.elementType, node);
|
||||
this.print(node.elementType);
|
||||
this.token("[]");
|
||||
}
|
||||
|
||||
@@ -344,16 +336,6 @@ function TSTupleType(node) {
|
||||
this.token("]");
|
||||
}
|
||||
|
||||
function TSOptionalType(node) {
|
||||
this.print(node.typeAnnotation, node);
|
||||
this.token("?");
|
||||
}
|
||||
|
||||
function TSRestType(node) {
|
||||
this.token("...");
|
||||
this.print(node.typeAnnotation, node);
|
||||
}
|
||||
|
||||
function TSUnionType(node) {
|
||||
this.tsPrintUnionOrIntersectionType(node, "|");
|
||||
}
|
||||
@@ -627,27 +609,6 @@ function TSModuleBlock(node) {
|
||||
this.tsPrintBraced(node.body, node);
|
||||
}
|
||||
|
||||
function TSImportType(node) {
|
||||
const {
|
||||
argument,
|
||||
qualifier,
|
||||
typeParameters
|
||||
} = node;
|
||||
this.word("import");
|
||||
this.token("(");
|
||||
this.print(argument, node);
|
||||
this.token(")");
|
||||
|
||||
if (qualifier) {
|
||||
this.token(".");
|
||||
this.print(qualifier, node);
|
||||
}
|
||||
|
||||
if (typeParameters) {
|
||||
this.print(typeParameters, node);
|
||||
}
|
||||
}
|
||||
|
||||
function TSImportEqualsDeclaration(node) {
|
||||
const {
|
||||
isExport,
|
||||
|
||||
+3
-18
@@ -3,8 +3,7 @@
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.NullableTypeAnnotation = NullableTypeAnnotation;
|
||||
exports.FunctionTypeAnnotation = FunctionTypeAnnotation;
|
||||
exports.FunctionTypeAnnotation = exports.NullableTypeAnnotation = NullableTypeAnnotation;
|
||||
exports.UpdateExpression = UpdateExpression;
|
||||
exports.ObjectExpression = ObjectExpression;
|
||||
exports.DoExpression = DoExpression;
|
||||
@@ -12,7 +11,6 @@ exports.Binary = Binary;
|
||||
exports.IntersectionTypeAnnotation = exports.UnionTypeAnnotation = UnionTypeAnnotation;
|
||||
exports.TSAsExpression = TSAsExpression;
|
||||
exports.TSTypeAssertion = TSTypeAssertion;
|
||||
exports.TSIntersectionType = exports.TSUnionType = TSUnionType;
|
||||
exports.BinaryExpression = BinaryExpression;
|
||||
exports.SequenceExpression = SequenceExpression;
|
||||
exports.AwaitExpression = exports.YieldExpression = YieldExpression;
|
||||
@@ -21,7 +19,6 @@ exports.UnaryLike = UnaryLike;
|
||||
exports.FunctionExpression = FunctionExpression;
|
||||
exports.ArrowFunctionExpression = ArrowFunctionExpression;
|
||||
exports.ConditionalExpression = ConditionalExpression;
|
||||
exports.OptionalMemberExpression = OptionalMemberExpression;
|
||||
exports.AssignmentExpression = AssignmentExpression;
|
||||
exports.NewExpression = NewExpression;
|
||||
|
||||
@@ -70,10 +67,6 @@ function NullableTypeAnnotation(node, parent) {
|
||||
return t().isArrayTypeAnnotation(parent);
|
||||
}
|
||||
|
||||
function FunctionTypeAnnotation(node, parent) {
|
||||
return t().isUnionTypeAnnotation(parent) || t().isIntersectionTypeAnnotation(parent) || t().isArrayTypeAnnotation(parent);
|
||||
}
|
||||
|
||||
function UpdateExpression(node, parent) {
|
||||
return t().isMemberExpression(parent, {
|
||||
object: node
|
||||
@@ -135,10 +128,6 @@ function TSTypeAssertion() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function TSUnionType(node, parent) {
|
||||
return t().isTSArrayType(parent) || t().isTSOptionalType(parent) || t().isTSIntersectionType(parent) || t().isTSUnionType(parent) || t().isTSRestType(parent);
|
||||
}
|
||||
|
||||
function BinaryExpression(node, parent) {
|
||||
return node.operator === "in" && (t().isVariableDeclarator(parent) || t().isFor(parent));
|
||||
}
|
||||
@@ -152,7 +141,7 @@ function SequenceExpression(node, parent) {
|
||||
}
|
||||
|
||||
function YieldExpression(node, parent) {
|
||||
return t().isBinary(parent) || t().isUnaryLike(parent) || t().isCallExpression(parent) || t().isMemberExpression(parent) || t().isNewExpression(parent) || t().isAwaitExpression(parent) && t().isYieldExpression(node) || t().isConditionalExpression(parent) && node === parent.test || isClassExtendsClause(node, parent);
|
||||
return t().isBinary(parent) || t().isUnaryLike(parent) || t().isCallExpression(parent) || t().isMemberExpression(parent) || t().isNewExpression(parent) || t().isConditionalExpression(parent) && node === parent.test || isClassExtendsClause(node, parent);
|
||||
}
|
||||
|
||||
function ClassExpression(node, parent, printStack) {
|
||||
@@ -187,17 +176,13 @@ function ArrowFunctionExpression(node, parent) {
|
||||
function ConditionalExpression(node, parent) {
|
||||
if (t().isUnaryLike(parent) || t().isBinary(parent) || t().isConditionalExpression(parent, {
|
||||
test: node
|
||||
}) || t().isAwaitExpression(parent) || t().isOptionalMemberExpression(parent) || t().isTaggedTemplateExpression(parent) || t().isTSTypeAssertion(parent) || t().isTSAsExpression(parent)) {
|
||||
}) || t().isAwaitExpression(parent) || t().isTaggedTemplateExpression(parent) || t().isTSTypeAssertion(parent) || t().isTSAsExpression(parent)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return UnaryLike(node, parent);
|
||||
}
|
||||
|
||||
function OptionalMemberExpression(node, parent) {
|
||||
return t().isCallExpression(parent) || t().isMemberExpression(parent);
|
||||
}
|
||||
|
||||
function AssignmentExpression(node) {
|
||||
if (t().isObjectPattern(node.left)) {
|
||||
return true;
|
||||
|
||||
+7
-7
@@ -292,14 +292,14 @@ class Printer {
|
||||
|
||||
if (needsParens) this.token("(");
|
||||
|
||||
this._printLeadingComments(node);
|
||||
this._printLeadingComments(node, parent);
|
||||
|
||||
const loc = t().isProgram(node) || t().isFile(node) ? null : node.loc;
|
||||
this.withSource("start", loc, () => {
|
||||
printMethod.call(this, node, parent);
|
||||
this[node.type](node, parent);
|
||||
});
|
||||
|
||||
this._printTrailingComments(node);
|
||||
this._printTrailingComments(node, parent);
|
||||
|
||||
if (needsParens) this.token(")");
|
||||
|
||||
@@ -392,12 +392,12 @@ class Printer {
|
||||
this.print(node, parent);
|
||||
}
|
||||
|
||||
_printTrailingComments(node) {
|
||||
this._printComments(this._getComments(false, node));
|
||||
_printTrailingComments(node, parent) {
|
||||
this._printComments(this._getComments(false, node, parent));
|
||||
}
|
||||
|
||||
_printLeadingComments(node) {
|
||||
this._printComments(this._getComments(true, node));
|
||||
_printLeadingComments(node, parent) {
|
||||
this._printComments(this._getComments(true, node, parent));
|
||||
}
|
||||
|
||||
printInnerComments(node, indent = true) {
|
||||
|
||||
+6
-10
@@ -1,28 +1,24 @@
|
||||
{
|
||||
"name": "@babel/generator",
|
||||
"version": "7.4.4",
|
||||
"version": "7.0.0",
|
||||
"description": "Turns an AST into code.",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-generator",
|
||||
"main": "lib/index.js",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.4.4",
|
||||
"@babel/types": "^7.0.0",
|
||||
"jsesc": "^2.5.1",
|
||||
"lodash": "^4.17.11",
|
||||
"lodash": "^4.17.10",
|
||||
"source-map": "^0.5.0",
|
||||
"trim-right": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-fixtures": "^7.4.4",
|
||||
"@babel/parser": "^7.4.4"
|
||||
},
|
||||
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba"
|
||||
"@babel/helper-fixtures": "^7.0.0",
|
||||
"@babel/parser": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ function _default(path, scope = path.scope) {
|
||||
};
|
||||
path.traverse(visitor, state);
|
||||
|
||||
if (state.foundArguments || state.foundThis) {
|
||||
if (state.foundArguments) {
|
||||
callee = t().memberExpression(container, t().identifier("apply"));
|
||||
args = [];
|
||||
|
||||
|
||||
+5
-6
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-call-delegate",
|
||||
"version": "7.4.4",
|
||||
"version": "7.1.0",
|
||||
"description": "Helper function to call delegate",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-call-delegate",
|
||||
"license": "MIT",
|
||||
@@ -9,9 +9,8 @@
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-hoist-variables": "^7.4.4",
|
||||
"@babel/traverse": "^7.4.4",
|
||||
"@babel/types": "^7.4.4"
|
||||
},
|
||||
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba"
|
||||
"@babel/helper-hoist-variables": "^7.0.0",
|
||||
"@babel/traverse": "^7.1.0",
|
||||
"@babel/types": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ function push(mutatorMap, node, kind, file, scope) {
|
||||
}
|
||||
|
||||
function hasComputed(mutatorMap) {
|
||||
for (const key of Object.keys(mutatorMap)) {
|
||||
for (const key in mutatorMap) {
|
||||
if (mutatorMap[key]._computed) {
|
||||
return true;
|
||||
}
|
||||
|
||||
+4
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-define-map",
|
||||
"version": "7.4.4",
|
||||
"version": "7.1.0",
|
||||
"description": "Helper function to define a map",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-define-map",
|
||||
"license": "MIT",
|
||||
@@ -10,8 +10,7 @@
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-function-name": "^7.1.0",
|
||||
"@babel/types": "^7.4.4",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba"
|
||||
"@babel/types": "^7.0.0",
|
||||
"lodash": "^4.17.10"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ function splitExportDeclaration(exportDeclaration) {
|
||||
exportDeclaration.replaceWith(updatedDeclaration);
|
||||
|
||||
if (needBindingRegistration) {
|
||||
scope.registerDeclaration(exportDeclaration);
|
||||
scope.registerBinding(isClassDeclaration ? "let" : "var", exportDeclaration);
|
||||
}
|
||||
|
||||
return exportDeclaration;
|
||||
|
||||
+3
-7
@@ -1,15 +1,11 @@
|
||||
{
|
||||
"name": "@babel/helper-split-export-declaration",
|
||||
"version": "7.4.4",
|
||||
"version": "7.0.0",
|
||||
"description": "",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-split-export-declaration",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.4.4"
|
||||
},
|
||||
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba"
|
||||
"@babel/types": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
+401
-557
File diff suppressed because it is too large
Load Diff
+5
-6
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helpers",
|
||||
"version": "7.4.4",
|
||||
"version": "7.1.0",
|
||||
"description": "Collection of helper functions used by Babel transforms.",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -11,12 +11,11 @@
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helpers",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/template": "^7.4.4",
|
||||
"@babel/traverse": "^7.4.4",
|
||||
"@babel/types": "^7.4.4"
|
||||
"@babel/template": "^7.1.0",
|
||||
"@babel/traverse": "^7.1.0",
|
||||
"@babel/types": "^7.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
},
|
||||
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
> A JavaScript parser
|
||||
|
||||
See our website [@babel/parser](https://babeljs.io/docs/en/next/babel-parser.html) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A+parser+%28babylon%29%22+is%3Aopen) associated with this package.
|
||||
See our website [@babel/parser](https://babeljs.io/docs/en/next/babel-parser.html) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20babylon%22+is%3Aopen) associated with this package.
|
||||
|
||||
## Install
|
||||
|
||||
|
||||
+6650
-7432
File diff suppressed because it is too large
Load Diff
+5
-7
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/parser",
|
||||
"version": "7.4.4",
|
||||
"version": "7.1.0",
|
||||
"description": "A JavaScript parser",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -28,13 +28,11 @@
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/code-frame": "^7.0.0",
|
||||
"@babel/helper-fixtures": "^7.4.4",
|
||||
"charcodes": "^0.2.0",
|
||||
"unicode-12.0.0": "^0.7.9"
|
||||
"@babel/helper-fixtures": "^7.0.0",
|
||||
"charcodes": "0.1.0",
|
||||
"unicode-11.0.0": "^0.7.7"
|
||||
},
|
||||
"bin": {
|
||||
"parser": "./bin/babel-parser.js"
|
||||
},
|
||||
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-27
@@ -78,14 +78,6 @@ export interface ParserOptions {
|
||||
* Adds all parsed tokens to a tokens property on the File node.
|
||||
*/
|
||||
tokens?: boolean;
|
||||
|
||||
/**
|
||||
* By default, the parser adds information about parentheses by setting
|
||||
* `extra.parenthesized` to `true` as needed.
|
||||
* When this option is `true` the parser creates `ParenthesizedExpression`
|
||||
* AST nodes instead of using the `extra` property.
|
||||
*/
|
||||
createParenthesizedExpressions?: boolean;
|
||||
}
|
||||
|
||||
export type ParserPlugin =
|
||||
@@ -114,22 +106,4 @@ export type ParserPlugin =
|
||||
'optionalCatchBinding' |
|
||||
'throwExpressions' |
|
||||
'pipelineOperator' |
|
||||
'nullishCoalescingOperator' |
|
||||
ParserPluginWithOptions;
|
||||
|
||||
export type ParserPluginWithOptions =
|
||||
['decorators', DecoratorsPluginOptions] |
|
||||
['pipelineOperator', PipelineOperatorPluginOptions] |
|
||||
['flow', FlowPluginOptions];
|
||||
|
||||
export interface DecoratorsPluginOptions {
|
||||
decoratorsBeforeExport?: boolean;
|
||||
}
|
||||
|
||||
export interface PipelineOperatorPluginOptions {
|
||||
proposal: 'minimal' | 'smart';
|
||||
}
|
||||
|
||||
export interface FlowPluginOptions {
|
||||
all?: boolean;
|
||||
}
|
||||
'nullishCoalescingOperator';
|
||||
|
||||
Generated
Vendored
-1
@@ -119,7 +119,6 @@ var _default = (0, _helperPluginUtils().declare)(api => {
|
||||
|
||||
};
|
||||
return {
|
||||
name: "proposal-async-generator-functions",
|
||||
inherits: _pluginSyntaxAsyncGenerators().default,
|
||||
visitor: {
|
||||
Program(path, state) {
|
||||
|
||||
Generated
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-proposal-async-generator-functions",
|
||||
"version": "7.2.0",
|
||||
"version": "7.1.0",
|
||||
"description": "Turn async generator functions into ES2015 generators",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-async-generator-functions",
|
||||
"license": "MIT",
|
||||
@@ -14,13 +14,13 @@
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.0.0",
|
||||
"@babel/helper-remap-async-to-generator": "^7.1.0",
|
||||
"@babel/plugin-syntax-async-generators": "^7.2.0"
|
||||
"@babel/plugin-syntax-async-generators": "^7.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.2.0",
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
+26
-86
@@ -232,26 +232,6 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
}
|
||||
|
||||
};
|
||||
const staticPrivatePropertyHandlerSpec = Object.assign({}, privateNameHandlerSpec, {
|
||||
get(member) {
|
||||
const {
|
||||
file,
|
||||
privateId,
|
||||
classRef
|
||||
} = this;
|
||||
return _core().types.callExpression(file.addHelper("classStaticPrivateFieldSpecGet"), [this.receiver(member), _core().types.cloneNode(classRef), _core().types.cloneNode(privateId)]);
|
||||
},
|
||||
|
||||
set(member, value) {
|
||||
const {
|
||||
file,
|
||||
privateId,
|
||||
classRef
|
||||
} = this;
|
||||
return _core().types.callExpression(file.addHelper("classStaticPrivateFieldSpecSet"), [this.receiver(member), _core().types.cloneNode(classRef), _core().types.cloneNode(privateId), value]);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function buildClassPropertySpec(ref, path, state) {
|
||||
const {
|
||||
@@ -308,7 +288,7 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
});
|
||||
}
|
||||
|
||||
function buildClassPrivatePropertyLooseHelper(ref, path, state) {
|
||||
function buildClassPrivatePropertyLoose(ref, path, initNodes, state) {
|
||||
const {
|
||||
parentPath,
|
||||
scope
|
||||
@@ -322,68 +302,27 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
prop,
|
||||
file: state
|
||||
}, privateNameHandlerLoose));
|
||||
return {
|
||||
keyDecl: _core().template.statement`var PROP = HELPER(NAME);`({
|
||||
PROP: prop,
|
||||
HELPER: state.addHelper("classPrivateFieldLooseKey"),
|
||||
NAME: _core().types.stringLiteral(name)
|
||||
}),
|
||||
buildInit: () => _core().template.statement.ast`
|
||||
Object.defineProperty(${ref}, ${prop}, {
|
||||
// configurable is false by default
|
||||
// enumerable is false by default
|
||||
writable: true,
|
||||
value: ${path.node.value || scope.buildUndefinedNode()}
|
||||
});
|
||||
`
|
||||
};
|
||||
}
|
||||
|
||||
function buildClassInstancePrivatePropertyLoose(ref, path, initNodes, state) {
|
||||
const {
|
||||
keyDecl,
|
||||
buildInit
|
||||
} = buildClassPrivatePropertyLooseHelper(ref, path, state);
|
||||
initNodes.push(keyDecl);
|
||||
return buildInit;
|
||||
}
|
||||
|
||||
function buildClassStaticPrivatePropertyLoose(ref, path, state) {
|
||||
const {
|
||||
keyDecl,
|
||||
buildInit
|
||||
} = buildClassPrivatePropertyLooseHelper(ref, path, state);
|
||||
return [keyDecl, buildInit()];
|
||||
}
|
||||
|
||||
function buildClassStaticPrivatePropertySpec(ref, path, state) {
|
||||
const {
|
||||
parentPath,
|
||||
scope
|
||||
} = path;
|
||||
const {
|
||||
name
|
||||
} = path.node.key.id;
|
||||
const privateId = scope.generateUidIdentifier(name);
|
||||
(0, _helperMemberExpressionToFunctions().default)(parentPath, privateNameVisitor, Object.assign({
|
||||
name,
|
||||
privateId,
|
||||
classRef: ref,
|
||||
file: state
|
||||
}, staticPrivatePropertyHandlerSpec));
|
||||
return [_core().template.statement.ast`
|
||||
var ${privateId} = {
|
||||
// configurable is always false for private elements
|
||||
// enumerable is always false for private elements
|
||||
writable: true,
|
||||
value: ${path.node.value || scope.buildUndefinedNode()}
|
||||
}
|
||||
`];
|
||||
initNodes.push(_core().template.statement`var PROP = HELPER(NAME);`({
|
||||
PROP: prop,
|
||||
HELPER: state.addHelper("classPrivateFieldLooseKey"),
|
||||
NAME: _core().types.stringLiteral(name)
|
||||
}));
|
||||
return () => _core().template.statement`
|
||||
Object.defineProperty(REF, PROP, {
|
||||
// configurable is false by default
|
||||
// enumerable is false by default
|
||||
writable: true,
|
||||
value: VALUE
|
||||
});
|
||||
`({
|
||||
REF: ref,
|
||||
PROP: prop,
|
||||
VALUE: path.node.value || scope.buildUndefinedNode()
|
||||
});
|
||||
}
|
||||
|
||||
const buildClassProperty = loose ? buildClassPropertyLoose : buildClassPropertySpec;
|
||||
const buildClassPrivateProperty = loose ? buildClassInstancePrivatePropertyLoose : buildClassPrivatePropertySpec;
|
||||
const buildClassStaticPrivateProperty = loose ? buildClassStaticPrivatePropertyLoose : buildClassStaticPrivatePropertySpec;
|
||||
const buildClassPrivateProperty = loose ? buildClassPrivatePropertyLoose : buildClassPrivatePropertySpec;
|
||||
return {
|
||||
inherits: _pluginSyntaxClassProperties().default,
|
||||
visitor: {
|
||||
@@ -411,6 +350,7 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
|
||||
if (path.isClassPrivateProperty()) {
|
||||
const {
|
||||
static: isStatic,
|
||||
key: {
|
||||
id: {
|
||||
name
|
||||
@@ -418,6 +358,10 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
}
|
||||
} = path.node;
|
||||
|
||||
if (isStatic) {
|
||||
throw path.buildCodeFrameError("Static class fields are not spec'ed yet.");
|
||||
}
|
||||
|
||||
if (privateNames.has(name)) {
|
||||
throw path.buildCodeFrameError("Duplicate private field");
|
||||
}
|
||||
@@ -466,7 +410,7 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
const privateMapInits = [];
|
||||
|
||||
for (const prop of props) {
|
||||
if (prop.isPrivate() && !prop.node.static) {
|
||||
if (prop.isPrivate()) {
|
||||
const inits = [];
|
||||
privateMapInits.push(inits);
|
||||
privateMaps.push(buildClassPrivateProperty(_core().types.thisExpression(), prop, inits, state));
|
||||
@@ -477,11 +421,7 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
|
||||
for (const prop of props) {
|
||||
if (prop.node.static) {
|
||||
if (prop.isPrivate()) {
|
||||
staticNodes.push(...buildClassStaticPrivateProperty(_core().types.cloneNode(ref), prop, state));
|
||||
} else {
|
||||
staticNodes.push(buildClassProperty(_core().types.cloneNode(ref), prop, state));
|
||||
}
|
||||
staticNodes.push(buildClassProperty(_core().types.cloneNode(ref), prop, state));
|
||||
} else if (prop.isPrivate()) {
|
||||
instanceBody.push(privateMaps[p]());
|
||||
staticNodes.push(...privateMapInits[p]);
|
||||
|
||||
+3
-6
@@ -1,22 +1,19 @@
|
||||
{
|
||||
"name": "@babel/plugin-proposal-class-properties",
|
||||
"version": "7.1.0",
|
||||
"version": "7.0.0",
|
||||
"description": "This plugin transforms static class properties as well as properties declared with the property initializer syntax",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-class-properties",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-function-name": "^7.1.0",
|
||||
"@babel/helper-function-name": "^7.0.0",
|
||||
"@babel/helper-member-expression-to-functions": "^7.0.0",
|
||||
"@babel/helper-optimise-call-expression": "^7.0.0",
|
||||
"@babel/helper-plugin-utils": "^7.0.0",
|
||||
"@babel/helper-replace-supers": "^7.1.0",
|
||||
"@babel/helper-replace-supers": "^7.0.0",
|
||||
"@babel/plugin-syntax-class-properties": "^7.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
-2
@@ -56,7 +56,6 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
|
||||
if (method && module) {
|
||||
return {
|
||||
name: "transform-async-to-generator",
|
||||
visitor: {
|
||||
Function(path, state) {
|
||||
if (!path.node.async || path.node.generator) return;
|
||||
@@ -78,7 +77,6 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
}
|
||||
|
||||
return {
|
||||
name: "transform-async-to-generator",
|
||||
visitor: {
|
||||
Function(path, state) {
|
||||
if (!path.node.async || path.node.generator) return;
|
||||
|
||||
+3
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-async-to-generator",
|
||||
"version": "7.4.4",
|
||||
"version": "7.1.0",
|
||||
"description": "Turn async functions into ES2015 generators",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-async-to-generator",
|
||||
"license": "MIT",
|
||||
@@ -20,8 +20,7 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.4.4",
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
},
|
||||
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
-1
@@ -80,7 +80,6 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
} = options;
|
||||
const VISITED = Symbol();
|
||||
return {
|
||||
name: "transform-classes",
|
||||
visitor: {
|
||||
ExportDefaultDeclaration(path) {
|
||||
if (!path.get("declaration").isClassDeclaration()) return;
|
||||
|
||||
+88
-43
@@ -67,6 +67,42 @@ function buildConstructor(classRef, constructorBody, node) {
|
||||
return func;
|
||||
}
|
||||
|
||||
const verifyConstructorVisitor = _core().traverse.visitors.merge([_helperReplaceSupers().environmentVisitor, {
|
||||
Super(path, state) {
|
||||
if (state.isDerived) return;
|
||||
const {
|
||||
node,
|
||||
parentPath
|
||||
} = path;
|
||||
|
||||
if (parentPath.isCallExpression({
|
||||
callee: node
|
||||
})) {
|
||||
throw path.buildCodeFrameError("super() is only allowed in a derived constructor");
|
||||
}
|
||||
},
|
||||
|
||||
ThisExpression(path, state) {
|
||||
if (!state.isDerived) return;
|
||||
const {
|
||||
node,
|
||||
parentPath
|
||||
} = path;
|
||||
|
||||
if (parentPath.isMemberExpression({
|
||||
object: node
|
||||
})) {
|
||||
return;
|
||||
}
|
||||
|
||||
const assertion = _core().types.callExpression(state.file.addHelper("assertThisInitialized"), [node]);
|
||||
|
||||
path.replaceWith(assertion);
|
||||
path.skip();
|
||||
}
|
||||
|
||||
}]);
|
||||
|
||||
function transformClass(path, file, builtinClasses, isLoose) {
|
||||
const classState = {
|
||||
parent: undefined,
|
||||
@@ -89,6 +125,7 @@ function transformClass(path, file, builtinClasses, isLoose) {
|
||||
instancePropRefs: {},
|
||||
staticPropBody: [],
|
||||
body: [],
|
||||
bareSupers: new Set(),
|
||||
superThises: [],
|
||||
pushedConstructor: false,
|
||||
pushedInherits: false,
|
||||
@@ -200,6 +237,14 @@ function transformClass(path, file, builtinClasses, isLoose) {
|
||||
|
||||
if (_core().types.isClassMethod(node)) {
|
||||
const isConstructor = node.kind === "constructor";
|
||||
|
||||
if (isConstructor) {
|
||||
path.traverse(verifyConstructorVisitor, {
|
||||
isDerived: classState.isDerived,
|
||||
file: classState.file
|
||||
});
|
||||
}
|
||||
|
||||
const replaceSupers = new (_helperReplaceSupers().default)({
|
||||
methodPath: path,
|
||||
objectRef: classState.classRef,
|
||||
@@ -208,18 +253,34 @@ function transformClass(path, file, builtinClasses, isLoose) {
|
||||
file: classState.file
|
||||
});
|
||||
replaceSupers.replace();
|
||||
const superReturns = [];
|
||||
const state = {
|
||||
returns: [],
|
||||
bareSupers: new Set()
|
||||
};
|
||||
path.traverse(_core().traverse.visitors.merge([_helperReplaceSupers().environmentVisitor, {
|
||||
ReturnStatement(path) {
|
||||
ReturnStatement(path, state) {
|
||||
if (!path.getFunctionParent().isArrowFunctionExpression()) {
|
||||
superReturns.push(path);
|
||||
state.returns.push(path);
|
||||
}
|
||||
},
|
||||
|
||||
Super(path, state) {
|
||||
const {
|
||||
node,
|
||||
parentPath
|
||||
} = path;
|
||||
|
||||
if (parentPath.isCallExpression({
|
||||
callee: node
|
||||
})) {
|
||||
state.bareSupers.add(parentPath);
|
||||
}
|
||||
}
|
||||
|
||||
}]));
|
||||
}]), state);
|
||||
|
||||
if (isConstructor) {
|
||||
pushConstructor(superReturns, node, path);
|
||||
pushConstructor(state, node, path);
|
||||
} else {
|
||||
pushMethod(node, path);
|
||||
}
|
||||
@@ -315,6 +376,7 @@ function transformClass(path, file, builtinClasses, isLoose) {
|
||||
const path = classState.userConstructorPath;
|
||||
const body = path.get("body");
|
||||
path.traverse(findThisesVisitor);
|
||||
let guaranteedSuperBeforeFinish = !!classState.bareSupers.size;
|
||||
|
||||
let thisRef = function () {
|
||||
const ref = path.scope.generateDeclaredUidIdentifier("this");
|
||||
@@ -324,6 +386,23 @@ function transformClass(path, file, builtinClasses, isLoose) {
|
||||
return ref;
|
||||
};
|
||||
|
||||
for (const bareSuper of classState.bareSupers) {
|
||||
wrapSuperCall(bareSuper, classState.superName, thisRef, body);
|
||||
|
||||
if (guaranteedSuperBeforeFinish) {
|
||||
bareSuper.find(function (parentPath) {
|
||||
if (parentPath === path) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (parentPath.isLoop() || parentPath.isConditional() || parentPath.isArrowFunctionExpression()) {
|
||||
guaranteedSuperBeforeFinish = false;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
for (const thisPath of classState.superThises) {
|
||||
const {
|
||||
node,
|
||||
@@ -340,41 +419,6 @@ function transformClass(path, file, builtinClasses, isLoose) {
|
||||
thisPath.replaceWith(_core().types.callExpression(classState.file.addHelper("assertThisInitialized"), [thisRef()]));
|
||||
}
|
||||
|
||||
const bareSupers = new Set();
|
||||
path.traverse(_core().traverse.visitors.merge([_helperReplaceSupers().environmentVisitor, {
|
||||
Super(path) {
|
||||
const {
|
||||
node,
|
||||
parentPath
|
||||
} = path;
|
||||
|
||||
if (parentPath.isCallExpression({
|
||||
callee: node
|
||||
})) {
|
||||
bareSupers.add(parentPath);
|
||||
}
|
||||
}
|
||||
|
||||
}]));
|
||||
let guaranteedSuperBeforeFinish = !!bareSupers.size;
|
||||
|
||||
for (const bareSuper of bareSupers) {
|
||||
wrapSuperCall(bareSuper, classState.superName, thisRef, body);
|
||||
|
||||
if (guaranteedSuperBeforeFinish) {
|
||||
bareSuper.find(function (parentPath) {
|
||||
if (parentPath === path) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (parentPath.isLoop() || parentPath.isConditional() || parentPath.isArrowFunctionExpression()) {
|
||||
guaranteedSuperBeforeFinish = false;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
let wrapReturn;
|
||||
|
||||
if (classState.isLoose) {
|
||||
@@ -423,7 +467,7 @@ function transformClass(path, file, builtinClasses, isLoose) {
|
||||
|
||||
let func = _core().types.functionExpression(null, node.params, node.body, node.generator, node.async);
|
||||
|
||||
_core().types.inherits(func, node);
|
||||
func.returnType = node.returnType;
|
||||
|
||||
const key = _core().types.toComputedKey(node, node.key);
|
||||
|
||||
@@ -460,7 +504,7 @@ function transformClass(path, file, builtinClasses, isLoose) {
|
||||
}
|
||||
}
|
||||
|
||||
function pushConstructor(superReturns, method, path) {
|
||||
function pushConstructor(replaceSupers, method, path) {
|
||||
if (path.scope.hasOwnBinding(classState.classRef.name)) {
|
||||
path.scope.rename(classState.classRef.name);
|
||||
}
|
||||
@@ -469,7 +513,8 @@ function transformClass(path, file, builtinClasses, isLoose) {
|
||||
userConstructorPath: path,
|
||||
userConstructor: method,
|
||||
hasConstructor: true,
|
||||
superReturns
|
||||
bareSupers: replaceSupers.bareSupers,
|
||||
superReturns: replaceSupers.returns
|
||||
});
|
||||
const {
|
||||
construct
|
||||
|
||||
+6
-7
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-classes",
|
||||
"version": "7.4.4",
|
||||
"version": "7.1.0",
|
||||
"description": "Compile ES2015 classes to ES5",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-classes",
|
||||
"license": "MIT",
|
||||
@@ -10,12 +10,12 @@
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-annotate-as-pure": "^7.0.0",
|
||||
"@babel/helper-define-map": "^7.4.4",
|
||||
"@babel/helper-define-map": "^7.1.0",
|
||||
"@babel/helper-function-name": "^7.1.0",
|
||||
"@babel/helper-optimise-call-expression": "^7.0.0",
|
||||
"@babel/helper-plugin-utils": "^7.0.0",
|
||||
"@babel/helper-replace-supers": "^7.4.4",
|
||||
"@babel/helper-split-export-declaration": "^7.4.4",
|
||||
"@babel/helper-replace-supers": "^7.1.0",
|
||||
"@babel/helper-split-export-declaration": "^7.0.0",
|
||||
"globals": "^11.1.0"
|
||||
},
|
||||
"keywords": [
|
||||
@@ -25,8 +25,7 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.4.4",
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
},
|
||||
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba"
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -40,7 +40,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
||||
var _default = (0, _helperPluginUtils().declare)(api => {
|
||||
api.assertVersion(7);
|
||||
return {
|
||||
name: "transform-exponentiation-operator",
|
||||
visitor: (0, _helperBuilderBinaryAssignmentOperatorVisitor().default)({
|
||||
operator: "**",
|
||||
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-exponentiation-operator",
|
||||
"version": "7.2.0",
|
||||
"version": "7.1.0",
|
||||
"description": "Compile exponentiation operator to ES5",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator",
|
||||
"license": "MIT",
|
||||
@@ -19,7 +19,7 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.2.0",
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
-1
@@ -30,7 +30,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
||||
var _default = (0, _helperPluginUtils().declare)(api => {
|
||||
api.assertVersion(7);
|
||||
return {
|
||||
name: "transform-function-name",
|
||||
visitor: {
|
||||
FunctionExpression: {
|
||||
exit(path) {
|
||||
|
||||
+3
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-function-name",
|
||||
"version": "7.4.4",
|
||||
"version": "7.1.0",
|
||||
"description": "Apply ES2015 function.name semantics to all functions",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-function-name",
|
||||
"license": "MIT",
|
||||
@@ -19,8 +19,7 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.4.4",
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
},
|
||||
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba"
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -50,7 +50,6 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
noInterop
|
||||
} = options;
|
||||
return {
|
||||
name: "transform-modules-amd",
|
||||
visitor: {
|
||||
Program: {
|
||||
exit(path) {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-modules-amd",
|
||||
"version": "7.2.0",
|
||||
"version": "7.1.0",
|
||||
"description": "This plugin transforms ES2015 modules to AMD",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-amd",
|
||||
"license": "MIT",
|
||||
@@ -19,7 +19,7 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.2.0",
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -123,7 +123,6 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
}
|
||||
|
||||
return {
|
||||
name: "transform-modules-umd",
|
||||
visitor: {
|
||||
Program: {
|
||||
exit(path) {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-modules-umd",
|
||||
"version": "7.2.0",
|
||||
"version": "7.1.0",
|
||||
"description": "This plugin transforms ES2015 modules to UMD",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-umd",
|
||||
"license": "MIT",
|
||||
@@ -19,7 +19,7 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.2.0",
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -49,7 +49,6 @@ function replacePropertySuper(path, getObjectRef, file) {
|
||||
var _default = (0, _helperPluginUtils().declare)(api => {
|
||||
api.assertVersion(7);
|
||||
return {
|
||||
name: "transform-object-super",
|
||||
visitor: {
|
||||
ObjectExpression(path, state) {
|
||||
let objectRef;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-object-super",
|
||||
"version": "7.2.0",
|
||||
"version": "7.1.0",
|
||||
"description": "Compile ES2015 object super to ES5",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-super",
|
||||
"license": "MIT",
|
||||
@@ -19,7 +19,7 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.2.0",
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
-1
@@ -27,7 +27,6 @@ var _default = (0, _helperPluginUtils().declare)((api, options) => {
|
||||
loose
|
||||
} = options;
|
||||
return {
|
||||
name: "transform-parameters",
|
||||
visitor: {
|
||||
Function(path) {
|
||||
if (path.isArrowFunctionExpression() && path.get("params").some(param => param.isRestElement() || param.isAssignmentPattern())) {
|
||||
|
||||
+4
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-parameters",
|
||||
"version": "7.4.4",
|
||||
"version": "7.1.0",
|
||||
"description": "Compile ES2015 default and rest parameters to ES5",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-parameters",
|
||||
"license": "MIT",
|
||||
@@ -9,7 +9,7 @@
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-call-delegate": "^7.4.4",
|
||||
"@babel/helper-call-delegate": "^7.1.0",
|
||||
"@babel/helper-get-function-arity": "^7.0.0",
|
||||
"@babel/helper-plugin-utils": "^7.0.0"
|
||||
},
|
||||
@@ -20,8 +20,7 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.4.4",
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
},
|
||||
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
+94
-138
@@ -4,144 +4,100 @@ Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _semver() {
|
||||
const data = _interopRequireDefault(require("semver"));
|
||||
|
||||
_semver = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function hasMinVersion(minVersion, runtimeVersion) {
|
||||
if (!runtimeVersion) return true;
|
||||
if (_semver().default.valid(runtimeVersion)) runtimeVersion = `^${runtimeVersion}`;
|
||||
return !_semver().default.intersects(`<${minVersion}`, runtimeVersion) && !_semver().default.intersects(`>=8.0.0`, runtimeVersion);
|
||||
}
|
||||
|
||||
var _default = runtimeVersion => {
|
||||
const includeMathModule = hasMinVersion("7.0.1", runtimeVersion);
|
||||
return {
|
||||
builtins: {
|
||||
Symbol: "symbol",
|
||||
Promise: "promise",
|
||||
Map: "map",
|
||||
WeakMap: "weak-map",
|
||||
Set: "set",
|
||||
WeakSet: "weak-set",
|
||||
setImmediate: "set-immediate",
|
||||
clearImmediate: "clear-immediate",
|
||||
parseFloat: "parse-float",
|
||||
parseInt: "parse-int"
|
||||
var _default = {
|
||||
builtins: {
|
||||
Symbol: "symbol",
|
||||
Promise: "promise",
|
||||
Map: "map",
|
||||
WeakMap: "weak-map",
|
||||
Set: "set",
|
||||
WeakSet: "weak-set",
|
||||
setImmediate: "set-immediate",
|
||||
clearImmediate: "clear-immediate",
|
||||
parseFloat: "parse-float",
|
||||
parseInt: "parse-int"
|
||||
},
|
||||
methods: {
|
||||
Array: {
|
||||
from: "array/from",
|
||||
isArray: "array/is-array",
|
||||
of: "array/of"
|
||||
},
|
||||
methods: Object.assign({
|
||||
Array: {
|
||||
from: "array/from",
|
||||
isArray: "array/is-array",
|
||||
of: "array/of"
|
||||
},
|
||||
JSON: {
|
||||
stringify: "json/stringify"
|
||||
},
|
||||
Object: {
|
||||
assign: "object/assign",
|
||||
create: "object/create",
|
||||
defineProperties: "object/define-properties",
|
||||
defineProperty: "object/define-property",
|
||||
entries: "object/entries",
|
||||
freeze: "object/freeze",
|
||||
getOwnPropertyDescriptor: "object/get-own-property-descriptor",
|
||||
getOwnPropertyDescriptors: "object/get-own-property-descriptors",
|
||||
getOwnPropertyNames: "object/get-own-property-names",
|
||||
getOwnPropertySymbols: "object/get-own-property-symbols",
|
||||
getPrototypeOf: "object/get-prototype-of",
|
||||
isExtensible: "object/is-extensible",
|
||||
isFrozen: "object/is-frozen",
|
||||
isSealed: "object/is-sealed",
|
||||
is: "object/is",
|
||||
keys: "object/keys",
|
||||
preventExtensions: "object/prevent-extensions",
|
||||
seal: "object/seal",
|
||||
setPrototypeOf: "object/set-prototype-of",
|
||||
values: "object/values"
|
||||
}
|
||||
}, includeMathModule ? {
|
||||
Math: {
|
||||
acosh: "math/acosh",
|
||||
asinh: "math/asinh",
|
||||
atanh: "math/atanh",
|
||||
cbrt: "math/cbrt",
|
||||
clz32: "math/clz32",
|
||||
cosh: "math/cosh",
|
||||
expm1: "math/expm1",
|
||||
fround: "math/fround",
|
||||
hypot: "math/hypot",
|
||||
imul: "math/imul",
|
||||
log10: "math/log10",
|
||||
log1p: "math/log1p",
|
||||
log2: "math/log2",
|
||||
sign: "math/sign",
|
||||
sinh: "math/sinh",
|
||||
tanh: "math/tanh",
|
||||
trunc: "math/trunc"
|
||||
}
|
||||
} : {}, {
|
||||
Symbol: {
|
||||
asyncIterator: "symbol/async-iterator",
|
||||
for: "symbol/for",
|
||||
hasInstance: "symbol/has-instance",
|
||||
isConcatSpreadable: "symbol/is-concat-spreadable",
|
||||
iterator: "symbol/iterator",
|
||||
keyFor: "symbol/key-for",
|
||||
match: "symbol/match",
|
||||
replace: "symbol/replace",
|
||||
search: "symbol/search",
|
||||
species: "symbol/species",
|
||||
split: "symbol/split",
|
||||
toPrimitive: "symbol/to-primitive",
|
||||
toStringTag: "symbol/to-string-tag",
|
||||
unscopables: "symbol/unscopables"
|
||||
},
|
||||
String: {
|
||||
at: "string/at",
|
||||
fromCodePoint: "string/from-code-point",
|
||||
raw: "string/raw"
|
||||
},
|
||||
Number: {
|
||||
EPSILON: "number/epsilon",
|
||||
isFinite: "number/is-finite",
|
||||
isInteger: "number/is-integer",
|
||||
isNaN: "number/is-nan",
|
||||
isSafeInteger: "number/is-safe-integer",
|
||||
MAX_SAFE_INTEGER: "number/max-safe-integer",
|
||||
MIN_SAFE_INTEGER: "number/min-safe-integer",
|
||||
parseFloat: "number/parse-float",
|
||||
parseInt: "number/parse-int"
|
||||
},
|
||||
Reflect: {
|
||||
apply: "reflect/apply",
|
||||
construct: "reflect/construct",
|
||||
defineProperty: "reflect/define-property",
|
||||
deleteProperty: "reflect/delete-property",
|
||||
getOwnPropertyDescriptor: "reflect/get-own-property-descriptor",
|
||||
getPrototypeOf: "reflect/get-prototype-of",
|
||||
get: "reflect/get",
|
||||
has: "reflect/has",
|
||||
isExtensible: "reflect/is-extensible",
|
||||
ownKeys: "reflect/own-keys",
|
||||
preventExtensions: "reflect/prevent-extensions",
|
||||
setPrototypeOf: "reflect/set-prototype-of",
|
||||
set: "reflect/set"
|
||||
},
|
||||
Date: {
|
||||
now: "date/now"
|
||||
}
|
||||
})
|
||||
};
|
||||
JSON: {
|
||||
stringify: "json/stringify"
|
||||
},
|
||||
Object: {
|
||||
assign: "object/assign",
|
||||
create: "object/create",
|
||||
defineProperties: "object/define-properties",
|
||||
defineProperty: "object/define-property",
|
||||
entries: "object/entries",
|
||||
freeze: "object/freeze",
|
||||
getOwnPropertyDescriptor: "object/get-own-property-descriptor",
|
||||
getOwnPropertyDescriptors: "object/get-own-property-descriptors",
|
||||
getOwnPropertyNames: "object/get-own-property-names",
|
||||
getOwnPropertySymbols: "object/get-own-property-symbols",
|
||||
getPrototypeOf: "object/get-prototype-of",
|
||||
isExtensible: "object/is-extensible",
|
||||
isFrozen: "object/is-frozen",
|
||||
isSealed: "object/is-sealed",
|
||||
is: "object/is",
|
||||
keys: "object/keys",
|
||||
preventExtensions: "object/prevent-extensions",
|
||||
seal: "object/seal",
|
||||
setPrototypeOf: "object/set-prototype-of",
|
||||
values: "object/values"
|
||||
},
|
||||
Symbol: {
|
||||
asyncIterator: "symbol/async-iterator",
|
||||
for: "symbol/for",
|
||||
hasInstance: "symbol/has-instance",
|
||||
isConcatSpreadable: "symbol/is-concat-spreadable",
|
||||
iterator: "symbol/iterator",
|
||||
keyFor: "symbol/key-for",
|
||||
match: "symbol/match",
|
||||
replace: "symbol/replace",
|
||||
search: "symbol/search",
|
||||
species: "symbol/species",
|
||||
split: "symbol/split",
|
||||
toPrimitive: "symbol/to-primitive",
|
||||
toStringTag: "symbol/to-string-tag",
|
||||
unscopables: "symbol/unscopables"
|
||||
},
|
||||
String: {
|
||||
at: "string/at",
|
||||
fromCodePoint: "string/from-code-point",
|
||||
raw: "string/raw"
|
||||
},
|
||||
Number: {
|
||||
EPSILON: "number/epsilon",
|
||||
isFinite: "number/is-finite",
|
||||
isInteger: "number/is-integer",
|
||||
isNaN: "number/is-nan",
|
||||
isSafeInteger: "number/is-safe-integer",
|
||||
MAX_SAFE_INTEGER: "number/max-safe-integer",
|
||||
MIN_SAFE_INTEGER: "number/min-safe-integer",
|
||||
parseFloat: "number/parse-float",
|
||||
parseInt: "number/parse-int"
|
||||
},
|
||||
Reflect: {
|
||||
apply: "reflect/apply",
|
||||
construct: "reflect/construct",
|
||||
defineProperty: "reflect/define-property",
|
||||
deleteProperty: "reflect/delete-property",
|
||||
getOwnPropertyDescriptor: "reflect/get-own-property-descriptor",
|
||||
getPrototypeOf: "reflect/get-prototype-of",
|
||||
get: "reflect/get",
|
||||
has: "reflect/has",
|
||||
isExtensible: "reflect/is-extensible",
|
||||
ownKeys: "reflect/own-keys",
|
||||
preventExtensions: "reflect/prevent-extensions",
|
||||
setPrototypeOf: "reflect/set-prototype-of",
|
||||
set: "reflect/set"
|
||||
},
|
||||
Date: {
|
||||
now: "date/now"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
exports.default = _default;
|
||||
+7
-12
@@ -88,7 +88,6 @@ var _default = (0, _helperPluginUtils().declare)((api, options, dirname) => {
|
||||
version: runtimeVersion = "7.0.0-beta.0",
|
||||
absoluteRuntime = false
|
||||
} = options;
|
||||
const definitions = (0, _definitions.default)(runtimeVersion);
|
||||
|
||||
if (typeof useRuntimeRegenerator !== "boolean") {
|
||||
throw new Error("The 'regenerator' option must be undefined, or a boolean.");
|
||||
@@ -107,11 +106,7 @@ var _default = (0, _helperPluginUtils().declare)((api, options, dirname) => {
|
||||
}
|
||||
|
||||
if (corejsVersion !== false && (typeof corejsVersion !== "number" || corejsVersion !== 2) && (typeof corejsVersion !== "string" || corejsVersion !== "2")) {
|
||||
throw new Error(`The 'corejs' option must be undefined, false, 2 or '2', ` + `but got ${JSON.stringify(corejsVersion)}.`);
|
||||
}
|
||||
|
||||
if (typeof runtimeVersion !== "string") {
|
||||
throw new Error(`The 'version' option must be a version string.`);
|
||||
throw new Error(`The 'corejs' option must be undefined, false, or 2, or '2', ` + `but got ${JSON.stringify(corejsVersion)}.`);
|
||||
}
|
||||
|
||||
function has(obj, key) {
|
||||
@@ -200,9 +195,9 @@ var _default = (0, _helperPluginUtils().declare)((api, options, dirname) => {
|
||||
|
||||
if (!injectCoreJS2) return;
|
||||
if (_core().types.isMemberExpression(parent)) return;
|
||||
if (!has(definitions.builtins, node.name)) return;
|
||||
if (!has(_definitions.default.builtins, node.name)) return;
|
||||
if (scope.getBindingIdentifier(node.name)) return;
|
||||
path.replaceWith(this.addDefaultImport(`${modulePath}/core-js/${definitions.builtins[node.name]}`, node.name));
|
||||
path.replaceWith(this.addDefaultImport(`${modulePath}/core-js/${_definitions.default.builtins[node.name]}`, node.name));
|
||||
},
|
||||
|
||||
CallExpression(path) {
|
||||
@@ -237,8 +232,8 @@ var _default = (0, _helperPluginUtils().declare)((api, options, dirname) => {
|
||||
const prop = node.property;
|
||||
if (!_core().types.isReferenced(obj, node)) return;
|
||||
if (node.computed) return;
|
||||
if (!has(definitions.methods, obj.name)) return;
|
||||
const methods = definitions.methods[obj.name];
|
||||
if (!has(_definitions.default.methods, obj.name)) return;
|
||||
const methods = _definitions.default.methods[obj.name];
|
||||
if (!has(methods, prop.name)) return;
|
||||
if (path.scope.getBindingIdentifier(obj.name)) return;
|
||||
|
||||
@@ -260,9 +255,9 @@ var _default = (0, _helperPluginUtils().declare)((api, options, dirname) => {
|
||||
node
|
||||
} = path;
|
||||
const obj = node.object;
|
||||
if (!has(definitions.builtins, obj.name)) return;
|
||||
if (!has(_definitions.default.builtins, obj.name)) return;
|
||||
if (path.scope.getBindingIdentifier(obj.name)) return;
|
||||
path.replaceWith(_core().types.memberExpression(this.addDefaultImport(`${modulePath}/core-js/${definitions.builtins[obj.name]}`, obj.name), node.property, node.computed));
|
||||
path.replaceWith(_core().types.memberExpression(this.addDefaultImport(`${modulePath}/core-js/${_definitions.default.builtins[obj.name]}`, obj.name), node.property, node.computed));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-6
@@ -1,12 +1,9 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-runtime",
|
||||
"version": "7.1.0",
|
||||
"version": "7.0.0",
|
||||
"description": "Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-runtime",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
@@ -14,8 +11,7 @@
|
||||
"dependencies": {
|
||||
"@babel/helper-module-imports": "^7.0.0",
|
||||
"@babel/helper-plugin-utils": "^7.0.0",
|
||||
"resolve": "^1.8.1",
|
||||
"semver": "^5.5.1"
|
||||
"resolve": "^1.8.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
+1
-1
@@ -277,7 +277,7 @@ const es = {
|
||||
"es6.string.from-code-point": "String static methods / String.fromCodePoint",
|
||||
"es6.string.includes": "String.prototype methods / String.prototype.includes",
|
||||
"es6.string.italics": "String.prototype HTML methods",
|
||||
"es6.string.iterator": "String.prototype methods / String.prototype[Symbol.iterator]",
|
||||
"es6.string.iterator": "String properties and methods / Property access on strings",
|
||||
"es6.string.link": "String.prototype HTML methods",
|
||||
// "String.prototype methods / String.prototype.normalize" not implemented
|
||||
"es7.string.pad-start": "String padding / String.prototype.padStart",
|
||||
|
||||
+9
-7
@@ -1183,14 +1183,16 @@
|
||||
"electron": "1.1"
|
||||
},
|
||||
"es6.string.iterator": {
|
||||
"chrome": "38",
|
||||
"chrome": "5",
|
||||
"opera": "10.10",
|
||||
"edge": "12",
|
||||
"firefox": "36",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
"firefox": "2",
|
||||
"safari": "3.1",
|
||||
"node": "0.10",
|
||||
"ie": "8",
|
||||
"android": "4.0",
|
||||
"ios": "6",
|
||||
"electron": "1.1"
|
||||
},
|
||||
"es6.string.link": {
|
||||
"chrome": "5",
|
||||
|
||||
+11
-14
@@ -1,13 +1,10 @@
|
||||
{
|
||||
"name": "@babel/preset-env",
|
||||
"version": "7.1.0",
|
||||
"version": "7.0.0",
|
||||
"description": "A Babel preset for each environment.",
|
||||
"author": "Henry Zhu <hi@henryzoo.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-env",
|
||||
"main": "lib/index.js",
|
||||
"scripts": {
|
||||
@@ -16,7 +13,7 @@
|
||||
"dependencies": {
|
||||
"@babel/helper-module-imports": "^7.0.0",
|
||||
"@babel/helper-plugin-utils": "^7.0.0",
|
||||
"@babel/plugin-proposal-async-generator-functions": "^7.1.0",
|
||||
"@babel/plugin-proposal-async-generator-functions": "^7.0.0",
|
||||
"@babel/plugin-proposal-json-strings": "^7.0.0",
|
||||
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
|
||||
"@babel/plugin-proposal-optional-catch-binding": "^7.0.0",
|
||||
@@ -25,25 +22,25 @@
|
||||
"@babel/plugin-syntax-object-rest-spread": "^7.0.0",
|
||||
"@babel/plugin-syntax-optional-catch-binding": "^7.0.0",
|
||||
"@babel/plugin-transform-arrow-functions": "^7.0.0",
|
||||
"@babel/plugin-transform-async-to-generator": "^7.1.0",
|
||||
"@babel/plugin-transform-async-to-generator": "^7.0.0",
|
||||
"@babel/plugin-transform-block-scoped-functions": "^7.0.0",
|
||||
"@babel/plugin-transform-block-scoping": "^7.0.0",
|
||||
"@babel/plugin-transform-classes": "^7.1.0",
|
||||
"@babel/plugin-transform-classes": "^7.0.0",
|
||||
"@babel/plugin-transform-computed-properties": "^7.0.0",
|
||||
"@babel/plugin-transform-destructuring": "^7.0.0",
|
||||
"@babel/plugin-transform-dotall-regex": "^7.0.0",
|
||||
"@babel/plugin-transform-duplicate-keys": "^7.0.0",
|
||||
"@babel/plugin-transform-exponentiation-operator": "^7.1.0",
|
||||
"@babel/plugin-transform-exponentiation-operator": "^7.0.0",
|
||||
"@babel/plugin-transform-for-of": "^7.0.0",
|
||||
"@babel/plugin-transform-function-name": "^7.1.0",
|
||||
"@babel/plugin-transform-function-name": "^7.0.0",
|
||||
"@babel/plugin-transform-literals": "^7.0.0",
|
||||
"@babel/plugin-transform-modules-amd": "^7.1.0",
|
||||
"@babel/plugin-transform-modules-commonjs": "^7.1.0",
|
||||
"@babel/plugin-transform-modules-amd": "^7.0.0",
|
||||
"@babel/plugin-transform-modules-commonjs": "^7.0.0",
|
||||
"@babel/plugin-transform-modules-systemjs": "^7.0.0",
|
||||
"@babel/plugin-transform-modules-umd": "^7.1.0",
|
||||
"@babel/plugin-transform-modules-umd": "^7.0.0",
|
||||
"@babel/plugin-transform-new-target": "^7.0.0",
|
||||
"@babel/plugin-transform-object-super": "^7.1.0",
|
||||
"@babel/plugin-transform-parameters": "^7.1.0",
|
||||
"@babel/plugin-transform-object-super": "^7.0.0",
|
||||
"@babel/plugin-transform-parameters": "^7.0.0",
|
||||
"@babel/plugin-transform-regenerator": "^7.0.0",
|
||||
"@babel/plugin-transform-shorthand-properties": "^7.0.0",
|
||||
"@babel/plugin-transform-spread": "^7.0.0",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
+1
-4
@@ -1,11 +1,8 @@
|
||||
{
|
||||
"name": "@babel/runtime-corejs2",
|
||||
"version": "7.1.2",
|
||||
"version": "7.0.0",
|
||||
"description": "babel's modular runtime helpers with core-js@2 polyfilling",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-runtime-corejs2",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"dependencies": {
|
||||
|
||||
+2
-2
@@ -6,10 +6,10 @@ case `uname` in
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../@babel/parser/bin/babel-parser.js" "$@"
|
||||
"$basedir/node" "$basedir/../../../parser/bin/babel-parser.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../@babel/parser/bin/babel-parser.js" "$@"
|
||||
node "$basedir/../../../parser/bin/babel-parser.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\@babel\parser\bin\babel-parser.js" %*
|
||||
"%~dp0\node.exe" "%~dp0\..\..\..\parser\bin\babel-parser.js" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\@babel\parser\bin\babel-parser.js" %*
|
||||
node "%~dp0\..\..\..\parser\bin\babel-parser.js" %*
|
||||
)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user