@zohodesk/react-cli 1.1.19-exp.11 → 1.1.19-exp.13
Sign up to get free protection for your applications and to get access to all the features.
- package/bin/cli.js +0 -4
- package/lib/babel/cmjs-plugins-presets.js +6 -11
- package/lib/babel/es-plugins-presets.js +6 -12
- package/lib/configs/jest.config.js +3 -3
- package/lib/configs/webpack.dev.config.js +0 -4
- package/lib/configs/webpack.prod.config.js +1 -5
- package/lib/jest/preProcessors/jsPreprocessor.js +1 -1
- package/lib/loaderUtils/getDevJsLoaders.js +1 -1
- package/lib/loaders/docsLoader.js +2 -2
- package/lib/loaders/enhancedReactLiveConverter.js +151 -0
- package/lib/schemas/index.js +0 -3
- package/npm-shrinkwrap.json +14 -444
- package/package.json +1 -6
- package/packages/client_build_tool/lib/allCommandsConfigs.js +25 -0
- package/packages/client_build_tool/lib/commands/build/commandExecutor.js +17 -0
- package/packages/client_build_tool/lib/commands/build/config.js +12 -0
- package/packages/client_build_tool/lib/commands/build/optionsProcessor.js +35 -0
- package/packages/client_build_tool/lib/commands/build/preProcessor.js +12 -0
- package/packages/client_build_tool/lib/commands/buildEs/commandExecutor.js +33 -0
- package/packages/client_build_tool/lib/commands/buildEs/config.js +12 -0
- package/packages/client_build_tool/lib/commands/buildEs/preProcessor.js +17 -0
- package/packages/client_build_tool/lib/commands/buildLib/commandExecutor.js +33 -0
- package/packages/client_build_tool/lib/commands/buildLib/config.js +12 -0
- package/packages/client_build_tool/lib/commands/buildLib/preProcessor.js +17 -0
- package/packages/client_build_tool/lib/commands/mockserver/commandExecutor.js +43 -0
- package/packages/client_build_tool/lib/commands/mockserver/config.js +12 -0
- package/packages/client_build_tool/lib/commands/pre_process/commandExecutor.js +18 -0
- package/packages/client_build_tool/lib/commands/pre_process/config.js +12 -0
- package/packages/client_build_tool/lib/commands/start/commandExecutor.js +12 -0
- package/packages/client_build_tool/lib/commands/start/config.js +12 -0
- package/packages/client_build_tool/lib/commands/start/optionsProcessor.js +30 -0
- package/packages/client_build_tool/lib/commands/start/preProcessor.js +12 -0
- package/packages/client_build_tool/lib/commands/template/commandExecutor.js +28 -0
- package/packages/client_build_tool/lib/commands/template/config.js +12 -0
- package/packages/client_build_tool/lib/commands/version/commandExecutor.js +14 -0
- package/packages/client_build_tool/lib/commands/version/config.js +12 -0
- package/packages/client_build_tool/lib/commandsRouter.js +74 -0
- package/packages/client_build_tool/lib/index.js +12 -0
- package/packages/client_build_tool/lib/logger.js +34 -0
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/otherTestCases.test.js +234 -0
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/passingDifferentDataTypesToSchema.test.js +103 -0
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/passingEmptyObjects.test.js +41 -0
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByCustomOptions/convertArray.test.js +68 -0
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByCustomOptions/convertNumber.test.js +68 -0
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByCustomOptions/convertObject.test.js +141 -0
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByCustomOptions/convertString.test.js +68 -0
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByCustomOptions/convertUndefinedAndNull.test.js +132 -0
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByProcessEnv/convertArray.test.js +71 -0
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByProcessEnv/convertNumber.test.js +71 -0
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByProcessEnv/convertObject.test.js +73 -0
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByProcessEnv/convertString.test.js +71 -0
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByProcessEnv/convertUndefinedAndNull.test.js +138 -0
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/index.js +34 -0
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/isObject.js +10 -0
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/isValid.js +14 -0
- package/packages/client_build_tool/lib/schemas/cliArgsToObject.js +39 -0
- package/packages/client_build_tool/lib/schemas/defaultConfigValues.js +334 -0
- package/packages/client_build_tool/lib/schemas/defaultConfigValuesOnly.js +187 -0
- package/packages/client_build_tool/lib/schemas/deprecatedOptionsHandler.js +67 -0
- package/packages/client_build_tool/lib/schemas/getNpmVersion.js +22 -0
- package/packages/client_build_tool/lib/schemas/giveDefaultValue.js +18 -0
- package/packages/client_build_tool/lib/schemas/npmConfigToObject.js +35 -0
- package/packages/client_build_tool/lib/schemas/readOptions.js +54 -0
- package/packages/client_build_tool/lib/schemas/readOptionsForConfigFile.js +42 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/Map.test.js +15 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/MathAndNumberMethod.test.js +30 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/ObjectAndModules.test.js +47 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/Sets.test.js +18 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/Symbol.test.js +25 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/arrowFunction.test.js +34 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/block-scoping.test.js +18 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/classes.test.js +55 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/defaultParameterValues.test.js +18 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/extraFeatures.test.js +82 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/forOf.test.js +20 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/promise.test.js +22 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/spreadOperator.test.js +20 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/spreadParams.test.js +24 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/stringAndArrayMethods.test.js +67 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/variables.test.js +21 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2016/array-includes.test.js +13 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2016/exponentationOperator.test.js +20 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2017/asyncAndawait.test.js +23 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2017/object-entries.test.js +24 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2017/object-getOwnproperties.test.js +24 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2017/object-values.test.js +24 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2017/stringMethods.test.js +20 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2018/asynchronous-iterator.test.js +19 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2018/object-rest-spread.test.js +24 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2018/promise-finally.test.js +26 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2018/regularExpressions.test.js +35 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2019/Json.stringify.test.js +21 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2019/arrayMethods.test.js +31 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2019/object-fromEntriesMethod.test.js +13 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2019/optionalCatchBinding.test.js +23 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2019/revisedFunctionToString.test.js +17 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2019/trim-startAndend-method.test.js +20 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2020/AssignmentOperator.test.js +27 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2020/Dynamic-Import.test.js +19 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2020/NullishOperator.test.js +15 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2020/bigInt.test.js +13 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2020/chainOperator.test.js +17 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2020/export-namespace-from.test.js +12 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2020/promiseAllSettledMathod.test.js +17 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2020/stringMatchMethod.test.js +13 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2021/NumericSeparator.test.js +23 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2021/logicalOperatorAssignments.test.js +25 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2021/promiseAny.test.js +16 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2021/stringReplaceMethod.test.js +16 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2022/Array-atMethod.test.js +13 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2022/ObjectKeyCheck.test.js +27 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2022/ObjecthasOwnMethod.test.js +19 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2022/RegexMatchIndices.test.js +20 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2022/String-atMethod.test.js +15 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2022/error.Cause.test.js +23 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2022/keysCheckinPrivateFields.test.js +27 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2022/privateMethodsAndFields.test.js +23 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2022/staticFieldsAndMethod.test.js +54 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2022/topLevelAwait.test.js +11 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/es2022/weakRef.test.js +17 -0
- package/packages/client_build_tool/lib/shared/babel/__test__/utilities.js +28 -0
- package/packages/client_build_tool/lib/shared/babel/addDefaultPlugins.js +15 -0
- package/packages/client_build_tool/lib/shared/babel/babelWebConfig.js +54 -0
- package/packages/client_build_tool/lib/shared/babel/babel_plugins/removeAttributesPlugin.js +23 -0
- package/packages/client_build_tool/lib/shared/babel/getBabelPlugin.js +37 -0
- package/packages/client_build_tool/lib/shared/babel/runBabelForJSFile.js +24 -0
- package/packages/client_build_tool/lib/shared/babel/runBabelForTsFile.js +30 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/common/decidePublicPath.js +52 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/common/libAlias.js +31 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/common/modeUtils.js +39 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/common/nameTemplates.js +101 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/common/resourceBasedPublicPath.js +21 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/configCustomLoaders.js +10 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/cssLoaders.js +16 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/BundleIntegrityReport/index.js +83 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/CdnChangePlugin/index.js +119 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/CdnChangePlugin/webpackCustomJsUrlLoader.js +46 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/EFCTemplatePlugin.js +112 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/ContributionGuide.md +11 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nFilesEmitPlugin.js +174 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nKeysIdentifer.js +76 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nRuntimeDealerPlugin.js +223 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nSplit.md +95 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/LocaleChunkAssetsStore.js +73 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/ModulesI18nKeysStore.js +88 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/README.md +25 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/constants.js +29 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/createHash.js +24 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nLoadingRuntimeModule.js +76 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/index.js +39 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/iterateModulesInChunk.js +50 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/optionsHandler.js +68 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/pathCreator.js +23 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/readI18nValues.js +29 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateFileName.js +43 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateHashHelpers.js +77 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/classesAndObject.test.js +56 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/conditionalOperation.test.js +154 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/function.test.js +89 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/function2.test.js +71 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/loop.test.js +112 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/minifyBooleanValues.test.js +43 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/minimizeVariableNames.test.js +45 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/promise.test.js +53 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/removeCommentsAndEmptySpace.test.js +13 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/removeUnusedStrings.test.js +14 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/variableDeclaration.test.js +30 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/collectI18nKeys.js +66 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/getChunkModules.js +13 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/hashUtils.js +19 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/index.js +31 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/propertiesUtils.js +129 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/InitialHtmlPlugin.js +56 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/__test__/addFilesNamesToManifestJson.test.js +51 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/__test__/createInitialEntries.test.js +95 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/__test__/removeHashFromFileName.test.js +91 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/addFilesNamesToManifestJson.js +24 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/createInitialEntries.js +17 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/createManifestJson.js +35 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/findInitialFileNames.js +18 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/index.js +46 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/removeHashFromFileName.js +18 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RTLSplitPlugin.js +1 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ResourceHintsPlugin.js +192 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +62 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtlCssPlugin.js +84 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtrSplit.md +34 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/replaceCssDirTemplate.js +27 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RuntimeResourceCleanup/index.js +73 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/classHandling.js +20 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/index.js +78 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/selectorWeightPrefixAdder.js +51 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/windowsModification.js +16 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ServiceWorkerPlugin.js +110 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/SourceMapPlugin/index.js +68 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/TPHashMappingPlugin/addHashToFilePath.js +22 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/TPHashMappingPlugin/index.js +55 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin/__test__/uglifyCss1.test.js +74 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin/__test__/uglifycss.test.js +64 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin/__test__/utilities.js +28 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin/index.js.js +49 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/VariableConversionCollector/ErrorHandler.js +62 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/VariableConversionCollector/index.js +362 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/custom_attribute_plugin/index.js +80 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/emitAsset.js +14 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/getInitialAssetsFuncTemplate.js +57 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/getInitialI18nAssetsArrayStr.js +87 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/classesAndObject.test.js +56 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/conditionalOperation.test.js +154 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/function.test.js +89 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/function2.test.js +71 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/loop.test.js +112 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/minifyBooleanValues.test.js +43 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/minimizeVariableNames.test.js +45 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/promise.test.js +53 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/removeCommentsAndEmptySpace.test.js +13 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/removeUnusedStrings.test.js +14 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/variableDeclaration.test.js +30 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/defaultVendorPatternList.js +13 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/devtoolConfig.js +13 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/entryConfig.js +28 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/externals.js +17 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/getCSSLoaders.js +29 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/getFilenameFromModule.js +24 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/jsLoaders.js +17 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/assetLoaders.js +12 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/babelLoaderConfig.js +18 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/checkIsPatternsMatchFilename.js +56 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configHtmlTemplateLoader.js +18 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configPostCssLoader.js +37 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configWebWorkerLoader.js +21 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configsAssetsLoaders.js +86 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/cssClassNameGenerate.js +60 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/getCssLoaderOptions.js +21 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaders/miniCssFallBackLoader.js +7 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaders/workerLoader.js +133 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/optimizationConfig.js +43 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/outputConfig.js +38 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configBundleAnalyzer.js +40 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configBundleIntegrityReport.js +36 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCSSMinifierPlugin.js +24 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCdnChangePlugin.js +27 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCopyPublicFolders.js +63 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCustomAttributesPlugin.js +20 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configEFCTemplatePlugin.js +46 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configEnvVariables.js +51 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configHtmlWebpackPlugin.js +56 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configI18nSplitPlugin.js +41 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configIgnorePlugin.js +16 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configManifestJsonPlugin.js +32 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configMiniCSSExtractPlugin.js +23 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configProgressPlugin.js +24 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configResourceHintsPlugin.js +21 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configRtlCssPlugin.js +27 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configRuntimeResourceCleanup.js +31 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configSelectorWeightPlugin.js +28 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configServiceWorkerPlugin.js +40 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configSourceMapPlugin.js +20 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configTPHashMappingPlugin.js +32 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configVariableConversionPlugin.js +25 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/plugins.js +56 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/resolvers.js +82 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/splitChunksConfig.js +116 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/statsConfig.js +30 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/tsLoaders.js +17 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/utils/__test__/getArrayWithDefaultWithCustomEqual.test.js +54 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/utils/__test__/updateArrayWithDefault.test.js +47 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/utils/index.js +26 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/utils/object-manipulation.js +87 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/utils/updateArrayWithDefault.js +34 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/webpackBuild.js +27 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/webpackConfig.js +58 -0
- package/packages/client_build_tool/lib/shared/commands-utils/doBasicRequirementCheck.js +17 -0
- package/packages/client_build_tool/lib/shared/commands-utils/getCliPath.js +39 -0
- package/packages/client_build_tool/lib/shared/commands-utils/index.js +29 -0
- package/packages/client_build_tool/lib/shared/commands-utils/log.js +13 -0
- package/packages/client_build_tool/lib/shared/commands-utils/readArgsFormCommandLine.js +11 -0
- package/packages/client_build_tool/lib/shared/commands-utils/readOptionFormCommandLine.js +11 -0
- package/packages/client_build_tool/lib/shared/commands-utils/spawnSyncIO.js +38 -0
- package/packages/client_build_tool/lib/shared/constants.js +48 -0
- package/packages/client_build_tool/lib/shared/fileUtils/copyFile.js +38 -0
- package/packages/client_build_tool/lib/shared/fileUtils/directoryIterator.js +21 -0
- package/packages/client_build_tool/lib/shared/fileUtils/watchRun.js +112 -0
- package/packages/client_build_tool/lib/shared/postcss/__test__/ignoreTestCases.test.js +80 -0
- package/packages/client_build_tool/lib/shared/postcss/__test__/postcss-rtl-all-cases.test.js +119 -0
- package/packages/client_build_tool/lib/shared/postcss/__test__/postcssRtl.spec.js +34 -0
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/EmptyPlugin.js +21 -0
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/constants.js +10 -0
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/handleIgnores.js +66 -0
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/index.js +136 -0
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/insertBefore.js +32 -0
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/isPreviouslyProcessed.js +20 -0
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/replaceUtils.js +20 -0
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/separateHoveredSelectorAndNormalSelector.js +24 -0
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/specialCases.js +43 -0
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/typeCheckUtils.js +52 -0
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/RTLSplitPlugin.js +139 -0
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/SelectorReplace.js +90 -0
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/ValueReplacer.js +57 -0
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/VariableModificationPlugin/index.js +343 -0
- package/packages/client_build_tool/lib/shared/postcss/filterPluginsAllowedForSpecficFile.js +55 -0
- package/packages/client_build_tool/lib/shared/postcss/getAllowedPostCssPlugins.js +30 -0
- package/packages/client_build_tool/lib/shared/postcss/getSpecificPostCssPlugin.js +58 -0
- package/packages/client_build_tool/lib/shared/postcss/runPostCssForCssFile.js +37 -0
- package/packages/client_build_tool/lib/shared/pre_process/runPreProcess.js +58 -0
- package/packages/client_build_tool/lib/shared/server/configWebpackDevMiddleware.js +41 -0
- package/packages/client_build_tool/lib/shared/server/corsHandling.js +30 -0
- package/packages/client_build_tool/lib/shared/server/getIp.js +30 -0
- package/packages/client_build_tool/lib/shared/server/getServerURL.js +29 -0
- package/packages/client_build_tool/lib/shared/server/httpsOptions.js +46 -0
- package/packages/client_build_tool/lib/shared/server/initExpressApp.js +19 -0
- package/packages/client_build_tool/lib/shared/server/initialHTMLHandling.js +99 -0
- package/packages/client_build_tool/lib/shared/server/mockApiHandler.js +60 -0
- package/packages/client_build_tool/lib/shared/server/mockServer.js +41 -0
- package/packages/client_build_tool/lib/shared/server/serveContextFiles.js +27 -0
- package/packages/client_build_tool/lib/shared/server/serverBywebpackDevMiddleware.js +35 -0
- package/packages/client_build_tool/lib/shared/server/startHttpServer.js +26 -0
- package/packages/client_build_tool/lib/shared/server/startHttpsServer.js +38 -0
- package/packages/client_build_tool/lib/shared/server/unwanted/addHttp2Server.js +41 -0
- package/packages/client_build_tool/lib/shared/server/unwanted/configWebpackDevMiddleware.js +44 -0
- package/packages/client_build_tool/lib/shared/server/unwanted/mockApiSupport.js +19 -0
- package/packages/client_build_tool/lib/shared/server/unwanted/websocketMockSetup.js +48 -0
- package/packages/client_build_tool/lib/shared/server/urlConcat.js +32 -0
- package/packages/client_build_tool/lib/shared/utils/requireLocalOrGlobal.js +81 -0
- package/packages/client_build_tool/lib/shared/utils/utils.js +1 -0
- package/packages/client_build_tool/lib/shared/utils/versionPrint.js +20 -0
- package/packages/client_build_tool/node_modules/history/CHANGES.md +395 -0
- package/packages/client_build_tool/node_modules/history/DOMUtils.js +3 -0
- package/packages/client_build_tool/node_modules/history/ExecutionEnvironment.js +3 -0
- package/packages/client_build_tool/node_modules/history/LICENSE +21 -0
- package/packages/client_build_tool/node_modules/history/LocationUtils.js +3 -0
- package/packages/client_build_tool/node_modules/history/PathUtils.js +3 -0
- package/packages/client_build_tool/node_modules/history/README.md +282 -0
- package/packages/client_build_tool/node_modules/history/cjs/history.js +933 -0
- package/packages/client_build_tool/node_modules/history/cjs/history.min.js +1 -0
- package/packages/client_build_tool/node_modules/history/createBrowserHistory.js +3 -0
- package/packages/client_build_tool/node_modules/history/createHashHistory.js +3 -0
- package/packages/client_build_tool/node_modules/history/createMemoryHistory.js +3 -0
- package/packages/client_build_tool/node_modules/history/createTransitionManager.js +3 -0
- package/packages/client_build_tool/node_modules/history/es/DOMUtils.js +7 -0
- package/packages/client_build_tool/node_modules/history/es/ExecutionEnvironment.js +7 -0
- package/packages/client_build_tool/node_modules/history/es/LocationUtils.js +7 -0
- package/packages/client_build_tool/node_modules/history/es/PathUtils.js +7 -0
- package/packages/client_build_tool/node_modules/history/es/createBrowserHistory.js +7 -0
- package/packages/client_build_tool/node_modules/history/es/createHashHistory.js +7 -0
- package/packages/client_build_tool/node_modules/history/es/createMemoryHistory.js +7 -0
- package/packages/client_build_tool/node_modules/history/es/createTransitionManager.js +7 -0
- package/packages/client_build_tool/node_modules/history/es/warnAboutDeprecatedESMImport.js +35 -0
- package/packages/client_build_tool/node_modules/history/esm/history.js +904 -0
- package/packages/client_build_tool/node_modules/history/index.js +7 -0
- package/packages/client_build_tool/node_modules/history/package.json +120 -0
- package/packages/client_build_tool/node_modules/history/umd/history.js +1059 -0
- package/packages/client_build_tool/node_modules/history/umd/history.min.js +1 -0
- package/packages/client_build_tool/node_modules/history/warnAboutDeprecatedCJSRequire.js +35 -0
- package/templates/docs/highlight.js/lib/common.d.ts +3 -0
- package/templates/docs/highlight.js/lib/common.js +42 -0
- package/templates/docs/highlight.js/lib/core.d.ts +3 -0
- package/templates/docs/highlight.js/lib/core.js +2600 -0
- package/templates/docs/highlight.js/lib/index.js +198 -0
- package/templates/docs/highlight.js/lib/languages/1c.js +537 -0
- package/templates/docs/highlight.js/lib/languages/1c.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/abnf.js +82 -0
- package/templates/docs/highlight.js/lib/languages/abnf.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/accesslog.js +92 -0
- package/templates/docs/highlight.js/lib/languages/accesslog.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/actionscript.js +153 -0
- package/templates/docs/highlight.js/lib/languages/actionscript.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/ada.js +265 -0
- package/templates/docs/highlight.js/lib/languages/ada.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/angelscript.js +178 -0
- package/templates/docs/highlight.js/lib/languages/angelscript.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/apache.js +101 -0
- package/templates/docs/highlight.js/lib/languages/apache.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/applescript.js +149 -0
- package/templates/docs/highlight.js/lib/languages/applescript.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/arcade.js +361 -0
- package/templates/docs/highlight.js/lib/languages/arcade.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/arduino.js +969 -0
- package/templates/docs/highlight.js/lib/languages/arduino.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/armasm.js +120 -0
- package/templates/docs/highlight.js/lib/languages/armasm.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/asciidoc.js +261 -0
- package/templates/docs/highlight.js/lib/languages/asciidoc.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/aspectj.js +230 -0
- package/templates/docs/highlight.js/lib/languages/aspectj.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/autohotkey.js +75 -0
- package/templates/docs/highlight.js/lib/languages/autohotkey.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/autoit.js +178 -0
- package/templates/docs/highlight.js/lib/languages/autoit.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/avrasm.js +78 -0
- package/templates/docs/highlight.js/lib/languages/avrasm.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/awk.js +67 -0
- package/templates/docs/highlight.js/lib/languages/awk.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/axapta.js +188 -0
- package/templates/docs/highlight.js/lib/languages/axapta.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/bash.js +389 -0
- package/templates/docs/highlight.js/lib/languages/bash.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/basic.js +229 -0
- package/templates/docs/highlight.js/lib/languages/basic.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/bnf.js +38 -0
- package/templates/docs/highlight.js/lib/languages/bnf.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/brainfuck.js +54 -0
- package/templates/docs/highlight.js/lib/languages/brainfuck.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/c.js +318 -0
- package/templates/docs/highlight.js/lib/languages/c.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/cal.js +159 -0
- package/templates/docs/highlight.js/lib/languages/cal.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/capnproto.js +99 -0
- package/templates/docs/highlight.js/lib/languages/capnproto.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/ceylon.js +139 -0
- package/templates/docs/highlight.js/lib/languages/ceylon.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/clean.js +67 -0
- package/templates/docs/highlight.js/lib/languages/clean.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/clojure-repl.js +27 -0
- package/templates/docs/highlight.js/lib/languages/clojure-repl.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/clojure.js +184 -0
- package/templates/docs/highlight.js/lib/languages/clojure.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/cmake.js +63 -0
- package/templates/docs/highlight.js/lib/languages/cmake.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/coffeescript.js +365 -0
- package/templates/docs/highlight.js/lib/languages/coffeescript.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/coq.js +445 -0
- package/templates/docs/highlight.js/lib/languages/coq.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/cos.js +140 -0
- package/templates/docs/highlight.js/lib/languages/cos.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/cpp.js +568 -0
- package/templates/docs/highlight.js/lib/languages/cpp.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/crmsh.js +100 -0
- package/templates/docs/highlight.js/lib/languages/crmsh.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/crystal.js +311 -0
- package/templates/docs/highlight.js/lib/languages/crystal.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/csharp.js +400 -0
- package/templates/docs/highlight.js/lib/languages/csharp.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/csp.js +57 -0
- package/templates/docs/highlight.js/lib/languages/csp.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/css.js +737 -0
- package/templates/docs/highlight.js/lib/languages/css.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/d.js +271 -0
- package/templates/docs/highlight.js/lib/languages/d.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/dart.js +262 -0
- package/templates/docs/highlight.js/lib/languages/dart.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/delphi.js +230 -0
- package/templates/docs/highlight.js/lib/languages/delphi.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/diff.js +62 -0
- package/templates/docs/highlight.js/lib/languages/diff.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/django.js +75 -0
- package/templates/docs/highlight.js/lib/languages/django.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/dns.js +78 -0
- package/templates/docs/highlight.js/lib/languages/dns.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/dockerfile.js +44 -0
- package/templates/docs/highlight.js/lib/languages/dockerfile.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/dos.js +166 -0
- package/templates/docs/highlight.js/lib/languages/dos.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/dsconfig.js +66 -0
- package/templates/docs/highlight.js/lib/languages/dsconfig.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/dts.js +157 -0
- package/templates/docs/highlight.js/lib/languages/dts.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/dust.js +47 -0
- package/templates/docs/highlight.js/lib/languages/dust.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/ebnf.js +53 -0
- package/templates/docs/highlight.js/lib/languages/ebnf.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/elixir.js +279 -0
- package/templates/docs/highlight.js/lib/languages/elixir.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/elm.js +143 -0
- package/templates/docs/highlight.js/lib/languages/elm.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/erb.js +29 -0
- package/templates/docs/highlight.js/lib/languages/erb.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/erlang-repl.js +54 -0
- package/templates/docs/highlight.js/lib/languages/erlang-repl.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/erlang.js +191 -0
- package/templates/docs/highlight.js/lib/languages/erlang.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/excel.js +544 -0
- package/templates/docs/highlight.js/lib/languages/excel.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/fix.js +39 -0
- package/templates/docs/highlight.js/lib/languages/fix.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/flix.js +79 -0
- package/templates/docs/highlight.js/lib/languages/flix.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/fortran.js +573 -0
- package/templates/docs/highlight.js/lib/languages/fortran.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/fsharp.js +626 -0
- package/templates/docs/highlight.js/lib/languages/fsharp.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/gams.js +181 -0
- package/templates/docs/highlight.js/lib/languages/gams.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/gauss.js +306 -0
- package/templates/docs/highlight.js/lib/languages/gauss.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/gcode.js +80 -0
- package/templates/docs/highlight.js/lib/languages/gcode.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/gherkin.js +49 -0
- package/templates/docs/highlight.js/lib/languages/gherkin.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/glsl.js +128 -0
- package/templates/docs/highlight.js/lib/languages/glsl.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/gml.js +2816 -0
- package/templates/docs/highlight.js/lib/languages/gml.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/go.js +141 -0
- package/templates/docs/highlight.js/lib/languages/go.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/golo.js +80 -0
- package/templates/docs/highlight.js/lib/languages/golo.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/gradle.js +189 -0
- package/templates/docs/highlight.js/lib/languages/gradle.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/graphql.js +78 -0
- package/templates/docs/highlight.js/lib/languages/graphql.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/groovy.js +188 -0
- package/templates/docs/highlight.js/lib/languages/groovy.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/haml.js +113 -0
- package/templates/docs/highlight.js/lib/languages/haml.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/handlebars.js +258 -0
- package/templates/docs/highlight.js/lib/languages/handlebars.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/haskell.js +203 -0
- package/templates/docs/highlight.js/lib/languages/haskell.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/haxe.js +153 -0
- package/templates/docs/highlight.js/lib/languages/haxe.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/hsp.js +59 -0
- package/templates/docs/highlight.js/lib/languages/hsp.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/http.js +97 -0
- package/templates/docs/highlight.js/lib/languages/http.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/hy.js +137 -0
- package/templates/docs/highlight.js/lib/languages/hy.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/inform7.js +69 -0
- package/templates/docs/highlight.js/lib/languages/inform7.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/ini.js +121 -0
- package/templates/docs/highlight.js/lib/languages/ini.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/irpf90.js +107 -0
- package/templates/docs/highlight.js/lib/languages/irpf90.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/isbl.js +3205 -0
- package/templates/docs/highlight.js/lib/languages/isbl.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/java.js +288 -0
- package/templates/docs/highlight.js/lib/languages/java.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/javascript.js +765 -0
- package/templates/docs/highlight.js/lib/languages/javascript.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/jboss-cli.js +63 -0
- package/templates/docs/highlight.js/lib/languages/jboss-cli.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/json.js +53 -0
- package/templates/docs/highlight.js/lib/languages/json.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/julia-repl.js +50 -0
- package/templates/docs/highlight.js/lib/languages/julia-repl.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/julia.js +441 -0
- package/templates/docs/highlight.js/lib/languages/julia.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/kotlin.js +285 -0
- package/templates/docs/highlight.js/lib/languages/kotlin.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/lasso.js +170 -0
- package/templates/docs/highlight.js/lib/languages/lasso.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/latex.js +278 -0
- package/templates/docs/highlight.js/lib/languages/latex.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/ldif.js +31 -0
- package/templates/docs/highlight.js/lib/languages/ldif.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/leaf.js +49 -0
- package/templates/docs/highlight.js/lib/languages/leaf.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/less.js +838 -0
- package/templates/docs/highlight.js/lib/languages/less.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/lisp.js +139 -0
- package/templates/docs/highlight.js/lib/languages/lisp.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/livecodeserver.js +173 -0
- package/templates/docs/highlight.js/lib/languages/livecodeserver.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/livescript.js +377 -0
- package/templates/docs/highlight.js/lib/languages/livescript.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/llvm.js +132 -0
- package/templates/docs/highlight.js/lib/languages/llvm.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/lsl.js +76 -0
- package/templates/docs/highlight.js/lib/languages/lsl.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/lua.js +80 -0
- package/templates/docs/highlight.js/lib/languages/lua.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/makefile.js +86 -0
- package/templates/docs/highlight.js/lib/languages/makefile.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/markdown.js +241 -0
- package/templates/docs/highlight.js/lib/languages/markdown.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/mathematica.js +7358 -0
- package/templates/docs/highlight.js/lib/languages/mathematica.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/matlab.js +107 -0
- package/templates/docs/highlight.js/lib/languages/matlab.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/maxima.js +414 -0
- package/templates/docs/highlight.js/lib/languages/maxima.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/mel.js +235 -0
- package/templates/docs/highlight.js/lib/languages/mel.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/mercury.js +107 -0
- package/templates/docs/highlight.js/lib/languages/mercury.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/mipsasm.js +104 -0
- package/templates/docs/highlight.js/lib/languages/mipsasm.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/mizar.js +27 -0
- package/templates/docs/highlight.js/lib/languages/mizar.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/mojolicious.js +36 -0
- package/templates/docs/highlight.js/lib/languages/mojolicious.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/monkey.js +183 -0
- package/templates/docs/highlight.js/lib/languages/monkey.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/moonscript.js +141 -0
- package/templates/docs/highlight.js/lib/languages/moonscript.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/n1ql.js +364 -0
- package/templates/docs/highlight.js/lib/languages/n1ql.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/nestedtext.js +83 -0
- package/templates/docs/highlight.js/lib/languages/nestedtext.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/nginx.js +153 -0
- package/templates/docs/highlight.js/lib/languages/nginx.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/nim.js +185 -0
- package/templates/docs/highlight.js/lib/languages/nim.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/nix.js +94 -0
- package/templates/docs/highlight.js/lib/languages/nix.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/node-repl.js +33 -0
- package/templates/docs/highlight.js/lib/languages/node-repl.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/nsis.js +554 -0
- package/templates/docs/highlight.js/lib/languages/nsis.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/objectivec.js +253 -0
- package/templates/docs/highlight.js/lib/languages/objectivec.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/ocaml.js +83 -0
- package/templates/docs/highlight.js/lib/languages/ocaml.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/openscad.js +77 -0
- package/templates/docs/highlight.js/lib/languages/openscad.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/oxygene.js +86 -0
- package/templates/docs/highlight.js/lib/languages/oxygene.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/parser3.js +55 -0
- package/templates/docs/highlight.js/lib/languages/parser3.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/perl.js +471 -0
- package/templates/docs/highlight.js/lib/languages/perl.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/pf.js +60 -0
- package/templates/docs/highlight.js/lib/languages/pf.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/pgsql.js +524 -0
- package/templates/docs/highlight.js/lib/languages/pgsql.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/php-template.js +54 -0
- package/templates/docs/highlight.js/lib/languages/php-template.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/php.js +613 -0
- package/templates/docs/highlight.js/lib/languages/php.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/plaintext.js +19 -0
- package/templates/docs/highlight.js/lib/languages/plaintext.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/pony.js +89 -0
- package/templates/docs/highlight.js/lib/languages/pony.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/powershell.js +316 -0
- package/templates/docs/highlight.js/lib/languages/powershell.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/processing.js +434 -0
- package/templates/docs/highlight.js/lib/languages/processing.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/profile.js +43 -0
- package/templates/docs/highlight.js/lib/languages/profile.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/prolog.js +96 -0
- package/templates/docs/highlight.js/lib/languages/prolog.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/properties.js +68 -0
- package/templates/docs/highlight.js/lib/languages/properties.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/protobuf.js +79 -0
- package/templates/docs/highlight.js/lib/languages/protobuf.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/puppet.js +146 -0
- package/templates/docs/highlight.js/lib/languages/puppet.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/purebasic.js +99 -0
- package/templates/docs/highlight.js/lib/languages/purebasic.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/python-repl.js +32 -0
- package/templates/docs/highlight.js/lib/languages/python-repl.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/python.js +434 -0
- package/templates/docs/highlight.js/lib/languages/python.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/q.js +37 -0
- package/templates/docs/highlight.js/lib/languages/q.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/qml.js +189 -0
- package/templates/docs/highlight.js/lib/languages/qml.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/r.js +257 -0
- package/templates/docs/highlight.js/lib/languages/r.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/reasonml.js +308 -0
- package/templates/docs/highlight.js/lib/languages/reasonml.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/rib.js +37 -0
- package/templates/docs/highlight.js/lib/languages/rib.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/roboconf.js +82 -0
- package/templates/docs/highlight.js/lib/languages/roboconf.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/routeros.js +163 -0
- package/templates/docs/highlight.js/lib/languages/routeros.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/rsl.js +149 -0
- package/templates/docs/highlight.js/lib/languages/rsl.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/ruby.js +448 -0
- package/templates/docs/highlight.js/lib/languages/ruby.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/ruleslanguage.js +76 -0
- package/templates/docs/highlight.js/lib/languages/ruleslanguage.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/rust.js +304 -0
- package/templates/docs/highlight.js/lib/languages/rust.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/sas.js +556 -0
- package/templates/docs/highlight.js/lib/languages/sas.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/scala.js +177 -0
- package/templates/docs/highlight.js/lib/languages/scala.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/scheme.js +196 -0
- package/templates/docs/highlight.js/lib/languages/scheme.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/scilab.js +73 -0
- package/templates/docs/highlight.js/lib/languages/scilab.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/scss.js +727 -0
- package/templates/docs/highlight.js/lib/languages/scss.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/shell.js +33 -0
- package/templates/docs/highlight.js/lib/languages/shell.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/smali.js +125 -0
- package/templates/docs/highlight.js/lib/languages/smali.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/smalltalk.js +68 -0
- package/templates/docs/highlight.js/lib/languages/smalltalk.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/sml.js +75 -0
- package/templates/docs/highlight.js/lib/languages/sml.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/sqf.js +2662 -0
- package/templates/docs/highlight.js/lib/languages/sqf.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/sql.js +682 -0
- package/templates/docs/highlight.js/lib/languages/sql.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/stan.js +493 -0
- package/templates/docs/highlight.js/lib/languages/stan.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/stata.js +53 -0
- package/templates/docs/highlight.js/lib/languages/stata.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/step21.js +66 -0
- package/templates/docs/highlight.js/lib/languages/step21.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/stylus.js +787 -0
- package/templates/docs/highlight.js/lib/languages/stylus.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/subunit.js +43 -0
- package/templates/docs/highlight.js/lib/languages/subunit.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/swift.js +860 -0
- package/templates/docs/highlight.js/lib/languages/swift.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/taggerscript.js +58 -0
- package/templates/docs/highlight.js/lib/languages/taggerscript.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/tap.js +47 -0
- package/templates/docs/highlight.js/lib/languages/tap.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/tcl.js +190 -0
- package/templates/docs/highlight.js/lib/languages/tcl.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/thrift.js +77 -0
- package/templates/docs/highlight.js/lib/languages/thrift.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/tp.js +171 -0
- package/templates/docs/highlight.js/lib/languages/tp.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/twig.js +260 -0
- package/templates/docs/highlight.js/lib/languages/twig.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/typescript.js +878 -0
- package/templates/docs/highlight.js/lib/languages/typescript.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/vala.js +60 -0
- package/templates/docs/highlight.js/lib/languages/vala.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/vbnet.js +157 -0
- package/templates/docs/highlight.js/lib/languages/vbnet.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/vbscript-html.js +24 -0
- package/templates/docs/highlight.js/lib/languages/vbscript-html.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/vbscript.js +220 -0
- package/templates/docs/highlight.js/lib/languages/vbscript.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/verilog.js +549 -0
- package/templates/docs/highlight.js/lib/languages/verilog.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/vhdl.js +215 -0
- package/templates/docs/highlight.js/lib/languages/vhdl.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/vim.js +129 -0
- package/templates/docs/highlight.js/lib/languages/vim.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/wasm.js +139 -0
- package/templates/docs/highlight.js/lib/languages/wasm.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/wren.js +302 -0
- package/templates/docs/highlight.js/lib/languages/wren.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/x86asm.js +153 -0
- package/templates/docs/highlight.js/lib/languages/x86asm.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/xl.js +205 -0
- package/templates/docs/highlight.js/lib/languages/xl.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/xml.js +241 -0
- package/templates/docs/highlight.js/lib/languages/xml.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/xquery.js +359 -0
- package/templates/docs/highlight.js/lib/languages/xquery.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/yaml.js +194 -0
- package/templates/docs/highlight.js/lib/languages/yaml.js.js +10 -0
- package/templates/docs/highlight.js/lib/languages/zephir.js +128 -0
- package/templates/docs/highlight.js/lib/languages/zephir.js.js +10 -0
@@ -0,0 +1,48 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.cliRootPath = exports.cliNodeModulesPath = exports.babelrcPath = exports.appPath = exports.appNodeModules = exports.CONFIG_ROOT = exports.BASE_CONFIG_KEY = void 0;
|
7
|
+
exports.getTemplatePath = getTemplatePath;
|
8
|
+
exports.joinWithAppPath = joinWithAppPath;
|
9
|
+
exports.templatesPath = void 0;
|
10
|
+
|
11
|
+
var _path = _interopRequireWildcard(require("path"));
|
12
|
+
|
13
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
14
|
+
|
15
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
16
|
+
|
17
|
+
const BASE_CONFIG_KEY = 'react-cli';
|
18
|
+
exports.BASE_CONFIG_KEY = BASE_CONFIG_KEY;
|
19
|
+
|
20
|
+
const cliRootPath = _path.default.resolve(__dirname, '..', '..');
|
21
|
+
|
22
|
+
exports.cliRootPath = cliRootPath;
|
23
|
+
const CONFIG_ROOT = 'client-build-config';
|
24
|
+
exports.CONFIG_ROOT = CONFIG_ROOT;
|
25
|
+
|
26
|
+
const cliNodeModulesPath = _path.default.resolve(cliRootPath, 'node_modules');
|
27
|
+
|
28
|
+
exports.cliNodeModulesPath = cliNodeModulesPath;
|
29
|
+
const babelrcPath = (0, _path.join)(cliRootPath, '.babelrc');
|
30
|
+
exports.babelrcPath = babelrcPath;
|
31
|
+
const appPath = process.cwd();
|
32
|
+
exports.appPath = appPath;
|
33
|
+
|
34
|
+
function joinWithAppPath(filePath) {
|
35
|
+
// TODO: test in windows
|
36
|
+
return (0, _path.join)(appPath, filePath);
|
37
|
+
}
|
38
|
+
|
39
|
+
;
|
40
|
+
const appNodeModules = joinWithAppPath('node_modules');
|
41
|
+
exports.appNodeModules = appNodeModules;
|
42
|
+
const templatesPath = (0, _path.join)(__dirname, '..', '..', 'templates');
|
43
|
+
exports.templatesPath = templatesPath;
|
44
|
+
|
45
|
+
function getTemplatePath(...filePath) {
|
46
|
+
// TODO: test in windows
|
47
|
+
return (0, _path.join)(templatesPath, ...filePath);
|
48
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.copyFile = copyFile;
|
7
|
+
exports.createParentDir = createParentDir;
|
8
|
+
exports.writeFile = writeFile;
|
9
|
+
|
10
|
+
var _fs = require("fs");
|
11
|
+
|
12
|
+
var _path = _interopRequireDefault(require("path"));
|
13
|
+
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
|
+
|
16
|
+
function createParentDir(filename) {
|
17
|
+
const {
|
18
|
+
dir
|
19
|
+
} = _path.default.parse(filename);
|
20
|
+
|
21
|
+
if (!(0, _fs.existsSync)(dir)) {
|
22
|
+
(0, _fs.mkdirSync)(dir, {
|
23
|
+
recursive: true
|
24
|
+
});
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
function copyFile(filename, outputFile) {
|
29
|
+
createParentDir(outputFile);
|
30
|
+
const readStream = (0, _fs.createReadStream)(filename);
|
31
|
+
const writeStream = (0, _fs.createWriteStream)(outputFile);
|
32
|
+
return readStream.pipe(writeStream);
|
33
|
+
}
|
34
|
+
|
35
|
+
function writeFile(filename, data) {
|
36
|
+
createParentDir(filename);
|
37
|
+
return (0, _fs.writeFileSync)(filename, data);
|
38
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.directoryIterator = directoryIterator;
|
7
|
+
|
8
|
+
var _fs = require("fs");
|
9
|
+
|
10
|
+
var _path = require("path");
|
11
|
+
|
12
|
+
function directoryIterator(filename, callback) {
|
13
|
+
if (!(0, _fs.statSync)(filename).isDirectory()) {
|
14
|
+
callback(filename);
|
15
|
+
return;
|
16
|
+
}
|
17
|
+
|
18
|
+
(0, _fs.readdirSync)(filename).forEach(fileOrDir => {
|
19
|
+
directoryIterator((0, _path.join)(filename, fileOrDir), callback);
|
20
|
+
});
|
21
|
+
}
|
@@ -0,0 +1,112 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.watchRun = watchRun;
|
7
|
+
|
8
|
+
var _path = _interopRequireDefault(require("path"));
|
9
|
+
|
10
|
+
var _watcher = _interopRequireDefault(require("watcher"));
|
11
|
+
|
12
|
+
var _runBabelForJSFile = require("../babel/runBabelForJSFile");
|
13
|
+
|
14
|
+
var _runBabelForTsFile = require("../babel/runBabelForTsFile");
|
15
|
+
|
16
|
+
var _runPostCssForCssFile = require("../postcss/runPostCssForCssFile");
|
17
|
+
|
18
|
+
var _directoryIterator = require("./directoryIterator");
|
19
|
+
|
20
|
+
var _copyFile = require("./copyFile");
|
21
|
+
|
22
|
+
var _logger = require("../../logger");
|
23
|
+
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
25
|
+
|
26
|
+
const isJs = ext => ext === '.js';
|
27
|
+
|
28
|
+
const isTs = ext => ext === '.ts' || ext === '.tsx';
|
29
|
+
|
30
|
+
const isCss = ext => ext === '.css';
|
31
|
+
|
32
|
+
function watchRun({
|
33
|
+
options,
|
34
|
+
src,
|
35
|
+
target,
|
36
|
+
canWatch,
|
37
|
+
mode
|
38
|
+
}) {
|
39
|
+
let updatedFileCount = 0;
|
40
|
+
|
41
|
+
function doWorkForSeparateFile(filename) {
|
42
|
+
const outputFile = filename.replace(src, target);
|
43
|
+
|
44
|
+
const {
|
45
|
+
ext
|
46
|
+
} = _path.default.parse(filename);
|
47
|
+
|
48
|
+
if (isJs(ext)) {
|
49
|
+
(0, _runBabelForJSFile.runBabelForJSFile)({
|
50
|
+
filename,
|
51
|
+
outputFile,
|
52
|
+
options,
|
53
|
+
mode
|
54
|
+
});
|
55
|
+
} else if (isCss(ext)) {
|
56
|
+
(0, _runPostCssForCssFile.runPostCssForCssFile)({
|
57
|
+
filename,
|
58
|
+
outputFile,
|
59
|
+
options
|
60
|
+
});
|
61
|
+
} else if (isTs(ext)) {
|
62
|
+
(0, _runBabelForTsFile.runBabelForTSFile)({
|
63
|
+
filename,
|
64
|
+
outputFile,
|
65
|
+
options,
|
66
|
+
mode
|
67
|
+
});
|
68
|
+
} else {
|
69
|
+
(0, _copyFile.copyFile)(filename, outputFile);
|
70
|
+
}
|
71
|
+
|
72
|
+
updatedFileCount++;
|
73
|
+
}
|
74
|
+
|
75
|
+
function doWork(foldername) {
|
76
|
+
updatedFileCount = 0;
|
77
|
+
const startTime = Date.now();
|
78
|
+
(0, _directoryIterator.directoryIterator)(foldername, filename => {
|
79
|
+
try {
|
80
|
+
doWorkForSeparateFile(filename);
|
81
|
+
} catch (error) {
|
82
|
+
(0, _logger.messageLogger)(`ERROR In: ${filename}`);
|
83
|
+
(0, _logger.messageLogger)(error);
|
84
|
+
}
|
85
|
+
});
|
86
|
+
(0, _logger.messageLogger)(`Successfully compiled ${updatedFileCount} files with Babel and Post-CSS (${Date.now() - startTime}ms).`);
|
87
|
+
}
|
88
|
+
|
89
|
+
doWork(src);
|
90
|
+
|
91
|
+
if (canWatch) {
|
92
|
+
const watcher = new _watcher.default(src, {
|
93
|
+
recursive: true,
|
94
|
+
ignoreInitial: true,
|
95
|
+
ignore: filename => filename.indexOf('__tests__') !== -1 // remove the test cases
|
96
|
+
|
97
|
+
});
|
98
|
+
watcher.on('all', (event, filename) => {
|
99
|
+
if (event === 'unlink' || event === 'unlinkDir') {
|
100
|
+
return;
|
101
|
+
}
|
102
|
+
|
103
|
+
doWork(filename); // This is what the library does internally when you pass it a handler directly
|
104
|
+
// arguments [0] (event); // => could be any target event: 'add', 'addDir', 'change', 'rename', 'renameDir', 'unlink' or 'unlinkDir'
|
105
|
+
// arguments [1] (filename); // => the file system path where the event took place, this is always provided
|
106
|
+
// arguments [2] (targetPathNext); // => the file system path "targetPath" got renamed to, this is only provided on 'rename'/'renameDir' events
|
107
|
+
});
|
108
|
+
watcher.on('error', error => {
|
109
|
+
(0, _logger.messageLogger)(error); // => true, "Error" instances are always provided on "error"
|
110
|
+
});
|
111
|
+
}
|
112
|
+
}
|
@@ -0,0 +1,80 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
/* eslint-disable max-lines */
|
4
|
+
const ignore = require('ignore');
|
5
|
+
|
6
|
+
function checkIsPatternsMatchFilename(patterns, filename) {
|
7
|
+
return patterns.length ? ignore({
|
8
|
+
allowRelativePaths: true
|
9
|
+
}).add(patterns).ignores(filename) : true;
|
10
|
+
}
|
11
|
+
|
12
|
+
const testCases = [{
|
13
|
+
name: 'css selector',
|
14
|
+
patterns: ['common.*', 'layout.*'],
|
15
|
+
passtests: ['../../../client_build_tool/packages/client_build_tool/node_modules/react/common.css', '../../../client_build_tool/packages/client_build_tool/react/common.css', '../../../client_build_tool/packages/client_build_tool/node_modules/react/common/common.css', '../../../client_build_tool/packages/client_build_tool/node_modules/react/common/li/layout.css', '../../../client_build_tool/packages/client_build_tool/node_modules/react/common/li/common.css', '../../../client_build_tool/packages/client_build_tool/node_modules/react/layout.css', '../../../client_build_tool/packages/client_build_tool/react/layout.css', '../../../client_build_tool/packages/client_build_tool/node_modules/react/layout/layout.css', '../../../client_build_tool/packages/client_build_tool/node_modules/react/layout/li/common.css', '../../../client_build_tool/packages/client_build_tool/node_modules/react/layout/li/layout.css'],
|
16
|
+
falltests: ['../../../client_build_tool/packages/client_build_tool/node_modules/react/common/locall.css', '../../../client_build_tool/packages/client_build_tool/node_modules/react/layout/locall.css', '../../../client_build_tool/packages/client_build_tool/node_modules/react/common/sdsd/locall.css', '../../../client_build_tool/packages/client_build_tool/node_modules/react/layout/sdfsdf/locall.css', '../../../client_build_tool/packages/client_build_tool/node_modules/react/klaklk.css']
|
17
|
+
}, {
|
18
|
+
name: 'react.vendor',
|
19
|
+
patterns: ['**/node_modules/react/', '**/node_modules/react-dom/'],
|
20
|
+
passtests: ['../../../client_build_tool/packages/client_build_tool/node_modules/react/index.js', '../../../client_build_tool/packages/client_build_tool/node_modules/react/index.js', '../../../client_build_tool/packages/client_build_tool/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js', '../../../client_build_tool/packages/client_build_tool/node_modules/react-dom/index.js'],
|
21
|
+
falltests: []
|
22
|
+
}, {
|
23
|
+
name: 'vendor',
|
24
|
+
patterns: ['node_modules', '!**/node_modules/react/', '!**/node_modules/react-dom/', '!*.css', '!**/publicPathConfig.js'],
|
25
|
+
passtests: []
|
26
|
+
}, {
|
27
|
+
name: 'src',
|
28
|
+
patterns: ['**/src/**/*.css'],
|
29
|
+
passtests: ['/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/index.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/One.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/As.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/A.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/AppearanceBox.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/components/IconContent/IconContent.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/components/Icon/Icon.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/components/Header/Header.css'],
|
30
|
+
falltests: ['/Users/zohodesk-test/work/weirdo-components/examples/src/virtualizer/index.js', '/Users/zohodesk-test/work/client_build_tool/packages/client_build_tool/node_modules/scheduler/index.js', '/Users/zohodesk-test/work/client_build_tool/packages/client_build_tool/node_modules/scheduler/tracing.js', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/index.js', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/AppearanceBox.js', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/index.js', '/Users/zohodesk-test/work/weirdo-components/examples/src/virtualizer/index.js', '/Users/zohodesk-test/work/client_build_tool/packages/client_build_tool/node_modules/prop-types/index.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Container.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Box.js', './Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Container.js', './Users/zohodesk-test/work/weirdo-components/examples/node_modules/react-router-dom/esm/react-router-dom.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Box.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Container.module.cs', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Container.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Sub/Box.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Sub/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Sub/Container.module.cs', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Sub/Container.js'],
|
31
|
+
// '.*@zohodesk\\/(icons)(?!.*\\/Appearance\\/).*\\.css$',
|
32
|
+
size: 1
|
33
|
+
}, {
|
34
|
+
name: 'icons',
|
35
|
+
patterns: ['**/src/**/*.css', '**/@zohodesk/icons/**/*.css', '!**/@zohodesk/icons/**/Appearance/**'],
|
36
|
+
passtests: ['/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Container.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/index.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/One.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/As.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/A.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/AppearanceBox.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/components/IconContent/IconContent.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/components/Icon/Icon.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/components/Header/Header.css'],
|
37
|
+
falltests: ['/Users/zohodesk-test/work/weirdo-components/examples/src/virtualizer/index.js', '/Users/zohodesk-test/work/client_build_tool/packages/client_build_tool/node_modules/scheduler/index.js', '/Users/zohodesk-test/work/client_build_tool/packages/client_build_tool/node_modules/scheduler/tracing.js', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/index.js', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/index.js', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/AppearanceBox.js', '/Users/zohodesk-test/work/weirdo-components/examples/src/virtualizer/index.js', '/Users/zohodesk-test/work/client_build_tool/packages/client_build_tool/node_modules/prop-types/index.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Box.js', './Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Container.js', './Users/zohodesk-test/work/weirdo-components/examples/node_modules/react-router-dom/esm/react-router-dom.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Box.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Container.module.cs', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Container.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Sub/Box.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Sub/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Sub/Container.module.cs', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Sub/Container.js'],
|
38
|
+
// '.*@zohodesk\\/(icons)(?!.*\\/Appearance\\/).*\\.css$',
|
39
|
+
size: 1
|
40
|
+
}, {
|
41
|
+
name: 'components|variables',
|
42
|
+
patterns: ['**/@zohodesk/components/**/*.css', '**/@zohodesk/variables/**/*.css', '!**/@zohodesk/components/**/Appearance/**', '!**/@zohodesk/variables/**/Appearance/**'],
|
43
|
+
passtests: ['/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/components/lib/components/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/components/lib/components/Container.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/components/es/components/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/components/es/components/Container.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/variables/lib/components/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/variables/lib/components/Container.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/variables/es/components/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/variables/es/components/Container.module.css'],
|
44
|
+
falltests: ['/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/components/lib/components/Appearance/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/components/lib/components/Appearance/Container.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/components/es/components/Appearance/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/components/es/components/Appearance/Container.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/variables/lib/components/Appearance/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/variables/lib/components/Appearance/Container.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/variables/es/components/Appearance/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/variables/es/components/Appearance/Container.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/virtualizer/index.js', '/Users/zohodesk-test/work/client_build_tool/packages/client_build_tool/node_modules/scheduler/index.js', '/Users/zohodesk-test/work/client_build_tool/packages/client_build_tool/node_modules/scheduler/tracing.js', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/index.js', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/index.js', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/index.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/One.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/As.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/A.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/AppearanceBox.js', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/AppearanceBox.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/virtualizer/index.js', '/Users/zohodesk-test/work/client_build_tool/packages/client_build_tool/node_modules/prop-types/index.js', '/Users/zohodesk-test/work/weirdo-components/examples/src/components/IconContent/IconContent.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/components/Icon/Icon.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/components/Header/Header.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Box.js', './Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Container.js', './Users/zohodesk-test/work/weirdo-components/examples/node_modules/react-router-dom/esm/react-router-dom.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Box.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Container.module.cs', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Container.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Sub/Box.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Sub/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Sub/Container.module.cs', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Sub/Container.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/components/lib/components/Box.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/components/lib/components/Container.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/components/lib/components/Box.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/variables/lib/components/Container.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Box.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/variables/lib/components/Container.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/variables/lib/components/Box.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Container.js'],
|
45
|
+
// '.*@zohodesk\\/(icons)(?!.*\\/Appearance\\/).*\\.css$',
|
46
|
+
size: 1
|
47
|
+
}, {
|
48
|
+
name: 'styles',
|
49
|
+
patterns: ['*.css', '!**/@zohodesk/components/**/*.css', '!**/@zohodesk/variables/**/*.css', '!**/@zohodesk/icons/**/*.css'],
|
50
|
+
passtests: ['/Users/zohodesk-test/work/weirdo-components/examples/src/components/IconContent/IconContent.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/components/Icon/Icon.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/components/Header/Header.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/index.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/One.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/As.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/A.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/AppearanceBox.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/svg/lib/components/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/svg/lib/components/Container.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/svg/es/components/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/svg/es/components/Container.module.css'],
|
51
|
+
falltests: ['/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/components/lib/components/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/components/lib/components/Container.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/components/es/components/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/components/es/components/Container.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/variables/lib/components/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/variables/lib/components/Container.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/variables/es/components/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/variables/es/components/Container.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/components/lib/components/Appearance/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/components/lib/components/Appearance/Container.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/components/es/components/Appearance/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/components/es/components/Appearance/Container.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/variables/lib/components/Appearance/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/variables/lib/components/Appearance/Container.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/variables/es/components/Appearance/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/variables/es/components/Appearance/Container.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/src/virtualizer/index.js', '/Users/zohodesk-test/work/client_build_tool/packages/client_build_tool/node_modules/scheduler/index.js', '/Users/zohodesk-test/work/client_build_tool/packages/client_build_tool/node_modules/scheduler/tracing.js', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/index.js', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/index.js', '/Users/zohodesk-test/work/weirdo-components/examples/src/Appearance/Header/SubHeader/AppearanceBox.js', '/Users/zohodesk-test/work/weirdo-components/examples/src/virtualizer/index.js', '/Users/zohodesk-test/work/client_build_tool/packages/client_build_tool/node_modules/prop-types/index.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Box.js', './Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Container.js', './Users/zohodesk-test/work/weirdo-components/examples/node_modules/react-router-dom/esm/react-router-dom.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Box.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Container.module.cs', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Container.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Sub/Box.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Sub/Box.module.css', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Sub/Container.module.cs', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Appearance/Sub/Container.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/components/lib/components/Box.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/components/lib/components/Container.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/components/lib/components/Box.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/variables/lib/components/Container.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Box.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/variables/lib/components/Container.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/variables/lib/components/Box.js', '/Users/zohodesk-test/work/weirdo-components/examples/node_modules/@zohodesk/icons/lib/components/Container.js'],
|
52
|
+
// '.*@zohodesk\\/(icons)(?!.*\\/Appearance\\/).*\\.css$',
|
53
|
+
size: 1
|
54
|
+
}];
|
55
|
+
|
56
|
+
function runTest(testSuite = testCases[0]) {
|
57
|
+
describe(`test suite for '${testSuite.name}' patterns:${JSON.stringify(testSuite.patterns)}`, () => {
|
58
|
+
const {
|
59
|
+
patterns,
|
60
|
+
passtests = [],
|
61
|
+
falltests = []
|
62
|
+
} = testSuite;
|
63
|
+
it('passtests', () => {
|
64
|
+
passtests.forEach(fileName => {
|
65
|
+
const ans = checkIsPatternsMatchFilename(patterns, fileName); // we had made it as array for debug purpose
|
66
|
+
|
67
|
+
expect([fileName, ans]).toStrictEqual([fileName, true]);
|
68
|
+
});
|
69
|
+
});
|
70
|
+
it('falltests', () => {
|
71
|
+
falltests.forEach(fileName => {
|
72
|
+
const ans = checkIsPatternsMatchFilename(patterns, fileName); // we had made it as array for debug purpose
|
73
|
+
|
74
|
+
expect([fileName, ans]).toStrictEqual([fileName, false]);
|
75
|
+
});
|
76
|
+
});
|
77
|
+
});
|
78
|
+
}
|
79
|
+
|
80
|
+
testCases.forEach(runTest); // runTest(testCases[0]);
|
@@ -0,0 +1,119 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _postcss = _interopRequireDefault(require("postcss"));
|
4
|
+
|
5
|
+
var _getSpecificPostCssPlugin = require("../getSpecificPostCssPlugin");
|
6
|
+
|
7
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8
|
+
|
9
|
+
/* eslint-disable max-lines */
|
10
|
+
|
11
|
+
/* eslint-disable no-use-before-define */
|
12
|
+
// import { checkIsPatternsMatchFilename } from '../filterPluginsAllowedForSpecficFile';
|
13
|
+
const normalize = cssString => cssString.replace(/} /g, '}');
|
14
|
+
/* fix extra space added by `postcss-import` */
|
15
|
+
|
16
|
+
|
17
|
+
const run = (expect, input, output, opts) => // opts && console.log(opts);
|
18
|
+
(0, _postcss.default)([(0, _getSpecificPostCssPlugin.configPostCssRtl)(opts)]).process(input, {
|
19
|
+
from: undefined
|
20
|
+
}).then(result => {
|
21
|
+
expect(normalize(result.css)).toEqual(normalize(output));
|
22
|
+
expect(result.warnings().length).toEqual(0);
|
23
|
+
});
|
24
|
+
|
25
|
+
test('Should NOT add [dir] prefix to symmetric rules', () => run(expect, 'a { font-size: 1em }', 'a { font-size: 1em }'));
|
26
|
+
test('Should ONLY create LTR & RTL rules to asymmetric rules', () => run(expect, 'a { font-size: 1em; text-align: left }', 'a { font-size: 1em }' + '[dir=ltr] a { text-align: left }' + '[dir=rtl] a { text-align: right }'));
|
27
|
+
xtest('Should add [dir] prefix to symmetric rules with direction related declarations', () => run(expect, 'a { text-align: center }', '[dir] a { text-align: center }'));
|
28
|
+
xtest('Should add [dir] prefix to symmetric rules with direction related declarations (2)', () => run(expect, 'a { font-size: 1em; text-align: center }', 'a { font-size: 1em }[dir] a { text-align: center }'));
|
29
|
+
xtest('Should add [dir] prefix to symmetric rules with direction related declarations (3)', () => run(expect, 'a { text-align: left }a { text-align: center }', '[dir=ltr] a { text-align: left }' + '[dir=rtl] a { text-align: right }' + '[dir] a { text-align: center }'));
|
30
|
+
xtest('Should add [dir] prefix to symmetric rules with direction related declarations (4)', () => run(expect, 'a { margin: 0 10px 0 0 }a { margin-top: 20px }', '[dir=ltr] a { margin: 0 10px 0 0 }' + '[dir=rtl] a { margin: 0 0 0 10px }' + '[dir] a { margin-top: 20px }'));
|
31
|
+
test('Creates both LTR & RTL rules for asymmetric declarations', () => run(expect, 'a { text-align: left }', '[dir=ltr] a { text-align: left }[dir=rtl] a { text-align: right }'));
|
32
|
+
test('Removes original rule without symmetric declarations', () => run(expect, 'a { text-align: left }', '[dir=ltr] a { text-align: left }[dir=rtl] a { text-align: right }'));
|
33
|
+
xtest('Adds prefix to the html element', () => run(expect, 'html { text-align: left }', 'html[dir=ltr] { text-align: left }html[dir=rtl] { text-align: right }'));
|
34
|
+
xtest('Adds prefix to the html element with class', () => run(expect, 'html.foo { text-align: left }', 'html[dir=ltr].foo { text-align: left }' + 'html[dir=rtl].foo { text-align: right }'));
|
35
|
+
test('Adds prefix to the :root element', () => run(expect, ':root { text-align: left }', '[dir=ltr]:root { text-align: left }' + '[dir=rtl]:root { text-align: right }'));
|
36
|
+
xtest('Adds prefix to the :root element with class', () => run(expect, ':root.foo { text-align: left }', '[dir=ltr]:root.foo { text-align: left }' + '[dir=rtl]:root.foo { text-align: right }'));
|
37
|
+
xtest('Use custom `addPrefixToSelector` function', () => run(expect, 'a { text-align: left }', '[dir=ltr] > a { text-align: left }' + '[dir=rtl] > a { text-align: right }', {
|
38
|
+
addPrefixToSelector(selector, prefix) {
|
39
|
+
return `${prefix} > ${selector}`;
|
40
|
+
}
|
41
|
+
|
42
|
+
}));
|
43
|
+
test('Should correctly process values containing commas', () => run(expect, // eslint-disable-next-line no-useless-concat
|
44
|
+
'div { background: url(\'ht' + 'tp://placecage.com/400/400\') 0 0 }', // eslint-disable-next-line no-useless-concat
|
45
|
+
'[dir=ltr] div { background: url(\'ht' + 'tp://placecage.com/400/400\') 0 0 }' + // eslint-disable-next-line no-useless-concat
|
46
|
+
'[dir=rtl] div { background: url(\'ht' + 'tp://placecage.com/400/400\') 100% 0 }'));
|
47
|
+
test('Should correctly process values containing !important', () => run(expect, '.test { margin-left: 0 !important; padding-left: 0 !important }', '[dir=ltr] .test { margin-left: 0 !important; padding-left: 0 !important }' + '[dir=rtl] .test { margin-right: 0 !important; padding-right: 0 !important }'));
|
48
|
+
test('Shouldn not create unnecessary duplications with !important', () => run(expect, '.test { display: none !important }', '.test { display: none !important }'));
|
49
|
+
test('Should correctly process values containing _display', () => run(expect, '.test { float: left; _display: inline }', '.test { _display: inline }' + '[dir=ltr] .test { float: left }' + '[dir=rtl] .test { float: right }'));
|
50
|
+
test('Should ignore declarations prefixed with /* rtl:ignore */', () => run(expect, '/* rtl:ignore */ .test { margin-left:0; padding-left:0 }', '.test { margin-left:0; padding-left:0 }'));
|
51
|
+
test('/* rtl:ignore */: Should leave other selectors alone', () => run(expect, '/* rtl:ignore */ .test { margin-left:0 } ' + '.rtled { margin-left:0; padding-left:0 }', '.test { margin-left:0 } ' + '[dir=ltr] .rtled { margin-left:0; padding-left:0 } ' + '[dir=rtl] .rtled { margin-right:0; padding-right:0 }'));
|
52
|
+
test('/* rtl:ignore */: should understand overrides', () => run(expect, '.x { left: 0 } /* rtl:ignore */.x { direction: ltr }', '[dir=ltr] .x { left: 0 }' + '[dir=rtl] .x { right: 0 }' + '.x { direction: ltr }'));
|
53
|
+
test('/* rtl:begin:ignore */ starts ignore mode', () => run(expect, '/* rtl:begin:ignore */' + '.foo { padding-left: 0 }' + '.bar { direction: ltr }', '.foo { padding-left: 0 }.bar { direction: ltr }'));
|
54
|
+
test('/* rtl:end:ignore */ stops ignore mode', () => run(expect, '/* rtl:begin:ignore */' + '.foo { padding-left: 0 }' + '/* rtl:end:ignore */' + '.bar { direction: ltr }', '.foo { padding-left: 0 }' + '[dir=ltr] .bar { direction: ltr }' + '[dir=rtl] .bar { direction: rtl }'));
|
55
|
+
test('/* rtl:ignore */ can be used inside /* rtl:begin:ignore */ and /* rtl:end:ignore */', () => run(expect, '/* rtl:begin:ignore */' + '.foo { padding-left: 0 }' + '/* rtl:ignore */' + '.bar { direction: ltr }' + '.baz { left: 0 }' + '/* rtl:end:ignore */', '.foo { padding-left: 0 }.bar { direction: ltr }.baz { left: 0 }'));
|
56
|
+
test('that it ignores normal comments', () => run(expect, '/* some comment */ .foo { padding-left: 0 }', '/* some comment */ [dir=ltr] .foo { padding-left: 0 } [dir=rtl] .foo { padding-right: 0 }'));
|
57
|
+
test('Value based ignore comments are honored', () => run(expect, '.foo { margin-left: 12px; padding-left: 12px /* rtl:ignore */; }', '.foo { padding-left: 12px /* rtl:ignore */; }' + '[dir=ltr] .foo { margin-left: 12px; }' + '[dir=rtl] .foo { margin-right: 12px; }'));
|
58
|
+
test('/*! rtl:ignore */ should consider as a valid directive', () => run(expect, '/*! rtl:ignore */ .test { margin-left:0; padding-left:0 }', '.test { margin-left:0; padding-left:0 }'));
|
59
|
+
test('/*! rtl:begin:ignore */ and /*! rtl:end:ignore */ should consider as a valid directive', () => run(expect, '/*! rtl:begin:ignore */' + '.foo { padding-left: 0 }' + '/*! rtl:end:ignore */' + '.bar { direction: ltr }', '.foo { padding-left: 0 }' + '[dir=ltr] .bar { direction: ltr }' + '[dir=rtl] .bar { direction: rtl }'));
|
60
|
+
test('Should add direction to flippable keyframes-animations', () => run(expect, '@keyframes bar { 100% { transform: rotate(360deg); } }', '@keyframes bar-ltr { 100% { transform: rotate(360deg); } }' + '@keyframes bar-rtl { 100% { transform: rotate(-360deg); } }'));
|
61
|
+
test('Should handle multiple keyframes-animations', () => run(expect, '.loader {animation: load6 1.7s infinite ease, spinner 1.7s infinite ease;}' + '@keyframes load6 { 100% { transform: rotate(1deg) } }' + '@keyframes spinner { 100% { transform: rotate(-1deg) } }', '[dir=ltr] .loader {animation: load6-ltr 1.7s infinite ease, spinner-ltr 1.7s infinite ease;}' + '[dir=rtl] .loader {animation: load6-rtl 1.7s infinite ease, spinner-rtl 1.7s infinite ease;}' + '@keyframes load6-ltr { 100% { transform: rotate(1deg) } }' + '@keyframes load6-rtl { 100% { transform: rotate(-1deg) } }' + '@keyframes spinner-ltr { 100% { transform: rotate(-1deg) } }' + '@keyframes spinner-rtl { 100% { transform: rotate(1deg) } }'));
|
62
|
+
test('Should ignore keyframes-animation prefixed with /* rtl:ignore */', () => run(expect, '/* rtl:ignore */ @keyframes bar { 100% { transform: rotate(360deg); } }', '@keyframes bar { 100% { transform: rotate(360deg); } }'));
|
63
|
+
test('/* rtl:begin:ignore */ starts ignore mode for both keyframes and rules', () => run(expect, '/* rtl:begin:ignore */ @keyframes bar { 100% { transform: rotate(360deg); } } .foo { left: 5px }', '@keyframes bar { 100% { transform: rotate(360deg); } } .foo { left: 5px }'));
|
64
|
+
test('/* rtl:end:ignore */ stops ignore mode for keyframes', () => run(expect, '/* rtl:begin:ignore */ @keyframes bar { 100% { transform: rotate(360deg); } } /* rtl:end:ignore */' + '.foo { left: 5px }', '@keyframes bar { 100% { transform: rotate(360deg); } }' + '[dir=ltr] .foo { left: 5px }' + '[dir=rtl] .foo { right: 5px }'));
|
65
|
+
test('Should create only LTR version', () => run(expect, 'a { font-size: 1em; text-align: left }' + '@keyframes bar { 100% { transform: rotate(360deg); } }', 'a { font-size: 1em }' + '[dir=ltr] a { text-align: left }' + '@keyframes bar-ltr { 100% { transform: rotate(360deg); } }', {
|
66
|
+
onlyDirection: 'ltr'
|
67
|
+
}));
|
68
|
+
test('Should create only RTL version', () => run(expect, 'a { font-size: 1em; text-align: left }' + '@keyframes bar { 100% { transform: rotate(360deg); } }', 'a { font-size: 1em }' + '[dir=rtl] a { text-align: right }' + '@keyframes bar-rtl { 100% { transform: rotate(-360deg); } }', {
|
69
|
+
onlyDirection: 'rtl'
|
70
|
+
}));
|
71
|
+
test('Value replacement directives are honored', () => run(expect, '.foo { font-weight: bold; flex-direction: row/* rtl:row-reverse */; }', '.foo { font-weight: bold; }[dir=ltr] .foo { flex-direction: row/* rtl:row-reverse */; }[dir=rtl] .foo { flex-direction: row-reverse; }'));
|
72
|
+
test('Value prepend directives are honored', () => run(expect, '.foo { font-weight: bold; font-family: "Droid Sans", "Helvetica Neue", Arial, sans-serif/*rtl:prepend:"Droid Arabic Kufi",*/; }', '.foo { font-weight: bold; }[dir=ltr] .foo { font-family: "Droid Sans", "Helvetica Neue", Arial, sans-serif/*rtl:prepend:"Droid Arabic Kufi",*/; }[dir=rtl] .foo { font-family: "Droid Arabic Kufi", "Droid Sans", "Helvetica Neue", Arial, sans-serif; }'));
|
73
|
+
test('Value append directives are honored', () => run(expect, '.foo { font-weight: bold; transform: rotate(45deg)/* rtl:append: scaleX(-1) */; }', '.foo { font-weight: bold; }[dir=ltr] .foo { transform: rotate(45deg)/* rtl:append: scaleX(-1) */; }[dir=rtl] .foo { transform: rotate(45deg) scaleX(-1); }'));
|
74
|
+
test('Value based ignore important comments are honored', () => run(expect, '.foo { margin-left: 12px; padding-left: 12px /*! rtl:ignore */; }', '.foo { padding-left: 12px /*! rtl:ignore */; }' + '[dir=ltr] .foo { margin-left: 12px; }' + '[dir=rtl] .foo { margin-right: 12px; }'));
|
75
|
+
test('Value replacement directives with important comments are honored', () => run(expect, '.foo { font-weight: bold; flex-direction: row/*! rtl:row-reverse */; }', '.foo { font-weight: bold; }[dir=ltr] .foo { flex-direction: row/*! rtl:row-reverse */; }[dir=rtl] .foo { flex-direction: row-reverse; }'));
|
76
|
+
test('Value prepend directives with important comments are honored', () => run(expect, '.foo { font-weight: bold; font-family: "Droid Sans", "Helvetica Neue", Arial, sans-serif/*!rtl:prepend:"Droid Arabic Kufi",*/; }', '.foo { font-weight: bold; }[dir=ltr] .foo { font-family: "Droid Sans", "Helvetica Neue", Arial, sans-serif/*!rtl:prepend:"Droid Arabic Kufi",*/; }[dir=rtl] .foo { font-family: "Droid Arabic Kufi", "Droid Sans", "Helvetica Neue", Arial, sans-serif; }'));
|
77
|
+
test('Value append directives with important comments are honored', () => run(expect, '.foo { font-weight: bold; transform: rotate(45deg)/*! rtl:append: scaleX(-1) */; }', '.foo { font-weight: bold; }[dir=ltr] .foo { transform: rotate(45deg)/*! rtl:append: scaleX(-1) */; }[dir=rtl] .foo { transform: rotate(45deg) scaleX(-1); }'));
|
78
|
+
test('Should keep comments', () => run(expect, '/* rtl:ignore */ a { text-align: left }', '/* rtl:ignore */ a { text-align: left }', {
|
79
|
+
removeComments: false
|
80
|
+
}));
|
81
|
+
test('Should respect custom prefix (attribute)', () => run(expect, 'a { text-align: left }', '[custom-dir-prefix=ltr] a { text-align: left }' + '[custom-dir-prefix=rtl] a { text-align: right }', {
|
82
|
+
prefix: 'custom-dir-prefix'
|
83
|
+
}));
|
84
|
+
test('Should respect custom prefix (class)', () => run(expect, 'a { text-align: left }', '.custom-dir-prefix-ltr a { text-align: left }' + '.custom-dir-prefix-rtl a { text-align: right }', {
|
85
|
+
prefix: 'custom-dir-prefix',
|
86
|
+
prefixType: 'class'
|
87
|
+
}));
|
88
|
+
test('Should not swap "left" and "right" subparts of selectors', () => run(expect, '.arrowLeft { margin-right: -3px }', '[dir=ltr] .arrowLeft { margin-right: -3px }' + '[dir=rtl] .arrowLeft { margin-left: -3px }'));
|
89
|
+
test('Should respect multiline values', () => run(expect, `.multiline {
|
90
|
+
background: rgba(0, 0, 0, 0, .5),
|
91
|
+
linear-gradient(to right, transparent, #000);
|
92
|
+
}`, `[dir=ltr] .multiline {
|
93
|
+
background: rgba(0, 0, 0, 0, .5),
|
94
|
+
linear-gradient(to right, transparent, #000);
|
95
|
+
}` + `[dir=rtl] .multiline {
|
96
|
+
background: rgba(0, 0, 0, 0, .5),
|
97
|
+
linear-gradient(to left, transparent, #000);
|
98
|
+
}`));
|
99
|
+
test('rtl:as: directive', () => run(expect, ':root { --padding /* rtl:as:padding */: 1px 2px 3px 4px }', '[dir=ltr]:root { --padding /* rtl:as:padding */: 1px 2px 3px 4px }' + '[dir=rtl]:root { --padding /* rtl:as:padding */: 1px 4px 3px 2px }'));
|
100
|
+
test('rtl aliases', () => run(expect, ':root { --padding: 1px 2px 3px 4px }', '[dir=ltr]:root { --padding: 1px 2px 3px 4px }' + '[dir=rtl]:root { --padding: 1px 4px 3px 2px }', {
|
101
|
+
aliases: {
|
102
|
+
'--padding': 'padding'
|
103
|
+
}
|
104
|
+
}));
|
105
|
+
test('should ignore blacklist properties', () => run(expect, '.test {padding-left: 1rem;padding: 1rem 2rem 3rem 4rem}', '.test {padding: 1rem 2rem 3rem 4rem}' + '[dir=ltr] .test {padding-left: 1rem}' + '[dir=rtl] .test {padding-right: 1rem}', {
|
106
|
+
blacklist: ['padding']
|
107
|
+
}));
|
108
|
+
test('should process whitelist properties only', () => run(expect, '.test {padding-left: 1rem;padding: 1rem 2rem 3rem 4rem}', '.test {padding-left: 1rem}' + '[dir=ltr] .test {padding: 1rem 2rem 3rem 4rem}' + '[dir=rtl] .test {padding: 1rem 4rem 3rem 2rem}', {
|
109
|
+
whitelist: ['padding']
|
110
|
+
}));
|
111
|
+
/* ignored test cases */
|
112
|
+
// it('should ignore ignored @import', () =>
|
113
|
+
// run(
|
114
|
+
// expect,
|
115
|
+
// '/* rtl:begin:ignore */' +
|
116
|
+
// `@import "${__dirname}/../test-import.css";` +
|
117
|
+
// '/* rtl:end:ignore */',
|
118
|
+
// '.test-import { padding-left: 1rem }'
|
119
|
+
// ));
|
@@ -0,0 +1,34 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _postcss = _interopRequireDefault(require("postcss"));
|
4
|
+
|
5
|
+
var _getSpecificPostCssPlugin = require("../getSpecificPostCssPlugin");
|
6
|
+
|
7
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8
|
+
|
9
|
+
/* eslint-disable no-use-before-define */
|
10
|
+
// import { checkIsPatternsMatchFilename } from '../filterPluginsAllowedForSpecficFile';
|
11
|
+
describe('postcss-rtl plugin basic requirement tests', () => {
|
12
|
+
it('is creating rtl css code for for margin-left', () => {
|
13
|
+
const cssInputStr = '.main{margin-left:20px}';
|
14
|
+
const cssOutputStr = '[dir=ltr] .main{margin-left:20px}[dir=rtl] .main{margin-right:20px}';
|
15
|
+
const result = runRTLPostCssPluginForCssString(cssInputStr);
|
16
|
+
expect(result.css).toEqual(cssOutputStr);
|
17
|
+
});
|
18
|
+
it('is creating rtl css code for for margin-right', cb => {
|
19
|
+
const cssInputStr = '.main{margin-right:20px}';
|
20
|
+
const cssOutputStr = '[dir=ltr] .main{margin-right:20px}[dir=rtl] .main{margin-left:20px}'; // console.log(postcss);
|
21
|
+
|
22
|
+
runRTLPostCssPluginForCssString(cssInputStr).then(res => {
|
23
|
+
expect(res.css).toEqual(cssOutputStr);
|
24
|
+
cb();
|
25
|
+
});
|
26
|
+
});
|
27
|
+
});
|
28
|
+
|
29
|
+
function runRTLPostCssPluginForCssString(cssInputStr) {
|
30
|
+
return (0, _postcss.default)([(0, _getSpecificPostCssPlugin.configPostCssRtl)()]).process(cssInputStr, {
|
31
|
+
from: '',
|
32
|
+
to: ''
|
33
|
+
});
|
34
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
// eslint-disable-next-line no-unused-vars
|
9
|
+
const EmptyPlugin = (opts = {}) => ({
|
10
|
+
postcssPlugin: 'postcss-empty',
|
11
|
+
|
12
|
+
// eslint-disable-next-line no-unused-vars
|
13
|
+
Once(root, {
|
14
|
+
result
|
15
|
+
}) {}
|
16
|
+
|
17
|
+
});
|
18
|
+
|
19
|
+
EmptyPlugin.postcss = true;
|
20
|
+
var _default = EmptyPlugin;
|
21
|
+
exports.default = _default;
|
@@ -0,0 +1,66 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.handleIgnores = handleIgnores;
|
7
|
+
|
8
|
+
var _typeCheckUtils = require("./typeCheckUtils");
|
9
|
+
|
10
|
+
const hoverIgnoreQuery = 'Hover:ignore';
|
11
|
+
const activeIgnoreQuery = 'Active:ignore';
|
12
|
+
const hoverActiveIgnoreQuery = 'HoverActive:ignore';
|
13
|
+
|
14
|
+
function handleIgnore() {
|
15
|
+
let isIgnored = false;
|
16
|
+
return {
|
17
|
+
isIgnored: () => isIgnored,
|
18
|
+
update: isGoingTobeIgnored => {
|
19
|
+
isIgnored = isGoingTobeIgnored;
|
20
|
+
},
|
21
|
+
reset: () => {
|
22
|
+
isIgnored = false;
|
23
|
+
}
|
24
|
+
};
|
25
|
+
} // eslint-disable-next-line no-unused-vars
|
26
|
+
|
27
|
+
|
28
|
+
function handleIgnores(options) {
|
29
|
+
const hoverHandler = handleIgnore();
|
30
|
+
const activeHandler = handleIgnore();
|
31
|
+
|
32
|
+
function generateReturnValue() {
|
33
|
+
return {
|
34
|
+
hoverIgnored: hoverHandler.isIgnored(),
|
35
|
+
activeIgnored: activeHandler.isIgnored()
|
36
|
+
};
|
37
|
+
}
|
38
|
+
|
39
|
+
const ignoreCommentMap = {
|
40
|
+
[hoverIgnoreQuery]: () => {
|
41
|
+
hoverHandler.update(true);
|
42
|
+
},
|
43
|
+
[activeIgnoreQuery]: () => {
|
44
|
+
activeHandler.update(true);
|
45
|
+
},
|
46
|
+
[hoverActiveIgnoreQuery]: () => {
|
47
|
+
hoverHandler.update(true);
|
48
|
+
activeHandler.update(true);
|
49
|
+
}
|
50
|
+
};
|
51
|
+
return node => {
|
52
|
+
if ((0, _typeCheckUtils.isComment)(node)) {
|
53
|
+
const commentText = node.text.trim();
|
54
|
+
ignoreCommentMap[commentText] && ignoreCommentMap[commentText](); // NOTE: we return here because this is just comment we can skip it.
|
55
|
+
|
56
|
+
return generateReturnValue();
|
57
|
+
} // NOTE: we get the here. But return after resetting for next. Because these comment Only works for once.
|
58
|
+
// Even If we support multiple line Skip we must do it in reset or separate method.
|
59
|
+
|
60
|
+
|
61
|
+
const returnValue = generateReturnValue();
|
62
|
+
hoverHandler.reset();
|
63
|
+
activeHandler.reset();
|
64
|
+
return returnValue;
|
65
|
+
};
|
66
|
+
}
|