mirror of
https://github.com/enso-org/enso.git
synced 2025-01-09 01:26:59 +03:00
Restructure app/ide-desktop/client/
for consistency with other modules (#10649)
- Change paths from `foo-bar` to `@/fooBar` to be consistent with GUI module naming # Important Notes None
This commit is contained in:
parent
c4e8ae143e
commit
fde2f71419
@ -33,7 +33,7 @@ const NAME = 'enso'
|
||||
const DEFAULT_IMPORT_ONLY_MODULES =
|
||||
'@vitejs\\u002Fplugin-react|node:process|chalk|string-length|yargs|yargs\\u002Fyargs|sharp|to-ico|connect|morgan|serve-static|tiny-invariant|clsx|create-servers|electron-is-dev|fast-glob|esbuild-plugin-.+|opener|tailwindcss.*|@modyfi\\u002Fvite-plugin-yaml|build-info|is-network-error|validator.+|.*[.]json$'
|
||||
const RELATIVE_MODULES =
|
||||
'bin\\u002Fproject-manager|bin\\u002Fserver|config\\u002Fparser|authentication|config|debug|detect|file-associations|index|ipc|log|naming|paths|preload|project-management|security|url-associations|content-config|desktop-environment|#\\u002F.*'
|
||||
'projectManager|server|configParser|authentication|config|debug|detect|fileAssociations|index|ipc|log|naming|paths|preload|projectManagement|security|urlAssociations|contentConfig|desktopEnvironment|#\\u002F.*'
|
||||
const ALLOWED_DEFAULT_IMPORT_MODULES = `${DEFAULT_IMPORT_ONLY_MODULES}|postcss|ajv\\u002Fdist\\u002F2020|${RELATIVE_MODULES}`
|
||||
const STRING_LITERAL = ':matches(Literal[raw=/^["\']/], TemplateLiteral)'
|
||||
const NOT_CAMEL_CASE = '/^(?!_?[a-z][a-z0-9*]*([A-Z0-9][a-z0-9]*)*$)(?!React$)/'
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** @file Script that bundles JS client code. */
|
||||
import * as esbuild from 'esbuild'
|
||||
|
||||
import * as bundler from './esbuild-config'
|
||||
import * as bundler from './esbuildConfig'
|
||||
|
||||
// ================
|
||||
// === Bundling ===
|
||||
|
@ -15,12 +15,12 @@ import yargs from 'yargs'
|
||||
|
||||
import * as common from 'enso-common'
|
||||
|
||||
import * as fileAssociations from './file-associations'
|
||||
import * as fileAssociations from './fileAssociations'
|
||||
import * as paths from './paths'
|
||||
import computeHashes from './tasks/computeHashes.mjs'
|
||||
import signArchivesMacOs from './tasks/signArchivesMacOs'
|
||||
|
||||
import BUILD_INFO from './build-info'
|
||||
import BUILD_INFO from './buildInfo'
|
||||
|
||||
// =============
|
||||
// === Types ===
|
||||
|
@ -1,5 +1,6 @@
|
||||
/** @file Esbuild config file. */
|
||||
import * as path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
import type * as esbuild from 'esbuild'
|
||||
import esbuildPluginYaml from 'esbuild-plugin-yaml'
|
||||
@ -50,6 +51,9 @@ export function bundlerOptions(
|
||||
// The names come from a third-party API and cannot be changed.
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
outExtension: { '.js': '.cjs' },
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
},
|
||||
define: {
|
||||
'process.env.PROJECT_MANAGER_IN_BUNDLE_PATH': JSON.stringify(projectManagerInBundlePath),
|
||||
'process.env.ELECTRON_DEV_MODE': JSON.stringify(String(devMode)),
|
@ -80,9 +80,9 @@ import opener from 'opener'
|
||||
import * as common from 'enso-common'
|
||||
import type * as dashboard from 'enso-dashboard'
|
||||
|
||||
import * as contentConfig from 'content-config'
|
||||
import * as ipc from 'ipc'
|
||||
import * as urlAssociations from 'url-associations'
|
||||
import * as contentConfig from '@/contentConfig'
|
||||
import * as ipc from '@/ipc'
|
||||
import * as urlAssociations from '@/urlAssociations'
|
||||
|
||||
const logger = contentConfig.logger
|
||||
|
||||
|
@ -3,9 +3,9 @@
|
||||
|
||||
import chalk from 'chalk'
|
||||
|
||||
import * as contentConfig from 'content-config'
|
||||
import * as naming from 'naming'
|
||||
import * as paths from 'paths'
|
||||
import * as contentConfig from '@/contentConfig'
|
||||
import * as naming from '@/naming'
|
||||
import * as paths from '@/paths'
|
||||
|
||||
// =================
|
||||
// === Constants ===
|
||||
|
@ -6,11 +6,11 @@ import stringLength from 'string-length'
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
import yargs, { type Options } from 'yargs'
|
||||
|
||||
import * as config from 'config'
|
||||
import * as contentConfig from 'content-config'
|
||||
import * as fileAssociations from 'file-associations'
|
||||
import * as naming from 'naming'
|
||||
import BUILD_INFO from '../../build-info'
|
||||
import * as config from '@/config'
|
||||
import * as contentConfig from '@/contentConfig'
|
||||
import * as fileAssociations from '@/fileAssociations'
|
||||
import * as naming from '@/naming'
|
||||
import BUILD_INFO from '../buildInfo'
|
||||
|
||||
const logger = contentConfig.logger
|
||||
|
@ -3,7 +3,7 @@
|
||||
import * as semver from 'semver'
|
||||
|
||||
import * as linkedDist from 'enso-runner/src/runner'
|
||||
import BUILD_INFO from '../build-info'
|
||||
import BUILD_INFO from '../buildInfo'
|
||||
|
||||
// Aliases with the same name as the original.
|
||||
// eslint-disable-next-line no-restricted-syntax
|
@ -2,7 +2,7 @@
|
||||
|
||||
import * as buildUtils from 'enso-common/src/buildUtils'
|
||||
|
||||
import BUILD_INFO from '../build-info'
|
||||
import BUILD_INFO from '../buildInfo'
|
||||
|
||||
// ==================
|
||||
// === Debug Info ===
|
||||
|
@ -13,10 +13,10 @@ import electronIsDev from 'electron-is-dev'
|
||||
|
||||
import * as common from 'enso-common'
|
||||
|
||||
import type * as clientConfig from 'config'
|
||||
import * as contentConfig from 'content-config'
|
||||
import * as project from 'project-management'
|
||||
import * as fileAssociations from '../file-associations'
|
||||
import type * as clientConfig from '@/config'
|
||||
import * as contentConfig from '@/contentConfig'
|
||||
import * as project from '@/projectManagement'
|
||||
import * as fileAssociations from '../fileAssociations'
|
||||
|
||||
const logger = contentConfig.logger
|
||||
|
@ -18,22 +18,22 @@ import * as common from 'enso-common'
|
||||
import * as buildUtils from 'enso-common/src/buildUtils'
|
||||
import GLOBAL_CONFIG from 'enso-common/src/config.json' assert { type: 'json' }
|
||||
|
||||
import * as authentication from 'authentication'
|
||||
import * as projectManager from 'bin/project-manager'
|
||||
import * as server from 'bin/server'
|
||||
import * as config from 'config'
|
||||
import * as configParser from 'config/parser'
|
||||
import * as contentConfig from 'content-config'
|
||||
import * as debug from 'debug'
|
||||
import * as detect from 'detect'
|
||||
import * as fileAssociations from 'file-associations'
|
||||
import * as ipc from 'ipc'
|
||||
import * as log from 'log'
|
||||
import * as naming from 'naming'
|
||||
import * as paths from 'paths'
|
||||
import * as projectManagement from 'project-management'
|
||||
import * as security from 'security'
|
||||
import * as urlAssociations from 'url-associations'
|
||||
import * as authentication from '@/authentication'
|
||||
import * as config from '@/config'
|
||||
import * as configParser from '@/configParser'
|
||||
import * as contentConfig from '@/contentConfig'
|
||||
import * as debug from '@/debug'
|
||||
import * as detect from '@/detect'
|
||||
import * as fileAssociations from '@/fileAssociations'
|
||||
import * as ipc from '@/ipc'
|
||||
import * as log from '@/log'
|
||||
import * as naming from '@/naming'
|
||||
import * as paths from '@/paths'
|
||||
import * as projectManagement from '@/projectManagement'
|
||||
import * as projectManager from '@/projectManager'
|
||||
import * as security from '@/security'
|
||||
import * as server from '@/server'
|
||||
import * as urlAssociations from '@/urlAssociations'
|
||||
|
||||
const logger = contentConfig.logger
|
||||
|
||||
|
@ -11,8 +11,8 @@ import * as pathModule from 'node:path'
|
||||
|
||||
import * as linkedDist from 'enso-runner/src/runner'
|
||||
|
||||
import * as contentConfig from 'content-config'
|
||||
import * as paths from 'paths'
|
||||
import * as contentConfig from '@/contentConfig'
|
||||
import * as paths from '@/paths'
|
||||
|
||||
// ================
|
||||
// === Log File ===
|
||||
|
@ -7,9 +7,9 @@ import * as electron from 'electron'
|
||||
|
||||
import type * as dashboard from 'enso-dashboard'
|
||||
|
||||
import * as debug from 'debug'
|
||||
import * as ipc from 'ipc'
|
||||
import type * as projectManagement from 'project-management'
|
||||
import * as debug from '@/debug'
|
||||
import * as ipc from '@/ipc'
|
||||
import type * as projectManagement from '@/projectManagement'
|
||||
|
||||
// =================
|
||||
// === Constants ===
|
||||
|
@ -18,7 +18,7 @@ import * as tar from 'tar'
|
||||
import * as common from 'enso-common'
|
||||
import * as buildUtils from 'enso-common/src/buildUtils'
|
||||
|
||||
import * as desktopEnvironment from 'desktop-environment'
|
||||
import * as desktopEnvironment from '@/desktopEnvironment'
|
||||
|
||||
const logger = console
|
||||
|
@ -4,9 +4,9 @@ import * as childProcess from 'node:child_process'
|
||||
import * as fsSync from 'node:fs'
|
||||
import * as util from 'node:util'
|
||||
|
||||
import * as contentConfig from 'content-config'
|
||||
import * as contentConfig from '@/contentConfig'
|
||||
|
||||
import type * as config from 'config'
|
||||
import type * as config from '@/config'
|
||||
|
||||
const logger = contentConfig.logger
|
||||
// This is a wrapped function, so it should be `camelCase`.
|
@ -12,13 +12,13 @@ import * as mime from 'mime-types'
|
||||
import * as portfinder from 'portfinder'
|
||||
import type * as vite from 'vite'
|
||||
|
||||
import * as projectManagement from '@/projectManagement'
|
||||
import * as common from 'enso-common'
|
||||
import GLOBAL_CONFIG from 'enso-common/src/config.json' assert { type: 'json' }
|
||||
import * as ydocServer from 'enso-gui2/ydoc-server'
|
||||
import * as projectManagement from 'project-management'
|
||||
|
||||
import * as contentConfig from 'content-config'
|
||||
import * as paths from 'paths'
|
||||
import * as contentConfig from '@/contentConfig'
|
||||
import * as paths from '@/paths'
|
||||
|
||||
const logger = contentConfig.logger
|
||||
|
@ -5,7 +5,7 @@ import electronIsDev from 'electron-is-dev'
|
||||
|
||||
import * as common from 'enso-common'
|
||||
|
||||
import * as contentConfig from 'content-config'
|
||||
import * as contentConfig from '@/contentConfig'
|
||||
|
||||
const logger = contentConfig.logger
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./src",
|
||||
"esModuleInterop": true
|
||||
"esModuleInterop": true,
|
||||
"paths": { "@/*": ["./src/*"] }
|
||||
},
|
||||
"include": [
|
||||
".",
|
||||
|
@ -13,7 +13,7 @@ import process from 'node:process'
|
||||
|
||||
import * as esbuild from 'esbuild'
|
||||
|
||||
import * as clientBundler from './esbuild-config'
|
||||
import * as clientBundler from './esbuildConfig'
|
||||
import * as paths from './paths'
|
||||
|
||||
// =============
|
||||
|
Loading…
Reference in New Issue
Block a user