Skip to content

Commit

Permalink
tsc just compile please
Browse files Browse the repository at this point in the history
  • Loading branch information
jchip committed Jul 30, 2020
1 parent c81c981 commit 46014c5
Show file tree
Hide file tree
Showing 74 changed files with 480 additions and 168 deletions.
3 changes: 3 additions & 0 deletions packages/xarc-app-dev/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,9 @@ sauce_connect*.txt
dist
tmp
.etmp
config
lib
typedef.js

###############################################################################
#########################_WALMART_STANDARD_GITIGNORE_##########################
Expand Down
50 changes: 43 additions & 7 deletions packages/xarc-app-dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@
},
"license": "Apache-2.0",
"scripts": {
"test": "clap test",
"coverage": "clap check",
"format": "prettier --write --print-width 100 *.{js,jsx} `find . -type d -d 1 -exec echo '{}/**/*.{js,jsx}' \\; | egrep -v '(/node_modules/|/dist/|/coverage/)'`"
"compile": "tsc",
"build": "xrun -s compile user/moveDist",
"test": "xrun xarc/test-only",
"coverage": "xrun xarc/test-cov",
"format": "prettier --write --print-width 100 *.{js,jsx} `find . -type d -d 1 -exec echo '{}/**/*.{js,jsx}' \\; | egrep -v '(/node_modules/|/dist/|/coverage/)'`",
"prepublishOnly": "xrun [[build, docs], xarc/check]",
"docs": "xrun xarc/docs"
},
"files": [
"config",
Expand Down Expand Up @@ -72,8 +76,10 @@
"nix-clap": "^1.3.12",
"nyc": "^15.1.0",
"optional-require": "^1.0.2",
"pkg-up": "^3.1.0",
"prompts": "^2.3.2",
"ps-get": "^1.1.0",
"read-pkg-up": "^7.0.1",
"regenerator-runtime": "^0.13.7",
"request": "^2.88.2",
"require-at": "^1.0.4",
Expand All @@ -93,12 +99,17 @@
"xsh": "^0.4.5"
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@types/chai": "^4.2.11",
"@types/mocha": "^7.0.2",
"@types/node": "^13.7.6",
"@types/sinon": "^9.0.0",
"@types/sinon-chai": "^3.2.4",
"@typescript-eslint/eslint-plugin": "^2.21.0",
"@typescript-eslint/parser": "^2.21.0",
"@xarc/app": "../xarc-app",
"@xarc/module-dev": "^2.1.0",
"@xarc/module-dev": "^2.2.3",
"@xarc/run": "^1.0.2",
"babel-eslint": "^10.1.0",
"chai": "^4.2.0",
"electrode-archetype-opt-postcss": "../electrode-archetype-opt-postcss",
Expand All @@ -113,8 +124,13 @@
"nyc": "^15.0.0",
"prettier": "^1.14.2",
"run-verify": "^1.2.1",
"shx": "^0.3.2",
"sinon": "^7.2.6",
"sinon-chai": "^3.3.0"
"sinon-chai": "^3.3.0",
"source-map-support": "^0.5.16",
"ts-node": "^8.6.2",
"typedoc": "^0.17.4",
"typescript": "^3.8.3"
},
"engines": {
"node": ">= 10",
Expand Down Expand Up @@ -145,22 +161,42 @@
"dist",
"docs",
"gulpfile.js",
"test"
"test",
"xrun*.js",
"xrun*.ts"
],
"check-coverage": false,
"statements": 0,
"branches": 0,
"functions": 0,
"lines": 0,
"cache": true,
"extends": []
"extends": [
"@istanbuljs/nyc-config-typescript"
]
},
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"access": "public"
},
"@xarc/module-dev": {
"srcDir": [
"src",
"test",
"scripts"
],
"features": [
"eslint",
"eslintTS",
"mocha",
"typedoc",
"typescript"
]
},
"mocha": {
"require": [
"ts-node/register",
"source-map-support/register",
"@xarc/module-dev/config/test/setup.js"
],
"recursive": true
Expand Down
2 changes: 2 additions & 0 deletions packages/xarc-app-dev/scripts/l10n/flatten-messages.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"use strict";

/* eslint-disable no-process-exit, no-console */

const _ = require("lodash");
const Promise = require("bluebird");
const fs = Promise.promisifyAll(require("fs-extra"));
Expand Down
4 changes: 2 additions & 2 deletions packages/xarc-app-dev/scripts/map-isomorphic-cdn.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

/* eslint-disable max-statements */
/* eslint-disable max-statements, no-process-exit */

const logger = require("../lib/logger");
const fs = require("fs");
Expand All @@ -13,7 +13,7 @@ function exit(code) {

function mapIsomorphicCdn(appDir) {
appDir = appDir || process.cwd();
const isoConfigFile = Path.join(appDir, isoConfig.prodConfigFile);
const isoConfigFile = Path.join(appDir, ".isomorphic-loader-config.json");
const cdnAssetsFile = Path.join(appDir, "config/assets.json");
const isoConfig = require(isoConfigFile);
const cdnAssets = require(cdnAssetsFile);
Expand Down
2 changes: 2 additions & 0 deletions packages/xarc-app-dev/scripts/merge-isomorphic-assets.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"use strict";

/* eslint-disable no-process-exit */

const Fs = require("fs");
const filterScanDir = require("filter-scan-dir");
const Path = require("path");
Expand Down
12 changes: 5 additions & 7 deletions packages/xarc-app-dev/src/config/archetype.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
"use strict";

const Path = require("path");
const { merge } = require("lodash");
const { getXarcOptions } = require("../lib/utils");
const { getXarcOptions, getMyPkg } = require("../lib/utils");
const constants = require("./constants");

const devPkg = require("../package.json");
const devDir = Path.join(__dirname, "..");
const devRequire = require(`../require`);
const configDir = Path.join(devDir, "config");
const _ = require("lodash");
const xenvConfig = require("xenv-config");
const makeAppMode = require("@xarc/app/lib/app-mode");
Expand All @@ -31,6 +25,10 @@ module.exports = function getDevArchetype(createXarcOptions) {
const babel = require("./env-babel")();
const karma = require("./env-karma")();

const { myPkg: devPkg, myDir: devDir } = getMyPkg();
const configDir = Path.join(devDir, "config");
const devRequire = require(Path.join(devDir, "require"));

const config = {
...defaultArchetypeConfig,
devDir,
Expand Down
4 changes: 3 additions & 1 deletion packages/xarc-app-dev/src/config/babel/babelrc-client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use strict";
/* eslint-disable @typescript-eslint/no-var-requires, no-console, @typescript-eslint/ban-ts-ignore */
export {};

const ck = require("chalker");
const requireAt = require("require-at");
Expand Down Expand Up @@ -90,6 +91,7 @@ const enableKarmaCov = process.env.ENABLE_KARMA_COV === "true";
const isProduction = (BABEL_ENV || NODE_ENV) === "production";
const isTest = (BABEL_ENV || NODE_ENV) === "test";

// @ts-ignore
const plugins = basePlugins.concat(
// test env
isTest && ["babel-plugin-dynamic-import-node"],
Expand Down
3 changes: 2 additions & 1 deletion packages/xarc-app-dev/src/config/babel/babelrc-server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use strict";
/* eslint-disable @typescript-eslint/no-var-requires */
export {};

const archetype = require("@xarc/app-dev/config/archetype")();
const optionalRequire = require("optional-require")(require);
Expand Down
4 changes: 3 additions & 1 deletion packages/xarc-app-dev/src/config/babel/babelrc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use strict";
/* eslint-disable @typescript-eslint/no-var-requires, no-console, @typescript-eslint/ban-ts-ignore */
export {};

/*
* A single babel RC for all transpiling, including client and server code.
Expand Down Expand Up @@ -98,6 +99,7 @@ const basePlugins = [
]
];

// @ts-ignore
const plugins = basePlugins.concat(
// test env
isTest && ["babel-plugin-dynamic-import-node"],
Expand Down
3 changes: 2 additions & 1 deletion packages/xarc-app-dev/src/config/dev-proxy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use strict";
/* eslint-disable @typescript-eslint/no-var-requires */
export {};

const getDevProxy = require("./get-dev-proxy");

Expand Down
5 changes: 4 additions & 1 deletion packages/xarc-app-dev/src/config/env-app.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"use strict";
/* eslint-disable @typescript-eslint/no-var-requires */
export {};

let cachedEnvApp = null;

module.exports = function getAppEnv() {
const xenvConfig = require("xenv-config");
const { merge } = require("lodash");
Expand Down
13 changes: 8 additions & 5 deletions packages/xarc-app-dev/src/config/env-babel.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
"use strict";
let cachedEnvBabel = null
module.exports = function getEnvBabel () {
/* eslint-disable @typescript-eslint/no-var-requires */
export {};

let cachedEnvBabel = null;

module.exports = function getEnvBabel() {
const xenvConfig = require("xenv-config");
const { merge } = require("lodash");

Expand Down Expand Up @@ -40,5 +43,5 @@ module.exports = function getEnvBabel () {
}
};
cachedEnvBabel = cachedEnvBabel || xenvConfig(babelConfigSpec, userConfig.babel, { merge });
return cachedEnvBabel
}
return cachedEnvBabel;
};
11 changes: 7 additions & 4 deletions packages/xarc-app-dev/src/config/env-karma.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"use strict";
let cachedEnvKarma = null
/* eslint-disable @typescript-eslint/no-var-requires */
export {};

let cachedEnvKarma = null;

module.exports = function getEnvKarma() {
const xenvConfig = require("xenv-config");
const { merge } = require("lodash");
Expand All @@ -9,5 +12,5 @@ module.exports = function getEnvKarma() {
browser: { env: "KARMA_BROWSER", default: "chrome" }
};
cachedEnvKarma = cachedEnvKarma || xenvConfig(karmaConfigSpec, userConfig.karma, { merge });
return cachedEnvKarma
}
return cachedEnvKarma;
};
13 changes: 8 additions & 5 deletions packages/xarc-app-dev/src/config/env-proxy.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
"use strict";
/* eslint-disable @typescript-eslint/no-var-requires */
export {};

const { merge } = require("lodash");

let cachedEnvProxy = null
module.exports = function getEnvProxy () {
let cachedEnvProxy = null;

module.exports = function getEnvProxy() {
const xenvConfig = require("xenv-config");

const proxyConfigSpec = {
Expand All @@ -19,5 +22,5 @@ module.exports = function getEnvProxy () {
elevated: { env: ["ELECTRODE_DEV_ELEVATED"], default: false }
};
cachedEnvProxy = cachedEnvProxy || xenvConfig(proxyConfigSpec, {}, { merge });
return cachedEnvProxy
}
return cachedEnvProxy;
};
15 changes: 9 additions & 6 deletions packages/xarc-app-dev/src/config/env-webpack.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"use strict";
/* eslint-disable @typescript-eslint/no-var-requires */
export {};

let cachedWebpackConfig = null
module.exports = function getEnvWebpack () {
let cachedWebpackConfig = null;

module.exports = function getEnvWebpack() {
const xenvConfig = require("xenv-config");
const userConfig = require("./user-config")();
const { merge } = require("lodash");
Expand Down Expand Up @@ -48,6 +50,7 @@ module.exports = function getEnvWebpack () {
loadDlls: { env: "ELECTRODE_LOAD_DLLS", type: "json", default: {} },
minify: { env: "WEBPACK_MINIFY", default: true }
};
cachedWebpackConfig = cachedWebpackConfig || xenvConfig(webpackConfigSpec, userConfig.webpack, { merge });
return cachedWebpackConfig
}
cachedWebpackConfig =
cachedWebpackConfig || xenvConfig(webpackConfigSpec, userConfig.webpack, { merge });
return cachedWebpackConfig;
};
3 changes: 2 additions & 1 deletion packages/xarc-app-dev/src/config/get-dev-proxy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use strict";
/* eslint-disable @typescript-eslint/no-var-requires, max-statements, no-console, prefer-const */
export {};

const Path = require("path");
const Fs = require("fs");
Expand Down
3 changes: 3 additions & 0 deletions packages/xarc-app-dev/src/config/jest/__mocks__/file-mock.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* eslint-disable @typescript-eslint/no-var-requires */
export {};

// __mocks__/fileMock.js

module.exports = "test-file-stub";
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"use strict";
/* eslint-disable @typescript-eslint/no-var-requires */
export {};

const optionalRequire = require("optional-require")(require);

const Enzyme = optionalRequire("enzyme");
Expand Down
3 changes: 2 additions & 1 deletion packages/xarc-app-dev/src/config/jest/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use strict";
/* eslint-disable @typescript-eslint/no-var-requires */
export {};

const Path = require("path");
const _ = require("lodash");
Expand Down
3 changes: 2 additions & 1 deletion packages/xarc-app-dev/src/config/karma/browser-settings.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use strict";
/* eslint-disable @typescript-eslint/no-var-requires, no-process-exit */
export {};

module.exports = function(settings) {
const archetype = require("@xarc/app/config/archetype")();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use strict";
/* eslint-disable @typescript-eslint/no-var-requires */
export {};

process.env.KARMA_RUN_TYPE = "coverage";

Expand Down
4 changes: 3 additions & 1 deletion packages/xarc-app-dev/src/config/karma/karma.conf.dev.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"use strict";
/* eslint-disable @typescript-eslint/no-var-requires */
export {};

/*
* Karma Configuration: "dev" version.
*
Expand Down
3 changes: 2 additions & 1 deletion packages/xarc-app-dev/src/config/karma/karma.conf.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use strict";
/* eslint-disable @typescript-eslint/no-var-requires, no-console */
export {};

const Path = require("path");
const customCheck = require("@xarc/webpack/lib/util/custom-check");
Expand Down
4 changes: 3 additions & 1 deletion packages/xarc-app-dev/src/config/karma/karma.conf.watch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use strict";
/* eslint-disable @typescript-eslint/no-var-requires, @typescript-eslint/ban-ts-ignore */
export {};

/*
* Karma Configuration: "watch" version.
Expand All @@ -19,6 +20,7 @@ module.exports = function(config) {
"http://127.0.0.1:3001/assets/bundle.js"
// Watch these files but do not add them to the bundle.
].concat(
// @ts-ignore
["src/client/**", "test/**"].map(pattern => {
return {
pattern,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use strict";
/* eslint-disable @typescript-eslint/no-var-requires */
export {};

const dllUtil = require("@xarc/webpack/lib/util/dll-util");

Expand Down
Loading

0 comments on commit 46014c5

Please sign in to comment.