Просмотр исходного кода

import core utils independently

Yuki Takei 3 лет назад
Родитель
Сommit
bf4378f8e7

+ 2 - 1
apps/app/src/server/models/page.ts

@@ -3,6 +3,7 @@
 import nodePath from 'path';
 
 import { HasObjectId, pagePathUtils, pathUtils } from '@growi/core';
+import { collectAncestorPaths } from '@growi/core/dist/utils/page-path-utils/collect-ancestor-paths';
 import escapeStringRegexp from 'escape-string-regexp';
 import mongoose, {
   Schema, Model, Document, AnyObject,
@@ -21,7 +22,7 @@ import { getPageSchema, extractToAncestorsPaths, populateDataToShowRevision } fr
 
 const { addTrailingSlash, normalizePath } = pathUtils;
 const {
-  isTopPage, collectAncestorPaths, hasSlash,
+  isTopPage, hasSlash,
 } = pagePathUtils;
 
 const logger = loggerFactory('growi:models:page');

+ 2 - 1
apps/app/src/server/service/page-operation.ts

@@ -1,4 +1,5 @@
 import { pagePathUtils } from '@growi/core';
+import { collectAncestorPaths } from '@growi/core/dist/utils/page-path-utils/collect-ancestor-paths';
 
 import {
   IPageOperationProcessInfo, IPageOperationProcessData, PageActionType, PageActionStage,
@@ -11,7 +12,7 @@ import { ObjectIdLike } from '../interfaces/mongoose-utils';
 const logger = loggerFactory('growi:services:page-operation');
 
 const {
-  isEitherOfPathAreaOverlap, isPathAreaOverlap, isTrashPage, collectAncestorPaths,
+  isEitherOfPathAreaOverlap, isPathAreaOverlap, isTrashPage,
 } = pagePathUtils;
 const AUTO_UPDATE_INTERVAL_SEC = 5;
 

+ 7 - 4
apps/app/src/server/service/page.ts

@@ -1,11 +1,14 @@
 import pathlib from 'path';
 import { Readable, Writable } from 'stream';
 
+import type {
+  Ref, HasObjectId, IUserHasId,
+  IPage, IPageInfo, IPageInfoAll, IPageInfoForEntity, IPageWithMeta,
+} from '@growi/core';
 import {
-  pagePathUtils, pathUtils, Ref, HasObjectId,
-  IUserHasId, PageStatus,
-  IPage, IPageInfo, IPageInfoAll, IPageInfoForEntity, IPageWithMeta, PageGrant,
+  pagePathUtils, pathUtils, PageGrant, PageStatus,
 } from '@growi/core';
+import { collectAncestorPaths } from '@growi/core/dist/utils/page-path-utils/collect-ancestor-paths';
 import escapeStringRegexp from 'escape-string-regexp';
 import mongoose, { ObjectId, QueryCursor } from 'mongoose';
 import streamToPromise from 'stream-to-promise';
@@ -40,7 +43,7 @@ const debug = require('debug')('growi:services:page');
 const logger = loggerFactory('growi:services:page');
 const {
   isTrashPage, isTopPage, omitDuplicateAreaPageFromPages,
-  collectAncestorPaths, isMovablePage, canMoveByPath, isUsersProtectedPages, hasSlash, generateChildrenRegExp,
+  isMovablePage, canMoveByPath, isUsersProtectedPages, hasSlash, generateChildrenRegExp,
 } = pagePathUtils;
 
 const { addTrailingSlash } = pathUtils;

+ 1 - 1
apps/app/src/utils/project-dir-utils.ts

@@ -4,7 +4,7 @@ import fs from 'fs';
 import path from 'path';
 import process from 'process';
 
-import { isServer } from '@growi/core';
+import { isServer } from '@growi/core/dist/utils/browser-utils';
 
 const isCurrentDirRoot = isServer() && fs.existsSync('./next.config.js');
 

+ 12 - 0
turbo.json

@@ -40,6 +40,18 @@
       ]
     },
 
+    "watch": {
+      "outputs": ["dist/**", "types/**"],
+      "inputs": [
+        "src/**/*.js", "src/**/*.jsx",
+        "src/**/*.ts", "src/**/*.tsx",
+        "src/**/*.css", "src/**/*.scss",
+        "tsconfig*.json",
+        "vite*.ts"
+      ],
+      "persistent": true
+    },
+
     "@growi/app#lint": {
       "dependsOn": ["^dev"]
     },