@konomi-app/k2 0.10.2 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,7 +30,10 @@ export async function action(options) {
30
30
  console.log(`⚙ ${CONFIG_FILE_NAME} not found. use default settings.`);
31
31
  }
32
32
  const port = Number(specifiedPort ?? k2Config?.server?.port ?? DEFAULT_PORT);
33
- await Promise.all([build({ certdir, outdir, port, input }), watchCss(k2Config ?? {})]);
33
+ await Promise.all([
34
+ build({ certdir, outdir, port, input }),
35
+ watchCss({ k2Config: k2Config ?? {}, outdir }),
36
+ ]);
34
37
  }
35
38
  catch (error) {
36
39
  throw error;
@@ -1,16 +1,19 @@
1
1
  import path from 'path';
2
- import { PLUGIN_DEVELOPMENT_DIRECTORY } from '../../lib/constants.js';
3
2
  import chalk from 'chalk';
4
3
  import { getTailwindConfigFromK2Config, watchTailwindCSS } from '../../lib/tailwind.js';
5
- async function buildTailwindCSS(params) {
6
- const { inputFile, outputFileName, config } = params;
7
- const inputPath = path.resolve(inputFile);
8
- const outputPath = path.join(PLUGIN_DEVELOPMENT_DIRECTORY, outputFileName);
4
+ export const watchCss = async (params) => {
5
+ const { k2Config, outdir } = params;
6
+ if (!k2Config.tailwind?.css || !k2Config.tailwind?.config) {
7
+ console.log('🚫 missing tailwind config. Skip watching css.');
8
+ return;
9
+ }
10
+ const tailwindConfig = await getTailwindConfigFromK2Config(k2Config.tailwind);
11
+ const input = path.resolve(k2Config.tailwind.css);
9
12
  return watchTailwindCSS({
10
- input: inputPath,
11
- output: outputPath,
12
- config,
13
- onChanges: ({ input, output, type }) => {
13
+ input,
14
+ output: path.join(outdir, 'tailwind.css'),
15
+ config: tailwindConfig,
16
+ onChanges: ({ output, type }) => {
14
17
  const outputFileName = path.basename(output);
15
18
  console.log(chalk.hex('#e5e7eb')(`${new Date().toLocaleTimeString()} `) +
16
19
  chalk.cyan(`[css] `) +
@@ -18,13 +21,4 @@ async function buildTailwindCSS(params) {
18
21
  (type === 'init' ? ' init' : ` rebuilt`));
19
22
  },
20
23
  });
21
- }
22
- export const watchCss = async (k2Config) => {
23
- if (!k2Config.tailwind?.css || !k2Config.tailwind?.config) {
24
- console.log('🚫 missing tailwind config. Skip watching css.');
25
- return;
26
- }
27
- const tailwindConfig = await getTailwindConfigFromK2Config(k2Config.tailwind);
28
- const inputFile = path.resolve(k2Config.tailwind.css);
29
- return buildTailwindCSS({ inputFile, outputFileName: 'styles.css', config: tailwindConfig });
30
24
  };
@@ -35,12 +35,14 @@ export async function action() {
35
35
  inputPath,
36
36
  outputPath: path.join(PLUGIN_CONTENTS_DIRECTORY, 'config.css'),
37
37
  config: tailwindConfig.config,
38
+ minify: true,
38
39
  });
39
40
  console.log('✨ Built config.css');
40
41
  await outputCss({
41
42
  inputPath,
42
43
  outputPath: path.join(PLUGIN_CONTENTS_DIRECTORY, 'desktop.css'),
43
44
  config: tailwindConfig.config,
45
+ minify: true,
44
46
  });
45
47
  console.log('✨ Built desktop.css');
46
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konomi-app/k2",
3
- "version": "0.10.2",
3
+ "version": "1.0.0",
4
4
  "description": "kintone sdk",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",
@@ -26,33 +26,33 @@
26
26
  "dependencies": {
27
27
  "@kintone/plugin-packer": "^8",
28
28
  "@kintone/plugin-uploader": "^9",
29
- "@typescript-eslint/eslint-plugin": "^7.12.0",
30
- "@typescript-eslint/parser": "^7.12.0",
29
+ "@typescript-eslint/eslint-plugin": "^7",
30
+ "@typescript-eslint/parser": "^7",
31
31
  "archiver": "^7",
32
32
  "chalk": "^5",
33
33
  "chokidar": "^3",
34
34
  "commander": "^12",
35
- "css-loader": "^7.1.2",
36
- "cssnano": "^7.0.2",
35
+ "css-loader": "^7",
36
+ "cssnano": "^7",
37
37
  "dotenv": "^16",
38
- "esbuild": "^0.21",
39
- "eslint": "^8.57.0",
40
- "eslint-config-prettier": "^9.1.0",
41
- "eslint-plugin-import": "^2.29.1",
42
- "eslint-plugin-n": "^17.8.1",
43
- "eslint-plugin-promise": "^6.2.0",
44
- "eslint-plugin-react": "^7.34.2",
38
+ "esbuild": "^0.23",
39
+ "eslint": "^8",
40
+ "eslint-config-prettier": "^9",
41
+ "eslint-plugin-import": "^2",
42
+ "eslint-plugin-n": "^17",
43
+ "eslint-plugin-promise": "^6",
44
+ "eslint-plugin-react": "^7",
45
45
  "express": "^4",
46
46
  "fs-extra": "^11",
47
47
  "html-minifier": "^4",
48
48
  "mini-css-extract-plugin": "^2",
49
- "postcss": "^8.4.38",
49
+ "postcss": "^8",
50
50
  "sass": "^1",
51
51
  "sass-loader": "^14",
52
52
  "style-loader": "^4",
53
53
  "tailwindcss": "^3.4.4",
54
54
  "terser-webpack-plugin": "^5",
55
- "tiny-invariant": "^1.3.3",
55
+ "tiny-invariant": "^1",
56
56
  "ts-loader": "^9",
57
57
  "tsconfig-paths-webpack-plugin": "^4",
58
58
  "vite": "^5",