Use Yarn PnP (#181)
* build: enable pnp made * build: upgrade yarn version * build: correct some dependency structures * build: update libraries * build: get lint running, improve peerDeps * build: improve peerdeps on jest config; use custom jest config at top level * build: add semver change * test: add test suite packages * build: add semver doc * build: use hard versions * build: use --topological-dev for build
This commit is contained in:
Родитель
68bd2a5fde
Коммит
872c94aa87
|
@ -1,5 +1,3 @@
|
|||
{
|
||||
"recommendations": [
|
||||
"arcanis.vscode-zipfs"
|
||||
]
|
||||
"recommendations": ["arcanis.vscode-zipfs", "esbenp.prettier-vscode"]
|
||||
}
|
||||
|
|
|
@ -1 +1,9 @@
|
|||
{}
|
||||
{
|
||||
"search.exclude": {
|
||||
"**/.yarn": true,
|
||||
"**/.pnp.*": true
|
||||
},
|
||||
"prettier.prettierPath": ".yarn/sdks/prettier/index.js",
|
||||
"typescript.tsdk": ".yarn/sdks/typescript/lib",
|
||||
"typescript.enablePromptUseWorkspaceTsdk": true
|
||||
}
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -0,0 +1,5 @@
|
|||
# This file is automatically generated by PnPify.
|
||||
# Manual changes will be lost!
|
||||
|
||||
integrations:
|
||||
- vscode
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire, createRequireFromPath} = require(`module`);
|
||||
const {resolve, dirname} = require(`path`);
|
||||
|
||||
const relPnpApiPath = "../../../.pnp.js";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require prettier/index.js
|
||||
require(absPnpApiPath).setup();
|
||||
}
|
||||
}
|
||||
|
||||
// Defer to the real prettier/index.js your application uses
|
||||
module.exports = absRequire(`prettier/index.js`);
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"name": "prettier",
|
||||
"version": "2.1.2-pnpify",
|
||||
"main": "./index.js",
|
||||
"type": "commonjs"
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire, createRequireFromPath} = require(`module`);
|
||||
const {resolve, dirname} = require(`path`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.js";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require typescript/bin/tsc
|
||||
require(absPnpApiPath).setup();
|
||||
}
|
||||
}
|
||||
|
||||
// Defer to the real typescript/bin/tsc your application uses
|
||||
module.exports = absRequire(`typescript/bin/tsc`);
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire, createRequireFromPath} = require(`module`);
|
||||
const {resolve, dirname} = require(`path`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.js";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require typescript/bin/tsserver
|
||||
require(absPnpApiPath).setup();
|
||||
}
|
||||
}
|
||||
|
||||
// Defer to the real typescript/bin/tsserver your application uses
|
||||
module.exports = absRequire(`typescript/bin/tsserver`);
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"name": "typescript",
|
||||
"version": "4.0.3-pnpify",
|
||||
"main": "./lib/typescript.js",
|
||||
"type": "commonjs"
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
releases:
|
||||
"@essex/build-step-audit": patch
|
||||
"@essex/build-step-azure": patch
|
||||
"@essex/build-step-babel": patch
|
||||
"@essex/build-step-clean": patch
|
||||
"@essex/build-step-commitlint": patch
|
||||
"@essex/build-step-docs": patch
|
||||
"@essex/build-step-eslint": patch
|
||||
"@essex/build-step-init": patch
|
||||
"@essex/build-step-jest": patch
|
||||
"@essex/build-step-lint-staged": patch
|
||||
"@essex/build-step-pretty-quick": patch
|
||||
"@essex/build-step-recipes": patch
|
||||
"@essex/build-step-rollup": patch
|
||||
"@essex/build-step-storybook": patch
|
||||
"@essex/build-step-typedoc": patch
|
||||
"@essex/build-step-typescript": patch
|
||||
"@essex/build-step-webpack": patch
|
||||
"@essex/build-step-zip": patch
|
||||
"@essex/build-util-hoister": patch
|
||||
"@essex/build-utils": patch
|
||||
"@essex/jest-config": patch
|
||||
"@essex/scripts": patch
|
||||
"@essex/shellrunner": patch
|
||||
"@essex/tasklogger": patch
|
||||
"@essex/webpack-config": patch
|
||||
|
||||
declined:
|
||||
- "@essex/babel-config"
|
||||
- "@essex/eslint-config"
|
||||
- "@essex/eslint-plugin"
|
||||
- "@essex/storybook-config"
|
||||
- "@essex-build/test-suite-library"
|
||||
- "@essex-build/test-suite-webapp"
|
29
.yarnrc.yml
29
.yarnrc.yml
|
@ -1,6 +1,10 @@
|
|||
nmHoistingLimits: dependencies
|
||||
changesetBaseRefs:
|
||||
- main
|
||||
- origin/main
|
||||
- upstream/main
|
||||
|
||||
nodeLinker: node-modules
|
||||
changesetIgnorePatterns:
|
||||
- '**/*.spec.{js,ts,tsx}'
|
||||
|
||||
plugins:
|
||||
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
|
||||
|
@ -9,13 +13,18 @@ plugins:
|
|||
spec: '@yarnpkg/plugin-interactive-tools'
|
||||
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
|
||||
spec: '@yarnpkg/plugin-version'
|
||||
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
|
||||
spec: '@yarnpkg/plugin-typescript'
|
||||
|
||||
yarnPath: .yarn/releases/yarn-berry.cjs
|
||||
yarnPath: .yarn/releases/yarn-2.3.3.cjs
|
||||
|
||||
changesetBaseRefs:
|
||||
- 'main'
|
||||
- 'origin/main'
|
||||
- 'upstream/main'
|
||||
|
||||
changesetIgnorePatterns:
|
||||
- '**/*.spec.{js,ts,tsx}'
|
||||
packageExtensions:
|
||||
fork-ts-checker-webpack-plugin@*:
|
||||
dependencies:
|
||||
'@types/tapable': '^1.0.6'
|
||||
'@jest/reporters@*':
|
||||
dependencies:
|
||||
'@types/istanbul-lib-coverage': '2.0.3'
|
||||
jest-resolve@*:
|
||||
dependencies:
|
||||
jest-haste-map: '^26.5.2'
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
/*!
|
||||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
const { configure } = require('@essex/jest-config')
|
||||
|
||||
module.exports = configure([], '<rootDir>/tsconfig.jest.json')
|
13
package.json
13
package.json
|
@ -10,13 +10,15 @@
|
|||
"preinstall": "npx only-allow yarn",
|
||||
"essex": "node ./packages/scripts/lib/index.js",
|
||||
"clean_all": "yarn workspaces foreach -pv run clean",
|
||||
"build_all": "yarn workspaces foreach -pvt run build",
|
||||
"build_all": "yarn workspaces foreach -pv --topological-dev run build",
|
||||
"lint_all": "yarn workspaces foreach -pvt run lint",
|
||||
"test_all": "yarn workspaces foreach -pvt run test",
|
||||
"lage": "lage",
|
||||
"test": "yarn essex test",
|
||||
"unit_test": "yarn essex test",
|
||||
"lint": "yarn essex lint --docs --fix",
|
||||
"prettify": "essex prettify",
|
||||
"git_is_clean": "yarn essex git-is-clean",
|
||||
"ci": "run-s build_all lint test git_is_clean"
|
||||
"ci": "run-s build_all lint_all test_all lint unit_test git_is_clean"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^11.0.0",
|
||||
|
@ -25,12 +27,15 @@
|
|||
"@essex/jest-config": "^10.0.0",
|
||||
"@essex/prettier-config": "^10.0.0",
|
||||
"@types/jest": "^26.0.14",
|
||||
"@typescript-eslint/eslint-plugin": "^4.4.1",
|
||||
"@typescript-eslint/parser": "^4.4.1",
|
||||
"eslint-import-resolver-node": "^0.3.4",
|
||||
"husky": "^4.3.0",
|
||||
"jest-junit-reporter": "^1.1.0",
|
||||
"lint-staged": "^10.4.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.1.2",
|
||||
"ts-jest": "~26.3.0",
|
||||
"ts-jest": "^26.4.1",
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
"workspaces": [
|
||||
|
|
|
@ -10,15 +10,15 @@
|
|||
"build": "tsc"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.11.6",
|
||||
"@babel/core": "^7.12.0",
|
||||
"@babel/plugin-proposal-class-properties": "^7.10.4",
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.4",
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.0",
|
||||
"@babel/plugin-proposal-object-rest-spread": "^7.11.0",
|
||||
"@babel/plugin-proposal-optional-chaining": "^7.11.0",
|
||||
"@babel/preset-env": "^7.11.5"
|
||||
"@babel/plugin-proposal-optional-chaining": "^7.12.0",
|
||||
"@babel/preset-env": "^7.12.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/node": "^14.11.8",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.0.3"
|
||||
}
|
||||
|
|
|
@ -13,26 +13,31 @@
|
|||
"msHeader.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.11.6",
|
||||
"@babel/types": "^7.11.5",
|
||||
"@typescript-eslint/eslint-plugin": "^4.4.0",
|
||||
"@typescript-eslint/parser": "^4.4.0",
|
||||
"@babel/core": "^7.12.0",
|
||||
"@babel/types": "^7.12.0",
|
||||
"@typescript-eslint/eslint-plugin": "^4.4.1",
|
||||
"@typescript-eslint/parser": "^4.4.1",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"confusing-browser-globals": "^1.0.9",
|
||||
"eslint": "^7.10.0",
|
||||
"eslint": "^7.11.0",
|
||||
"eslint-config-prettier": "^6.12.0",
|
||||
"eslint-import-resolver-node": "^0.3.4",
|
||||
"eslint-plugin-header": "^3.1.0",
|
||||
"eslint-plugin-import": "^2.22.1",
|
||||
"eslint-plugin-jest": "^24.1.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.3.1",
|
||||
"eslint-plugin-react": "^7.21.3",
|
||||
"eslint-plugin-react": "^7.21.4",
|
||||
"eslint-plugin-react-hooks": "^4.1.2",
|
||||
"prettier": "^2.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/node": "^14.11.8",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": ">= 4.4.1",
|
||||
"@typescript-eslint/parser": ">= 4.4.1",
|
||||
"eslint-import-resolver-node": ">= 0.3.4"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
"@essex/eslint-plugin": "^10.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@essex/eslint-plugin": ">=10.0.0"
|
||||
"@essex/eslint-plugin": ">=10.0.0",
|
||||
"@typescript-eslint/eslint-plugin": ">= 4.4.1",
|
||||
"@typescript-eslint/parser": ">= 4.4.1",
|
||||
"eslint-import-resolver-node": ">= 0.3.4"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,15 +13,23 @@
|
|||
"@types/jest": "^26.0.14",
|
||||
"identity-obj-proxy": "^3.0.0",
|
||||
"jest-config": "^26.1.0",
|
||||
"jest-junit-reporter": "^1.1.0",
|
||||
"ts-jest": "~26.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/node": "^14.11.8",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"jest": ">= 26"
|
||||
"jest": ">= 26",
|
||||
"ts-jest": ">= 26"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"jest": {
|
||||
"optional": true
|
||||
},
|
||||
"ts-jest": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ export function configure(
|
|||
'^.+\\.[tj]sx?$': 'ts-jest',
|
||||
},
|
||||
testMatch: ['**/__tests__/**/?(*.)+(spec|test).[jt]s?(x)'],
|
||||
testResultsProcessor: 'jest-junit-reporter',
|
||||
rootDir: process.cwd(),
|
||||
roots: [process.cwd()],
|
||||
moduleNameMapper: {
|
||||
|
|
|
@ -10,10 +10,10 @@
|
|||
"build": "tsc"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.11.6",
|
||||
"@babel/core": "^7.12.0",
|
||||
"@essex/babel-config": "^10.0.0",
|
||||
"@essex/build-util-hoister": "^10.0.0",
|
||||
"@mdx-js/loader": "^1.6.17",
|
||||
"@mdx-js/loader": "^1.6.18",
|
||||
"@storybook/addon-a11y": "^6.0.26",
|
||||
"@storybook/addon-actions": "^6.0.26",
|
||||
"@storybook/addon-docs": "^6.0.26",
|
||||
|
@ -26,13 +26,13 @@
|
|||
"fork-ts-checker-webpack-plugin": "^5.2.0",
|
||||
"react-docgen-typescript-loader": "^3.7.2",
|
||||
"react-is": "^16.13.1",
|
||||
"ts-loader": "^8.0.4",
|
||||
"ts-loader": "^8.0.5",
|
||||
"webpack": "^4.44.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.11.5",
|
||||
"react": "^16.13.1",
|
||||
"react-dom": "^16.13.1",
|
||||
"@types/node": "^14.11.8",
|
||||
"react": "^16.14.0",
|
||||
"react-dom": "^16.14.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
|
|
|
@ -9,31 +9,32 @@
|
|||
"build": "tsc"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.11.6",
|
||||
"@babel/core": "^7.12.0",
|
||||
"@essex/babel-config": "^10.0.0",
|
||||
"@essex/build-util-hoister": "^10.0.0",
|
||||
"@types/webpack": "^4.41.22",
|
||||
"@types/webpack-dev-server": "^3.11.0",
|
||||
"babel-loader": "^8.1.0",
|
||||
"cache-loader": "^4.1.0",
|
||||
"css-loader": "^4.3.0",
|
||||
"css-loader": "^5.0.0",
|
||||
"debug": "^4.2.0",
|
||||
"fork-ts-checker-webpack-plugin": "^5.2.0",
|
||||
"html-webpack-plugin": "^4.5.0",
|
||||
"mini-css-extract-plugin": "^0.11.3",
|
||||
"sass-loader": "^10.0.2",
|
||||
"style-loader": "^1.3.0",
|
||||
"ts-loader": "^8.0.4",
|
||||
"webpack": "^4.44.2",
|
||||
"mini-css-extract-plugin": "^1.0.0",
|
||||
"pnp-webpack-plugin": "^1.6.4",
|
||||
"sass-loader": "^10.0.3",
|
||||
"style-loader": "^2.0.0",
|
||||
"ts-loader": "^8.0.5",
|
||||
"webpack": "^4",
|
||||
"webpack-dev-server": "^3.11.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/debug": "^4.1.5",
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/node": "^14.11.8",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"webpack": ">= 4.43.0"
|
||||
"webpack": ">= 4"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
*/
|
||||
import { existsSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
import { getEsmConfiguration } from '@essex/babel-config'
|
||||
import { Configuration } from 'webpack-dev-server'
|
||||
import { log } from './log'
|
||||
import { getEsmConfiguration } from '@essex/babel-config'
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
export const pkgJson = require(join(process.cwd(), 'package.json'))
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { join } from 'path'
|
||||
import { getNodeModulesPaths } from '@essex/build-util-hoister'
|
||||
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'
|
||||
import * as webpack from 'webpack'
|
||||
import { Configuration as WdsConfiguration } from 'webpack-dev-server'
|
||||
|
@ -16,9 +15,12 @@ import {
|
|||
} from './configValues'
|
||||
import { log } from './log'
|
||||
import { validateConfiguration } from './validate'
|
||||
import { getNodeModulesPaths } from '@essex/build-util-hoister'
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
||||
const PnpWebpackPlugin = require('pnp-webpack-plugin')
|
||||
|
||||
// Webpack Loaders
|
||||
const babelLoader = require.resolve('babel-loader')
|
||||
|
@ -32,6 +34,7 @@ export interface Configuration {
|
|||
env?: string
|
||||
mode?: 'development' | 'production' | 'none'
|
||||
typecheck?: boolean
|
||||
pnp?: boolean
|
||||
// extends
|
||||
aliases?: (env: string, mode: string) => any
|
||||
output?: (env: string, mode: string) => any
|
||||
|
@ -45,6 +48,7 @@ export interface Configuration {
|
|||
export function configure({
|
||||
env = 'development',
|
||||
mode = 'none',
|
||||
pnp = false,
|
||||
typecheck = true,
|
||||
aliases,
|
||||
output,
|
||||
|
@ -100,11 +104,12 @@ export function configure({
|
|||
devtool: 'cheap-module-source-map',
|
||||
output: {
|
||||
path: buildPath,
|
||||
chunkFilename: '[name].[hash].js',
|
||||
filename: '[name].[hash].js',
|
||||
chunkFilename: '[name].[chunkhashh].js',
|
||||
filename: '[name].[fullhash].js',
|
||||
...extendedOutput,
|
||||
},
|
||||
resolve: {
|
||||
plugins: pnp ? [PnpWebpackPlugin] : undefined,
|
||||
extensions: ['.ts', '.tsx', '.js', '.jsx'],
|
||||
modules: [...standardModulePaths, ...extendedResolveModules],
|
||||
alias: {
|
||||
|
@ -112,6 +117,7 @@ export function configure({
|
|||
},
|
||||
},
|
||||
resolveLoader: {
|
||||
plugins: pnp ? [PnpWebpackPlugin.moduleLoader(module)] : undefined,
|
||||
modules: [...standardModulePaths, ...extendedResolveLoaderModules],
|
||||
},
|
||||
module: {
|
||||
|
@ -123,7 +129,7 @@ export function configure({
|
|||
test: /\.tsx?$/,
|
||||
exclude: /node_modules/,
|
||||
use: [
|
||||
{ loader: cacheLoader },
|
||||
cacheLoader,
|
||||
{
|
||||
loader: babelLoader,
|
||||
options: babelConfig,
|
||||
|
@ -142,7 +148,7 @@ export function configure({
|
|||
*/
|
||||
{
|
||||
test: /\.module\.s(a|c)ss$/,
|
||||
loader: [
|
||||
use: [
|
||||
isDevelopment ? styleLoader : MiniCssExtractPlugin.loader,
|
||||
{
|
||||
loader: cssLoader,
|
||||
|
@ -165,7 +171,7 @@ export function configure({
|
|||
{
|
||||
test: /\.s(a|c)ss$/,
|
||||
exclude: /\.module.(s(a|c)ss)$/,
|
||||
loader: [
|
||||
use: [
|
||||
isDevelopment ? styleLoader : MiniCssExtractPlugin.loader,
|
||||
cssLoader,
|
||||
{
|
||||
|
@ -181,7 +187,7 @@ export function configure({
|
|||
*/
|
||||
{
|
||||
test: /\.css$/,
|
||||
loader: [
|
||||
use: [
|
||||
isDevelopment ? styleLoader : MiniCssExtractPlugin.loader,
|
||||
cssLoader,
|
||||
],
|
||||
|
@ -191,7 +197,6 @@ export function configure({
|
|||
devServer: {
|
||||
stats: 'minimal',
|
||||
hot: true,
|
||||
open: true,
|
||||
compress: true,
|
||||
historyApiFallback: true,
|
||||
clientLogLevel: 'error',
|
||||
|
@ -222,9 +227,6 @@ export function configure({
|
|||
}),
|
||||
...extendedPlugins,
|
||||
].filter(p => !!p),
|
||||
node: {
|
||||
fs: 'empty',
|
||||
},
|
||||
}
|
||||
|
||||
log('final webpack configuration', result)
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
"@types/gulp": "^4.0.7",
|
||||
"@types/gulp-babel": "^6.1.29",
|
||||
"@types/gulp-debug": "^2.0.31",
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/node": "^14.11.8",
|
||||
"crlf": "^1.1.1",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"rimraf": "^3.0.2",
|
||||
|
@ -65,11 +65,15 @@
|
|||
"typescript": "^4.0.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@commitlint/cli": ">= 11.0.0",
|
||||
"@essex/eslint-config": ">=10.0.0",
|
||||
"@essex/jest-config": ">=10.0.0",
|
||||
"@essex/prettier-config": ">=10.0.0",
|
||||
"@storybook/react": ">= 6",
|
||||
"@typescript-eslint/eslint-plugin": ">= 4.4.1",
|
||||
"@typescript-eslint/parser": ">= 4.4.1",
|
||||
"audit-ci": ">= 3.1",
|
||||
"eslint-import-resolver-node": ">= 0.3.4",
|
||||
"husky": ">= 4.2.5",
|
||||
"license-to-fail": ">= 4.0",
|
||||
"lint-staged": "*",
|
||||
|
@ -78,6 +82,9 @@
|
|||
"rollup": ">= 2"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@commitlint/cli": {
|
||||
"optional": true
|
||||
},
|
||||
"@essex/eslint-config": {
|
||||
"optional": true
|
||||
},
|
||||
|
@ -90,9 +97,18 @@
|
|||
"@storybook/react": {
|
||||
"optional": true
|
||||
},
|
||||
"@typescript-eslint/eslint-plugin": {
|
||||
"optional": true
|
||||
},
|
||||
"@typescript-eslint/parser": {
|
||||
"optional": true
|
||||
},
|
||||
"audit-ci": {
|
||||
"optional": true
|
||||
},
|
||||
"eslint-import-resolver-node": {
|
||||
"optional": true
|
||||
},
|
||||
"license-to-fail": {
|
||||
"optional": true
|
||||
},
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { execGulpTask } from '@essex/build-utils'
|
||||
import { success, fail } from '@essex/tasklogger'
|
||||
import { Command } from 'commander'
|
||||
import { configureTasks } from './tasks'
|
||||
import { BuildCommandOptions } from './types'
|
||||
import { execGulpTask } from '@essex/build-utils'
|
||||
import { success, fail } from '@essex/tasklogger'
|
||||
|
||||
export default function build(program: Command): void {
|
||||
program
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
import { existsSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
import * as gulp from 'gulp'
|
||||
import { BuildCommandOptions } from './types'
|
||||
import { buildBabel } from '@essex/build-step-babel'
|
||||
import { generateTypedocsGulp } from '@essex/build-step-typedoc'
|
||||
import { compileTypescript, emitTypings } from '@essex/build-step-typescript'
|
||||
import { noopTask } from '@essex/build-utils'
|
||||
import * as gulp from 'gulp'
|
||||
import { BuildCommandOptions } from './types'
|
||||
|
||||
const cwd = process.cwd()
|
||||
const tsConfigPath = join(cwd, 'tsconfig.json')
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { execGulpTask } from '@essex/build-utils'
|
||||
import { success, fail } from '@essex/tasklogger'
|
||||
import { Command } from 'commander'
|
||||
import { configureTasks } from './tasks'
|
||||
import { TestCommandOptions } from './types'
|
||||
import { execGulpTask } from '@essex/build-utils'
|
||||
import { success, fail } from '@essex/tasklogger'
|
||||
|
||||
export default function unitTest(program: Command): void {
|
||||
program
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { jestGulp } from '@essex/build-step-jest'
|
||||
import * as gulp from 'gulp'
|
||||
import { TestCommandOptions } from './types'
|
||||
import { jestGulp } from '@essex/build-step-jest'
|
||||
|
||||
export function configureTasks(config: TestCommandOptions): gulp.TaskFunction {
|
||||
return jestGulp(config)
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { execGulpTask } from '@essex/build-utils'
|
||||
import { success, fail } from '@essex/tasklogger'
|
||||
import { Command } from 'commander'
|
||||
import { configureTasks } from './tasks'
|
||||
import { execGulpTask } from '@essex/build-utils'
|
||||
import { success, fail } from '@essex/tasklogger'
|
||||
|
||||
export interface AuditCommandOptions {
|
||||
verbose: boolean
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { auditSecurity, auditLicenses } from '@essex/build-step-audit'
|
||||
import * as gulp from 'gulp'
|
||||
import { auditSecurity, auditLicenses } from '@essex/build-step-audit'
|
||||
|
||||
export function configureTasks(): gulp.TaskFunction {
|
||||
return gulp.parallel(auditSecurity, auditLicenses)
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { execGulpTask } from '@essex/build-utils'
|
||||
import { success, fail } from '@essex/tasklogger'
|
||||
import { Command } from 'commander'
|
||||
import { configureTasks } from './tasks'
|
||||
import { BundleCommandOptions } from './types'
|
||||
import { execGulpTask } from '@essex/build-utils'
|
||||
import { success, fail } from '@essex/tasklogger'
|
||||
|
||||
export default function build(program: Command): void {
|
||||
program
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
import { existsSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
import * as gulp from 'gulp'
|
||||
import { BundleCommandOptions } from './types'
|
||||
import { rollupBuild } from '@essex/build-step-rollup'
|
||||
import { storybookBuildGulp } from '@essex/build-step-storybook'
|
||||
import { webpackBuildGulp } from '@essex/build-step-webpack'
|
||||
import { noopTask } from '@essex/build-utils'
|
||||
import * as gulp from 'gulp'
|
||||
import { BundleCommandOptions } from './types'
|
||||
|
||||
const wpConfigExists = existsSync(join(process.cwd(), 'webpack.config.js'))
|
||||
const rollupConfigExists = existsSync(join(process.cwd(), 'rollup.config.js'))
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { clean as cleanTask } from '@essex/build-step-clean'
|
||||
import { success, fail } from '@essex/tasklogger'
|
||||
import { Command } from 'commander'
|
||||
|
||||
export default function clean(program: Command): void {
|
||||
program
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { checkCommitMessage } from '@essex/build-step-commitlint'
|
||||
import { success, fail } from '@essex/tasklogger'
|
||||
import { Command } from 'commander'
|
||||
|
||||
export default function commitMsg(program: Command): void {
|
||||
program
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { success, fail } from '@essex/tasklogger'
|
||||
import { Command } from 'commander'
|
||||
import { execute } from './tasks'
|
||||
import { DeployCommandOptions } from './types'
|
||||
import { success, fail } from '@essex/tasklogger'
|
||||
|
||||
export default function deploy(program: Command): void {
|
||||
program
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { deployBlob } from '@essex/build-step-azure'
|
||||
import { DeployCommandOptions, DeployType } from './types'
|
||||
import { deployBlob } from '@essex/build-step-azure'
|
||||
|
||||
export function execute(options: DeployCommandOptions): Promise<void> {
|
||||
if (!options.type) {
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { run, Job } from '@essex/shellrunner'
|
||||
import * as logger from '@essex/tasklogger'
|
||||
import { Command } from 'commander'
|
||||
|
||||
export default function start(program: Command): void {
|
||||
program
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { execGulpTask } from '@essex/build-utils'
|
||||
import { success, fail } from '@essex/tasklogger'
|
||||
import { Command } from 'commander'
|
||||
import { configureTasks } from './tasks'
|
||||
import { LintCommandOptions } from './types'
|
||||
import { execGulpTask } from '@essex/build-utils'
|
||||
import { success, fail } from '@essex/tasklogger'
|
||||
|
||||
export default function lint(program: Command): void {
|
||||
program
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import * as gulp from 'gulp'
|
||||
import { LintCommandOptions } from './types'
|
||||
import { docs as execDocs } from '@essex/build-step-docs'
|
||||
import { eslint } from '@essex/build-step-eslint'
|
||||
import { prettyQuick } from '@essex/build-step-pretty-quick'
|
||||
import { resolveGulpTask, noopTask } from '@essex/build-utils'
|
||||
import * as gulp from 'gulp'
|
||||
import { LintCommandOptions } from './types'
|
||||
|
||||
export function configureTasks(
|
||||
{
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { lintStaged } from '@essex/build-step-lint-staged'
|
||||
import { success, fail } from '@essex/tasklogger'
|
||||
import { Command } from 'commander'
|
||||
|
||||
export default function preCommit(program: Command): void {
|
||||
program
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { prettyQuick } from '@essex/build-step-pretty-quick'
|
||||
import { success, fail } from '@essex/tasklogger'
|
||||
import { Command } from 'commander'
|
||||
|
||||
interface PrettifyCommandOptions {
|
||||
verbose?: boolean
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { recipes } from '@essex/build-step-recipes'
|
||||
import * as log from '@essex/tasklogger'
|
||||
import { Command } from 'commander'
|
||||
export default function commitMsg(program: Command): void {
|
||||
program
|
||||
.command('recipes')
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { execGulpTask } from '@essex/build-utils'
|
||||
import { Command } from 'commander'
|
||||
import { configureTasks } from './tasks'
|
||||
import { WatchCommandOptions } from './types'
|
||||
import { execGulpTask } from '@essex/build-utils'
|
||||
|
||||
export default function watch(program: Command): void {
|
||||
program
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
*/
|
||||
import { existsSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
import { TaskFunction } from 'gulp'
|
||||
import { WatchCommandOptions } from './types'
|
||||
import { watchBabel } from '@essex/build-step-babel'
|
||||
import { rollupWatch } from '@essex/build-step-rollup'
|
||||
import { watchTypescript } from '@essex/build-step-typescript'
|
||||
import { webpackWatch } from '@essex/build-step-webpack'
|
||||
import { TaskFunction } from 'gulp'
|
||||
import { WatchCommandOptions } from './types'
|
||||
|
||||
const webpackConfigFile = join(process.cwd(), 'webpack.config.js')
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { zip, ZipCommandOptions } from '@essex/build-step-zip'
|
||||
import { Command } from 'commander'
|
||||
import { zip, ZipCommandOptions } from '@essex/build-step-zip'
|
||||
|
||||
export default function zipCommand(program: Command): void {
|
||||
program
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"@essex/tasklogger": "^10.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/node": "^14.11.8",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
"devDependencies": {
|
||||
"@types/glob": "^7.1.3",
|
||||
"@types/mime-types": "^2.1.0",
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/node": "^14.11.8",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.0.3"
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
"build": "tsc"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.11.6",
|
||||
"@babel/types": "^7.11.5",
|
||||
"@babel/core": "^7.12.0",
|
||||
"@babel/types": "^7.12.0",
|
||||
"@essex/babel-config": "^10.0.0",
|
||||
"@essex/build-utils": "^10.0.0",
|
||||
"@essex/tasklogger": "^10.0.0",
|
||||
|
@ -24,7 +24,7 @@
|
|||
"@types/gulp-babel": "^6.1.29",
|
||||
"@types/gulp-debug": "^2.0.31",
|
||||
"@types/gulp-plumber": "^0.0.32",
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/node": "^14.11.8",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.0.3"
|
||||
}
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
*/
|
||||
/* eslint-disable @essex/adjacent-await */
|
||||
import { FSWatcher } from 'fs'
|
||||
import { getCjsConfiguration, getEsmConfiguration } from '@essex/babel-config'
|
||||
import { noopStep } from '@essex/build-utils'
|
||||
import { subtaskSuccess, subtaskFail } from '@essex/tasklogger'
|
||||
import * as gulp from 'gulp'
|
||||
import * as babel from 'gulp-babel'
|
||||
import * as debug from 'gulp-debug'
|
||||
import * as plumber from 'gulp-plumber'
|
||||
import { getCjsConfiguration, getEsmConfiguration } from '@essex/babel-config'
|
||||
import { noopStep } from '@essex/build-utils'
|
||||
import { subtaskSuccess, subtaskFail } from '@essex/tasklogger'
|
||||
|
||||
const BABEL_GLOBS = ['lib/**/*.js']
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"rimraf": "^3.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/node": "^14.11.8",
|
||||
"@types/rimraf": "^3.0.0",
|
||||
"typescript": "^4.0.3"
|
||||
}
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import { gulpify } from '@essex/build-utils'
|
||||
import { rm } from './rm'
|
||||
import { gulpify } from '@essex/build-utils'
|
||||
|
||||
export async function clean(files: string[]): Promise<void> {
|
||||
const promises: Array<Promise<void>> = files.filter(f => !!f).map(f => rm(f!))
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"@essex/shellrunner": "^10.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/node": "^14.11.8",
|
||||
"@types/rimraf": "^3.0.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.0.3"
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
"dependencies": {
|
||||
"@essex/build-utils": "^10.0.0",
|
||||
"dictionary-en": "^3.0.1",
|
||||
"remark-frontmatter": "^2.0.0",
|
||||
"remark-frontmatter": "^3.0.0",
|
||||
"remark-message-control": "^6.0.0",
|
||||
"remark-parse": "^8.0.3",
|
||||
"remark-parse": "^9.0.0",
|
||||
"remark-retext": "^4.0.0",
|
||||
"retext-english": "^3.0.4",
|
||||
"retext-equality": "^5.4.0",
|
||||
|
@ -24,7 +24,7 @@
|
|||
"vfile-reporter": "^6.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/node": "^14.11.8",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.0.3"
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { filterShellCode, gulpify } from '@essex/build-utils'
|
||||
import { app } from './app'
|
||||
import { filterShellCode, gulpify } from '@essex/build-utils'
|
||||
|
||||
/**
|
||||
* Checks docs for tonal linting & misspellings
|
||||
|
|
|
@ -16,13 +16,14 @@
|
|||
"@essex/build-utils": "^10.0.0",
|
||||
"@essex/eslint-config": "^10.0.0",
|
||||
"@essex/eslint-plugin": "^10.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^4.4.0",
|
||||
"@typescript-eslint/parser": "^4.4.0",
|
||||
"eslint": "^7.10.0"
|
||||
"@typescript-eslint/eslint-plugin": "^4.4.1",
|
||||
"@typescript-eslint/parser": "^4.4.1",
|
||||
"eslint": "^7.11.0",
|
||||
"eslint-import-resolver-node": "^0.3.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/eslint": "^7.2.3",
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/eslint": "^7.2.4",
|
||||
"@types/node": "^14.11.8",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.0.3"
|
||||
}
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
/* eslint-disable @essex/adjacent-await */
|
||||
import { gulpify } from '@essex/build-utils'
|
||||
import { ESLint } from 'eslint'
|
||||
import { getConfigFile, getIgnorePath } from './config'
|
||||
import { gulpify } from '@essex/build-utils'
|
||||
|
||||
export async function eslint(
|
||||
fix: boolean,
|
||||
|
|
|
@ -5,3 +5,4 @@ dist/
|
|||
lib/
|
||||
coverage/
|
||||
public/
|
||||
.yarn/
|
|
@ -5,3 +5,4 @@ dist/
|
|||
lib/
|
||||
coverage/
|
||||
public/
|
||||
.yarn/
|
|
@ -12,3 +12,10 @@ storybook-static/
|
|||
coverage/
|
||||
test-report.xml
|
||||
|
||||
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
|
||||
.yarn/*
|
||||
!.yarn/cache
|
||||
!.yarn/releases
|
||||
!.yarn/plugins
|
||||
!.yarn/sdks
|
||||
!.yarn/versions
|
|
@ -6,4 +6,5 @@ lib/
|
|||
coverage/
|
||||
public/
|
||||
pnpm-lock.yaml
|
||||
pnpm-workspace.yaml
|
||||
pnpm-workspace.yaml
|
||||
.yarn/
|
|
@ -14,7 +14,7 @@
|
|||
"@essex/tasklogger": "^10.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/node": "^14.11.8",
|
||||
"@types/rimraf": "^3.0.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.0.3"
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
import { writeFileSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
import * as log from '@essex/tasklogger'
|
||||
import { copyConfigFile } from './util'
|
||||
import * as log from '@essex/tasklogger'
|
||||
|
||||
const pkgJsonPath = join(process.cwd(), 'package.json')
|
||||
const pkgJson = require(pkgJsonPath)
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
import { writeFileSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
import { copyConfigFile } from './util'
|
||||
import { recipes } from '@essex/build-step-recipes'
|
||||
import * as log from '@essex/tasklogger'
|
||||
import { copyConfigFile } from './util'
|
||||
|
||||
const pkgJsonPath = join(process.cwd(), 'package.json')
|
||||
const pkgJson = require(pkgJsonPath)
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
"jest": "~26.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/node": "^14.11.8",
|
||||
"@types/rimraf": "^3.0.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.0.3"
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
import { gulpify } from '@essex/build-utils'
|
||||
import { getJestConfiguration } from '@essex/jest-config'
|
||||
import { runCLI } from '@jest/core'
|
||||
import * as debug from 'debug'
|
||||
import { gulpify } from '@essex/build-utils'
|
||||
import { getJestConfiguration } from '@essex/jest-config'
|
||||
|
||||
const log = debug('essex:jest')
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"@essex/shellrunner": "^10.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/node": "^14.11.8",
|
||||
"@types/rimraf": "^3.0.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.0.3"
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { configureJob } from './configure'
|
||||
import { filterShellCode, gulpify } from '@essex/build-utils'
|
||||
import { run } from '@essex/shellrunner'
|
||||
import { configureJob } from './configure'
|
||||
|
||||
export function lintStaged(): Promise<void> {
|
||||
const job = configureJob()
|
||||
|
|
|
@ -13,10 +13,10 @@
|
|||
"@essex/tasklogger": "^10.0.0",
|
||||
"chalk": "^4.1.0",
|
||||
"prettier": "^2.1.2",
|
||||
"pretty-quick": "^3.0.2"
|
||||
"pretty-quick": "^3.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/node": "^14.11.8",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.0.3"
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { gulpify } from '@essex/build-utils'
|
||||
import * as chalk from 'chalk'
|
||||
import { gulpify } from '@essex/build-utils'
|
||||
|
||||
/* eslint-disable-next-line @typescript-eslint/no-var-requires */
|
||||
const pq = require('pretty-quick').default
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"@essex/tasklogger": "^10.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/node": "^14.11.8",
|
||||
"@types/rimraf": "^3.0.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.0.3"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"@essex/tasklogger": "^10.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/node": "^14.11.8",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"@essex/tasklogger": "^10.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/node": "^14.11.8",
|
||||
"@types/rimraf": "^3.0.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.0.3"
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"typescript": "^4.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/node": "^14.11.8",
|
||||
"rimraf": "^3.0.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
*/
|
||||
import { existsSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
import { gulpify } from '@essex/build-utils'
|
||||
import {
|
||||
Application,
|
||||
TSConfigReader,
|
||||
TypeDocReader,
|
||||
TypeDocAndTSOptions,
|
||||
} from 'typedoc'
|
||||
import { gulpify } from '@essex/build-utils'
|
||||
|
||||
const packageJsonPath = join(process.cwd(), 'package.json')
|
||||
const readmePath = join(process.cwd(), 'README.md')
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
"@types/gulp": "^4.0.7",
|
||||
"@types/gulp-debug": "^2.0.31",
|
||||
"@types/gulp-plumber": "^0.0.32",
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/node": "^14.11.8",
|
||||
"rimraf": "^3.0.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
*/
|
||||
import { existsSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
import { noopStep } from '@essex/build-utils'
|
||||
import { subtaskSuccess, subtaskFail } from '@essex/tasklogger'
|
||||
import * as gulp from 'gulp'
|
||||
import * as debug from 'gulp-debug'
|
||||
import * as plumber from 'gulp-plumber'
|
||||
import * as ts from 'gulp-typescript'
|
||||
import { FileWatcher } from 'typescript'
|
||||
import { noopStep } from '@essex/build-utils'
|
||||
import { subtaskSuccess, subtaskFail } from '@essex/tasklogger'
|
||||
|
||||
const TYPESCRIPT_GLOBS = ['src/**/*.ts*', '!**/__tests__/**']
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"webpack-dev-server": "^3.11.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/node": "^14.11.8",
|
||||
"@types/webpack": "^4.41.22",
|
||||
"@types/webpack-dev-server": "^3.11.0",
|
||||
"rimraf": "^3.0.2",
|
||||
|
|
|
@ -2,28 +2,30 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { gulpify } from '@essex/build-utils'
|
||||
import { subtaskSuccess, subtaskFail } from '@essex/tasklogger'
|
||||
import * as webpack from 'webpack'
|
||||
import { getConfig } from './getConfig'
|
||||
import { WebpackCompilerOptions } from './types'
|
||||
import { gulpify } from '@essex/build-utils'
|
||||
import { subtaskSuccess, subtaskFail } from '@essex/tasklogger'
|
||||
|
||||
export function webpackBuild(opts: WebpackCompilerOptions): Promise<void> {
|
||||
try {
|
||||
const config = getConfig(opts)
|
||||
const compiler = webpack(config)
|
||||
return new Promise((resolve, reject) => {
|
||||
compiler.run((err: Error, stats: webpack.Stats) => {
|
||||
console.log(stats.toString({ colors: true }))
|
||||
if (err || stats.hasErrors()) {
|
||||
console.log('webpack error', err)
|
||||
subtaskFail('webpack')
|
||||
reject(err)
|
||||
} else {
|
||||
subtaskSuccess('webpack')
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
compiler.run(
|
||||
(err: Error | undefined, stats: webpack.Stats | undefined) => {
|
||||
if (err || stats?.hasErrors()) {
|
||||
console.log('webpack error', err)
|
||||
subtaskFail('webpack')
|
||||
reject(err)
|
||||
} else {
|
||||
console.log(stats?.toString({ colors: true }))
|
||||
subtaskSuccess('webpack')
|
||||
resolve()
|
||||
}
|
||||
},
|
||||
)
|
||||
})
|
||||
} catch (err) {
|
||||
console.log('error running webpack build', err)
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
*/
|
||||
import { existsSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
import { configure } from '@essex/webpack-config'
|
||||
import { Configuration } from 'webpack'
|
||||
import { Configuration as WdsConfiguration } from 'webpack-dev-server'
|
||||
import { WebpackCompilerOptions } from './types'
|
||||
import { configure } from '@essex/webpack-config'
|
||||
|
||||
const webpackConfigFile = join(process.cwd(), 'webpack.config.js')
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ export function webpackServe({
|
|||
const port = wpConfig?.devServer?.port || DEFAULT_PORT
|
||||
const host = wpConfig?.devServer?.host || DEFAULT_HOST
|
||||
|
||||
const server = new Server(compiler, wpConfig.devServer)
|
||||
const server = new Server(compiler as any, wpConfig.devServer)
|
||||
server.listen(port, host, (err?: Error | undefined) => {
|
||||
if (err) {
|
||||
console.log(`error listening`, err)
|
||||
|
|
|
@ -16,12 +16,12 @@ export function webpackWatch(opts: WebpackCompilerOptions): Promise<number> {
|
|||
aggregateTimeout: 500,
|
||||
ignored: /node_modules/,
|
||||
},
|
||||
(err: Error, stats: webpack.Stats) => {
|
||||
(err: Error | undefined, stats: webpack.Stats | undefined) => {
|
||||
if (err) {
|
||||
console.log('webpack error', err)
|
||||
reject(err)
|
||||
}
|
||||
console.log(stats.toString({ colors: true }))
|
||||
console.log(stats?.toString({ colors: true }))
|
||||
},
|
||||
)
|
||||
} catch (err) {
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"devDependencies": {
|
||||
"@types/archiver": "^3.1.1",
|
||||
"@types/glob": "^7.1.3",
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/node": "^14.11.8",
|
||||
"typescript": "^4.0.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
"compilerOptions": {
|
||||
"outDir": "lib"
|
||||
},
|
||||
"include": ["src/**/*.ts"]
|
||||
"include": ["src/index.ts"]
|
||||
}
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
node_modules/
|
||||
build/
|
||||
dist/
|
||||
lib/
|
||||
coverage/
|
||||
public/
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"extends": "@essex/eslint-config/release"
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
/*!
|
||||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
const { configure } = require('@essex/jest-config')
|
||||
|
||||
module.exports = configure([])
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"name": "@essex-build/test-suite-library",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"main": "dist/cjs/index.js",
|
||||
"module": "dist/esm/index.js",
|
||||
"types": "dist/types/index.d.ts",
|
||||
"scripts": {
|
||||
"clean": "essex clean",
|
||||
"build": "essex build",
|
||||
"lint": "essex lint",
|
||||
"test": "essex test",
|
||||
"watch": "essex watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@essex/eslint-config": "^10.0.0",
|
||||
"@essex/jest-config": "^10.0.0",
|
||||
"@essex/scripts": "^10.0.0",
|
||||
"@types/jest": "^26.0.14",
|
||||
"@typescript-eslint/eslint-plugin": "^4.4.1",
|
||||
"@typescript-eslint/parser": "^4.4.1",
|
||||
"eslint-import-resolver-node": "^0.3.4",
|
||||
"ts-jest": "^26.4.1"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
/*!
|
||||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { add } from '../add'
|
||||
|
||||
describe('the adder', () => {
|
||||
it('can add 2 and 2', () => {
|
||||
expect(add(2, 2)).toEqual(4)
|
||||
})
|
||||
it('can add 3 and 5', () => {
|
||||
expect(add(3, 5)).toEqual(8)
|
||||
})
|
||||
})
|
|
@ -0,0 +1,7 @@
|
|||
/*!
|
||||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
export function add(...nums: number[]): number {
|
||||
return nums.reduce((prev, cur) => prev + cur, 0)
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
/*!
|
||||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
export * from './add'
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"lib": ["ESNext"],
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"types": ["jest"]
|
||||
},
|
||||
"include": ["src/index.ts"]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
node_modules/
|
||||
build/
|
||||
dist/
|
||||
lib/
|
||||
coverage/
|
||||
public/
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"extends": "@essex/eslint-config/release"
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"name": "@essex-build/test-suite-webapp",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"clean": "essex clean",
|
||||
"build": "essex bundle",
|
||||
"lint": "essex lint",
|
||||
"start": "essex serve"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/react": "^16.9.52",
|
||||
"@types/react-dom": "^16.9.8",
|
||||
"react": "^16.14.0",
|
||||
"react-dom": "^16.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@essex/eslint-config": "^10.0.0",
|
||||
"@essex/scripts": "^10.0.0",
|
||||
"@essex/webpack-config": "^10.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^4.4.1",
|
||||
"@typescript-eslint/parser": "^4.4.1",
|
||||
"eslint-import-resolver-node": "^0.3.4"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
/*!
|
||||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import React, { memo } from 'react'
|
||||
|
||||
export const App: React.FC = memo(function App() {
|
||||
return <div>Hello!!</div>
|
||||
})
|
|
@ -0,0 +1,11 @@
|
|||
/*!
|
||||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import React from 'react'
|
||||
import { render } from 'react-dom'
|
||||
import { App } from './App'
|
||||
|
||||
const root = document.createElement('div')
|
||||
document.body.appendChild(root)
|
||||
render(<App />, root)
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"lib": ["ESNext", "DOM"],
|
||||
"jsx": "react",
|
||||
"strict": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
/*!
|
||||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
const { configure } = require('@essex/webpack-config')
|
||||
const webpackConfig = configure({ pnp: true })
|
||||
module.exports = webpackConfig
|
|
@ -17,7 +17,7 @@
|
|||
"through2": "^4.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/node": "^14.11.8",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.0.3"
|
||||
}
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче