@modern-js/tailwindcss-generator 3.5.0 → 3.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. package/dist/index.js +32 -31
  2. package/package.json +10 -10
  3. package/src/index.ts +1 -0
package/dist/index.js CHANGED
@@ -52689,12 +52689,12 @@ __export(src_exports, {
52689
52689
  module.exports = __toCommonJS(src_exports);
52690
52690
  var import_path7 = __toESM(require("path"));
52691
52691
 
52692
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
52692
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.4.2/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
52693
52693
  var import_path = __toESM(require("path"));
52694
52694
  var import_utils = require("@modern-js/utils");
52695
52695
  var FS_RESOURCE = "_codesmith_core_fs_resource";
52696
52696
 
52697
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith/dist/esm-node/utils/fsExists.js
52697
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.4.2/node_modules/@modern-js/codesmith/dist/esm-node/utils/fsExists.js
52698
52698
  var import_utils2 = require("@modern-js/utils");
52699
52699
  async function fsExists(path7) {
52700
52700
  try {
@@ -52705,13 +52705,13 @@ async function fsExists(path7) {
52705
52705
  }
52706
52706
  }
52707
52707
 
52708
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.4.1_@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/utils/renderString.js
52708
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.4.2_@modern-js+codesmith@2.4.2/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/utils/renderString.js
52709
52709
  var import_ejs = __toESM(require_ejs());
52710
52710
  function renderString(template, fullData) {
52711
52711
  return import_ejs.default.render(template, fullData) || "";
52712
52712
  }
52713
52713
 
52714
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.4.1_@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/index.js
52714
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.4.2_@modern-js+codesmith@2.4.2/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/index.js
52715
52715
  var EjsAPI = class {
52716
52716
  async renderTemplate(templateResource, target, parameters = {}) {
52717
52717
  if (templateResource._type !== FS_RESOURCE) {
@@ -52743,7 +52743,7 @@ var EjsAPI = class {
52743
52743
  }
52744
52744
  };
52745
52745
 
52746
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-fs@2.4.1_@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith-api-fs/dist/esm-node/index.js
52746
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-fs@2.4.2_@modern-js+codesmith@2.4.2/node_modules/@modern-js/codesmith-api-fs/dist/esm-node/index.js
52747
52747
  var import_path2 = __toESM(require("path"));
52748
52748
  var import_utils4 = require("@modern-js/utils");
52749
52749
  var FsAPI = class {
@@ -52770,7 +52770,7 @@ var FsAPI = class {
52770
52770
  }
52771
52771
  };
52772
52772
 
52773
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.4.1_@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith-api-git/dist/esm-node/utils/index.js
52773
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.4.2_@modern-js+codesmith@2.4.2/node_modules/@modern-js/codesmith-api-git/dist/esm-node/utils/index.js
52774
52774
  var import_utils5 = require("@modern-js/utils");
52775
52775
  async function canUseGit() {
52776
52776
  try {
@@ -52845,7 +52845,7 @@ async function gitCommit(cwd, commitMessage) {
52845
52845
  });
52846
52846
  }
52847
52847
 
52848
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.4.1_@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith-api-git/dist/esm-node/index.js
52848
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.4.2_@modern-js+codesmith@2.4.2/node_modules/@modern-js/codesmith-api-git/dist/esm-node/index.js
52849
52849
  var GitAPI = class {
52850
52850
  async isInGitRepo(cwd = this.generatorCore.outputPath) {
52851
52851
  const canUse = await canUseGit();
@@ -52895,7 +52895,7 @@ var GitAPI = class {
52895
52895
  }
52896
52896
  };
52897
52897
 
52898
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.4.1_@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/utils/renderString.js
52898
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.4.2_@modern-js+codesmith@2.4.2/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/utils/renderString.js
52899
52899
  var import_handlebars = __toESM(require_lib());
52900
52900
  function renderString2(template, fullData, registers) {
52901
52901
  const helpers = {
@@ -52909,7 +52909,7 @@ function renderString2(template, fullData, registers) {
52909
52909
  return import_handlebars.default.compile(template)(fullData) || "";
52910
52910
  }
52911
52911
 
52912
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.4.1_@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/index.js
52912
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.4.2_@modern-js+codesmith@2.4.2/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/index.js
52913
52913
  var HandlebarsAPI = class {
52914
52914
  async registerHelp(helpers) {
52915
52915
  this.registers.helpers = {
@@ -52957,7 +52957,7 @@ var HandlebarsAPI = class {
52957
52957
  }
52958
52958
  };
52959
52959
 
52960
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.1/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/env.js
52960
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.2/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/env.js
52961
52961
  var import_utils8 = require("@modern-js/utils");
52962
52962
  async function canUseNvm() {
52963
52963
  try {
@@ -53007,7 +53007,7 @@ async function canUsePnpm() {
53007
53007
  }
53008
53008
  }
53009
53009
 
53010
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.1/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/install.js
53010
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.2/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/install.js
53011
53011
  var import_utils9 = require("@modern-js/utils");
53012
53012
  function execaWithStreamLog(command, args, options) {
53013
53013
  const promise = (0, import_utils9.execa)(command, args, {
@@ -53103,7 +53103,7 @@ async function pnpmInstall({ cwd, registryUrl, ignoreScripts, useNvm }) {
53103
53103
  throw new Error("please install pnpm first");
53104
53104
  }
53105
53105
 
53106
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.1/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/index.js
53106
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.2/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/index.js
53107
53107
  var NpmAPI = class {
53108
53108
  npmInstall({ cwd, registryUrl, ignoreScripts }) {
53109
53109
  return npmInstall({
@@ -62687,10 +62687,10 @@ var Schema = (
62687
62687
  }()
62688
62688
  );
62689
62689
 
62690
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
62690
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.2_@modern-js+codesmith@2.4.2_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
62691
62691
  var import_inquirer = __toESM(require_inquirer());
62692
62692
 
62693
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/transform.js
62693
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.2_@modern-js+codesmith@2.4.2_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/transform.js
62694
62694
  var import_lodash = require("@modern-js/utils/lodash");
62695
62695
  function validateSchema(schema) {
62696
62696
  const { type, properties } = schema;
@@ -62782,7 +62782,7 @@ function transformForm(schema, configValue = {}, validateMap, initValue) {
62782
62782
  return getQuestionFromSchema(schema, configValue, validateMap, initValue);
62783
62783
  }
62784
62784
 
62785
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
62785
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.2_@modern-js+codesmith@2.4.2_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
62786
62786
  var compileRule = (rule, scope) => {
62787
62787
  const state = Schema.compile(rule, {
62788
62788
  $self: {},
@@ -62886,7 +62886,7 @@ async function prompt(schema, configValue = {}, validateMap, initValue) {
62886
62886
  return answers;
62887
62887
  }
62888
62888
 
62889
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/inquirer.js
62889
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.2_@modern-js+codesmith@2.4.2_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/inquirer.js
62890
62890
  var CLIReader = class {
62891
62891
  getAnswers() {
62892
62892
  return this.answers;
@@ -62915,7 +62915,7 @@ var CLIReader = class {
62915
62915
  }
62916
62916
  };
62917
62917
 
62918
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
62918
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.2_@modern-js+codesmith@2.4.2_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
62919
62919
  var import_utils13 = require("@modern-js/utils");
62920
62920
  var import_lodash5 = require("@modern-js/utils/lodash");
62921
62921
  var import_comment_json = __toESM(require_src2());
@@ -62984,7 +62984,7 @@ var I18n = class {
62984
62984
  }
62985
62985
  };
62986
62986
 
62987
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/en.js
62987
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.2_@modern-js+codesmith@2.4.2_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/en.js
62988
62988
  var EN_LOCALE = {
62989
62989
  environment: {
62990
62990
  node_version: "please upgrade node to lts version",
@@ -63011,7 +63011,7 @@ var EN_LOCALE = {
63011
63011
  }
63012
63012
  };
63013
63013
 
63014
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/zh.js
63014
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.2_@modern-js+codesmith@2.4.2_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/zh.js
63015
63015
  var ZH_LOCALE = {
63016
63016
  environment: {
63017
63017
  node_version: "请升级 Node 版本至 LIS",
@@ -63038,14 +63038,14 @@ var ZH_LOCALE = {
63038
63038
  }
63039
63039
  };
63040
63040
 
63041
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/index.js
63041
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.2_@modern-js+codesmith@2.4.2_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/index.js
63042
63042
  var i18n = new I18n();
63043
63043
  var localeKeys = i18n.init("zh", {
63044
63044
  zh: ZH_LOCALE,
63045
63045
  en: EN_LOCALE
63046
63046
  });
63047
63047
 
63048
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/checkUseNvm.js
63048
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.2_@modern-js+codesmith@2.4.2_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/checkUseNvm.js
63049
63049
  var import_path4 = __toESM(require("path"));
63050
63050
  var import_utils12 = require("@modern-js/utils");
63051
63051
  var NODE_MAJOR_VERSION_MAP = {
@@ -63093,7 +63093,7 @@ async function checkUseNvm(cwd, logger) {
63093
63093
  }
63094
63094
  }
63095
63095
 
63096
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/transform.js
63096
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.2_@modern-js+codesmith@2.4.2_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/transform.js
63097
63097
  var import_lodash4 = require("@modern-js/utils/lodash");
63098
63098
  function transformInquirerSchema(questions, configValue = {}, validateMap = {}, initValue = {}) {
63099
63099
  for (const question of questions) {
@@ -63121,7 +63121,7 @@ function transformInquirerSchema(questions, configValue = {}, validateMap = {},
63121
63121
  return questions;
63122
63122
  }
63123
63123
 
63124
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
63124
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.2_@modern-js+codesmith@2.4.2_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
63125
63125
  var AppAPI = class {
63126
63126
  async checkEnvironment(nodeVersion) {
63127
63127
  if (import_utils13.semver.lt(process.versions.node, nodeVersion || "12.22.12")) {
@@ -63353,11 +63353,11 @@ var AppAPI = class {
63353
63353
  }
63354
63354
  };
63355
63355
 
63356
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.4.1/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
63356
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.4.2/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
63357
63357
  var import_comment_json2 = __toESM(require_src2());
63358
63358
  var declarationUpdate = __toESM(require_dist());
63359
63359
 
63360
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.4.1/node_modules/@modern-js/codesmith-api-json/dist/esm-node/utils/index.js
63360
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.4.2/node_modules/@modern-js/codesmith-api-json/dist/esm-node/utils/index.js
63361
63361
  async function editJson(generatorCore, resource, getNewJsonValue) {
63362
63362
  const originJsonValue = await resource.value();
63363
63363
  const newJsonString = await getNewJsonValue(originJsonValue.content);
@@ -63370,7 +63370,7 @@ async function editJson(generatorCore, resource, getNewJsonValue) {
63370
63370
  return newJsonString;
63371
63371
  }
63372
63372
 
63373
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.4.1/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
63373
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.4.2/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
63374
63374
  var JsonAPI = class {
63375
63375
  async get(resource) {
63376
63376
  const originJsonValue = await resource.value();
@@ -63382,27 +63382,27 @@ var JsonAPI = class {
63382
63382
  throw new Error("resource content is not a legal json");
63383
63383
  }
63384
63384
  }
63385
- async extend(resource, obj) {
63385
+ async extend(resource, obj, endWithNewLine = false) {
63386
63386
  await editJson(this.generatorCore, resource, async () => {
63387
63387
  const originJsonValue = await resource.value();
63388
63388
  try {
63389
63389
  const origin = import_comment_json2.default.parse(originJsonValue.content);
63390
63390
  const newObj = import_comment_json2.default.assign(origin, obj);
63391
63391
  const jsonIntent = 2;
63392
- return import_comment_json2.default.stringify(newObj, void 0, jsonIntent);
63392
+ return import_comment_json2.default.stringify(newObj, void 0, jsonIntent) + (endWithNewLine ? "\n" : "");
63393
63393
  } catch (e) {
63394
63394
  this.generatorCore.logger.debug("[JSON API] parse json error:", e);
63395
63395
  throw new Error("resource content is not a legal json");
63396
63396
  }
63397
63397
  });
63398
63398
  }
63399
- async update(resource, operation) {
63399
+ async update(resource, operation, endWithNewLine = false) {
63400
63400
  await editJson(this.generatorCore, resource, (text) => {
63401
63401
  try {
63402
63402
  const jsonContent = import_comment_json2.default.parse(text);
63403
63403
  declarationUpdate.query(jsonContent, operation.query, operation.update);
63404
63404
  const jsonIntent = 2;
63405
- return Promise.resolve(import_comment_json2.default.stringify(jsonContent, void 0, jsonIntent));
63405
+ return Promise.resolve(import_comment_json2.default.stringify(jsonContent, void 0, jsonIntent) + (endWithNewLine ? "\n" : ""));
63406
63406
  } catch (e) {
63407
63407
  this.generatorCore.logger.debug("[JSON API] parse json error:", e);
63408
63408
  throw new Error("resource content is not a legal json");
@@ -63720,7 +63720,8 @@ var handleTemplateFile = async (context, generator, appApi) => {
63720
63720
  include: [...tsconfigJSON.include || [], "tailwind.config.ts"]
63721
63721
  }
63722
63722
  }
63723
- }
63723
+ },
63724
+ true
63724
63725
  );
63725
63726
  }
63726
63727
  } else {
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "3.5.0",
18
+ "version": "3.6.1",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "main": "./dist/index.js",
21
21
  "files": [
@@ -23,21 +23,21 @@
23
23
  "/dist/index.js"
24
24
  ],
25
25
  "dependencies": {
26
- "@modern-js/utils": "2.59.0"
26
+ "@modern-js/utils": "2.60.1"
27
27
  },
28
28
  "devDependencies": {
29
- "@modern-js/codesmith": "2.4.1",
30
- "@modern-js/codesmith-api-app": "2.4.1",
31
- "@modern-js/codesmith-api-json": "2.4.1",
29
+ "@modern-js/codesmith": "2.4.2",
30
+ "@modern-js/codesmith-api-app": "2.4.2",
31
+ "@modern-js/codesmith-api-json": "2.4.2",
32
32
  "@types/jest": "^29",
33
33
  "@types/node": "^14",
34
34
  "jest": "^29",
35
35
  "typescript": "^5",
36
- "@modern-js/dependence-generator": "3.5.0",
37
- "@modern-js/generator-utils": "3.5.0",
38
- "@modern-js/generator-common": "3.5.0",
39
- "@scripts/build": "2.59.0",
40
- "@scripts/jest-config": "2.59.0"
36
+ "@modern-js/dependence-generator": "3.6.1",
37
+ "@modern-js/generator-common": "3.6.1",
38
+ "@modern-js/generator-utils": "3.6.1",
39
+ "@scripts/build": "2.60.1",
40
+ "@scripts/jest-config": "2.60.1"
41
41
  },
42
42
  "sideEffects": false,
43
43
  "publishConfig": {
package/src/index.ts CHANGED
@@ -42,6 +42,7 @@ export const handleTemplateFile = async (
42
42
  },
43
43
  },
44
44
  },
45
+ true,
45
46
  );
46
47
  }
47
48
  } else {