Skip to content

Commit

Permalink
Make client/ directory (Calypso app) a Lerna package
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnajdr committed Dec 5, 2019
1 parent d6688b0 commit 3f442d9
Show file tree
Hide file tree
Showing 65 changed files with 5,659 additions and 16,640 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { merge } = require( 'lodash' );
const reactVersion = require( './package.json' ).dependencies.react;
const reactVersion = require( './client/package.json' ).dependencies.react;

module.exports = {
root: true,
Expand Down
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ lerna-debug.log

/public/

/server/devdocs/search-index.js
/server/devdocs/components-usage-stats.json
/server/devdocs/proptypes-index.json
/server/bundler/assets*.json
/client/server/devdocs/search-index.js
/client/server/devdocs/components-usage-stats.json
/client/server/devdocs/proptypes-index.json
/client/server/bundler/assets*.json

*.rdb
*.db
Expand Down
11,024 changes: 0 additions & 11,024 deletions apps/wpcom-block-editor/package-lock.json

This file was deleted.

12 changes: 9 additions & 3 deletions bin/install-if-deps-outdated.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,20 @@ const needsInstall = () => {
}

if ( ! lockfileTime ) {
//debug( '%s: true (no lockfile!)', packageDir );
console.log( 'Going to npm ci: there is no lockfile' );
return true;
}

const nodeModulesTime = fs.statSync( path.join( packageDir, 'node_modules' ) ).mtime;
return lockfileTime - nodeModulesTime > 1000; // In Windows, directory mtime has less precision than file mtime
const nodeModulesTooOld = lockfileTime - nodeModulesTime > 1000; // In Windows, directory mtime has less precision than file mtime
if ( nodeModulesTooOld ) {
console.log( 'Going to npm ci: node_modules too old', nodeModulesTime, lockfileTime );
return true;
}
console.log( 'No need to npm ci: node_modules is fresh', nodeModulesTime, lockfileTime );
return false;
} catch ( e ) {
//debug( e );
console.log( 'Failed to check node_modules freshness', e );
return true;
}
};
Expand Down
2 changes: 1 addition & 1 deletion bin/pre-commit-hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ console.log(
);

// Make quick pass over config files on every change
require( '../server/config/validate-config-keys' );
require( './validate-config-keys' );

/**
* Parses the output of a git diff command into file paths.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const fs = require( 'fs' );
const path = require( 'path' );

/** @type {String} path to configuration file directory */
const configRoot = path.resolve( __dirname, '../../', 'config' );
const configRoot = path.resolve( __dirname, '../config' );

/**
* Reads a config file given its basename
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion client/document/desktop.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import EnvironmentBadge, { Branch, DevDocsLink, TestHelper } from 'components/en
import Head from 'components/head';
import { chunkCssLinks } from './utils';
import WordPressLogo from 'components/wordpress-logo';
import { jsonStringifyForHtml } from '../../server/sanitize';
import { jsonStringifyForHtml } from 'server/sanitize';

class Desktop extends React.Component {
render() {
Expand Down
2 changes: 1 addition & 1 deletion client/document/domains-landing.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import classnames from 'classnames';
*/
import Head from 'components/head';
import { chunkCssLinks } from './utils';
import { jsonStringifyForHtml } from '../../server/sanitize';
import { jsonStringifyForHtml } from 'server/sanitize';

function DomainsLanding( {
branchName,
Expand Down
2 changes: 1 addition & 1 deletion client/document/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import EnvironmentBadge, {
} from 'components/environment-badge';
import { chunkCssLinks } from './utils';
import WordPressLogo from 'components/wordpress-logo';
import { jsonStringifyForHtml } from '../../server/sanitize';
import { jsonStringifyForHtml } from 'server/sanitize';

class Document extends React.Component {
render() {
Expand Down
214 changes: 214 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
{
"name": "wp-calypso",
"author": "Automattic Inc.",
"version": "0.17.0",
"description": "A pure REST-API and JS based version of the WordPress.com admin",
"private": true,
"license": "GPL-2.0-or-later",
"repository": {
"type": "git",
"url": "https://github.com/Automattic/wp-calypso.git"
},
"main": "server/index.js",
"browserslist": {
"defaults": [
"extends @wordpress/browserslist-config"
],
"evergreen": [
"last 2 Chrome versions",
"last 1 ChromeAndroid versions",
"last 2 Firefox versions",
"last 2 Safari versions",
"last 2 iOS versions",
"last 2 Edge versions",
"last 2 Opera versions",
"unreleased Chrome versions",
"unreleased ChromeAndroid versions",
"unreleased Firefox versions",
"unreleased FirefoxAndroid versions",
"unreleased Edge versions",
"unreleased Opera versions"
],
"server": [
"current node"
]
},
"dependencies": {
"@automattic/color-studio": "2.2.0",
"@automattic/components": "file:../packages/components",
"@automattic/composite-checkout": "file:../packages/composite-checkout",
"@automattic/composite-checkout-wpcom": "file:../packages/composite-checkout-wpcom",
"@automattic/format-currency": "file:../packages/format-currency",
"@automattic/load-script": "file:../packages/load-script",
"@automattic/material-design-icons": "file:../packages/material-design-icons",
"@automattic/muriel-style": "file:../packages/muriel-style",
"@automattic/tree-select": "file:../packages/tree-select",
"@babel/polyfill": "7.7.0",
"@babel/runtime": "7.7.2",
"@emotion/core": "10.0.22",
"@emotion/styled": "10.0.23",
"@github/webauthn-json": "0.3.6",
"@ungap/url-search-params": "0.1.2",
"@webcomponents/url": "0.7.4",
"@wordpress/api-fetch": "3.7.0",
"@wordpress/base-styles": "1.0.0",
"@wordpress/block-editor": "3.3.0",
"@wordpress/block-library": "2.10.0",
"@wordpress/blocks": "6.8.0",
"@wordpress/components": "8.4.0",
"@wordpress/compose": "3.8.0",
"@wordpress/core-data": "2.8.0",
"@wordpress/data": "4.10.0",
"@wordpress/data-controls": "1.4.0",
"@wordpress/dom": "2.6.0",
"@wordpress/edit-post": "3.9.0",
"@wordpress/editor": "9.8.0",
"@wordpress/element": "2.9.0",
"@wordpress/format-library": "1.10.0",
"@wordpress/i18n": "3.7.0",
"@wordpress/is-shallow-equal": "1.6.1",
"@wordpress/keycodes": "2.7.0",
"@wordpress/notices": "1.9.0",
"@wordpress/nux": "3.8.0",
"@wordpress/plugins": "2.8.0",
"@wordpress/redux-routine": "3.6.2",
"@wordpress/rich-text": "3.8.0",
"@wordpress/server-side-render": "1.4.0",
"@wordpress/shortcode": "2.5.0",
"@wordpress/url": "2.8.2",
"@wordpress/viewport": "2.9.0",
"acorn": "6.3.0",
"autosize": "4.0.2",
"babel-plugin-add-module-exports": "1.0.2",
"body-parser": "1.19.0",
"bounding-client-rect": "1.0.5",
"browser-filesaver": "1.1.1",
"browserslist-useragent": "3.0.2",
"caniuse-lite": "1.0.30001012",
"chalk": "3.0.0",
"chrono-node": "1.3.5",
"circular-dependency-plugin": "5.2.0",
"classnames": "2.2.6",
"clipboard": "2.0.4",
"component-closest": "1.0.1",
"component-file-picker": "0.2.1",
"cookie": "0.4.0",
"cookie-parser": "1.4.4",
"core-js": "2.6.10",
"cpf_cnpj": "0.2.0",
"create-react-class": "15.6.3",
"creditcards": "3.1.0",
"d3-array": "2.4.0",
"d3-axis": "1.0.12",
"d3-scale": "3.2.1",
"d3-selection": "1.4.0",
"d3-shape": "1.3.5",
"debug": "4.1.1",
"deep-freeze": "0.0.1",
"diff": "4.0.1",
"doctrine": "3.0.0",
"dom-helpers": "5.1.3",
"dompurify": "2.0.7",
"draft-js": "0.10.5",
"email-validator": "2.0.4",
"emoji-text": "0.2.6",
"emotion-theming": "10.0.19",
"escape-regexp": "0.0.1",
"escape-string-regexp": "2.0.0",
"events": "3.0.0",
"exports-loader": "0.7.0",
"express": "4.17.1",
"express-useragent": "1.0.13",
"fast-json-stable-stringify": "2.0.0",
"filesize": "6.0.1",
"flag-icon-css": "3.4.5",
"flux": "3.1.3",
"fontfaceobserver": "2.1.0",
"fuse.js": "3.4.6",
"get-video-id": "3.1.4",
"gfm-code-blocks": "1.0.0",
"globby": "10.0.1",
"gridicons": "3.3.1",
"gzip-size": "5.1.1",
"hash.js": "1.1.7",
"he": "1.2.0",
"html-loader": "0.5.5",
"html-to-react": "1.4.2",
"html-webpack-plugin": "3.2.0",
"i18n-calypso": "file:../packages/i18n-calypso",
"ignore-loader": "0.1.2",
"immutability-helper": "3.0.1",
"immutable": "3.8.2",
"imports-loader": "0.8.0",
"inherits": "2.0.4",
"is-my-json-valid": "2.20.0",
"isomorphic-fetch": "2.2.1",
"jquery": "1.12.3",
"keymaster": "1.6.2",
"loader-utils": "1.2.3",
"lodash": "4.17.15",
"lodash-es": "4.17.15",
"lru": "3.1.0",
"lunr": "2.3.8",
"marked": "0.7.0",
"mkdirp": "0.5.1",
"moment": "2.24.0",
"moment-timezone": "0.5.27",
"morgan": "1.9.1",
"objectpath": "1.2.2",
"page": "1.11.5",
"path-browserify": "1.0.0",
"percentage-regex": "3.0.0",
"phone": "2.4.2",
"photon": "file:../packages/photon",
"prismjs": "1.17.1",
"prop-types": "15.7.2",
"qrcode.react": "1.0.0",
"qs": "6.9.1",
"react": "16.11.0",
"react-click-outside": "3.0.1",
"react-day-picker": "7.4.0",
"react-dom": "16.11.0",
"react-element-to-jsx-string": "14.1.0",
"react-lazily-render": "1.2.0",
"react-live": "1.12.0",
"react-modal": "3.11.1",
"react-redux": "7.1.3",
"react-stripe-elements": "4.0.2",
"react-transition-group": "4.3.0",
"react-virtualized": "9.21.2",
"redux": "4.0.4",
"redux-form": "8.2.6",
"redux-thunk": "2.3.0",
"refx": "3.1.1",
"rememo": "3.0.0",
"resize-observer-polyfill": "1.5.1",
"rtlcss": "2.4.0",
"social-logos": "2.1.0",
"socket.io-client": "2.3.0",
"source-map": "0.7.3",
"source-map-support": "0.5.16",
"store": "2.0.12",
"striptags": "3.1.1",
"superagent": "3.8.3",
"svg4everybody": "2.1.9",
"textarea-caret": "3.1.0",
"tinymce": "4.9.6",
"to-title-case": "1.0.0",
"tracekit": "0.4.5",
"twemoji": "12.1.4",
"url": "0.11.0",
"use-debounce": "3.1.0",
"use-subscription": "1.2.0",
"utility-types": "3.10.0",
"uuid": "3.3.3",
"valid-url": "1.0.9",
"webpack-bundle-analyzer": "3.6.0",
"webpack-dev-middleware": "3.7.2",
"wpcom": "5.4.2",
"wpcom-proxy-request": "5.0.2",
"wpcom-xhr-request": "1.1.3",
"yamlparser": "0.0.2",
"yargs": "13.3.0"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
27 changes: 13 additions & 14 deletions server/boot/index.js → client/server/boot/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
* Module dependencies
*/

const path = require( 'path' ),
config = require( 'config' ),
chalk = require( 'chalk' ),
express = require( 'express' ),
cookieParser = require( 'cookie-parser' ),
userAgent = require( 'express-useragent' ),
morgan = require( 'morgan' ),
pages = require( 'pages' ),
pwa = require( 'pwa' ).default;

const analytics = require( '../lib/analytics' ).default;
const path = require( 'path' );
const chalk = require( 'chalk' );
const express = require( 'express' );
const cookieParser = require( 'cookie-parser' );
const userAgent = require( 'express-useragent' );
const morgan = require( 'morgan' );
const config = require( 'config' );
const pages = require( 'server/pages' );
const pwa = require( 'server/pwa' ).default;
const analytics = require( 'server/lib/analytics' ).default;

/**
* Returns the server HTTP request handler "app".
Expand All @@ -29,7 +28,7 @@ function setup() {
app.use( userAgent.express() );

if ( 'development' === process.env.NODE_ENV ) {
require( 'bundler' )( app );
require( 'server/bundler' )( app );

// setup logger
app.use( morgan( 'dev' ) );
Expand Down Expand Up @@ -98,7 +97,7 @@ function setup() {
}

if ( config.isEnabled( 'devdocs' ) ) {
app.use( require( 'devdocs' )() );
app.use( require( 'server/devdocs' )() );
}

if ( config.isEnabled( 'desktop' ) ) {
Expand All @@ -108,7 +107,7 @@ function setup() {
);
}

app.use( require( 'api' )() );
app.use( require( 'server/api' )() );

// attach the pages module
app.use( pages() );
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const config = require( 'config' );
const config = require( 'server/config' );
const { getOptions } = require( 'loader-utils' );

/*
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions server/config/index.js → client/server/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* Internal dependencies
*/

const configPath = require( 'path' ).resolve( __dirname, '..', '..', 'config' );
const configPath = require( 'path' ).resolve( __dirname, '..', '..', '..', 'config' );
const parser = require( './parser' );
const createConfig = require( '../../client/lib/create-config' );
const createConfig = require( 'lib/create-config' );

const { serverData, clientData } = parser( configPath, {
env: process.env.CALYPSO_ENV || process.env.NODE_ENV || 'development',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* as its input, and writes the index to server/devdocs/components-usage-stats.json
*/
var _ = require( 'lodash' ),
config = require( 'config' ),
config = require( 'server/config' ),
fs = require( 'fs' ),
fspath = require( 'path' ),
globby = require( 'globby' ),
Expand Down
Loading

0 comments on commit 3f442d9

Please sign in to comment.