Skip to content
Commits on Source (15)
......@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
## [Unreleased]
## [0.6.1] - 2023-05-31
### Fixed
- Add file extensions to local imports [`06a01f5`](https://gitlab.open-xchange.com/frontend/vite-plugin-ox-manifests/commit/06a01f59ba0e8c8350f066c1e18e880a83e9679b)
## [0.6.0] - 2023-05-16
### Changed
......@@ -33,7 +40,8 @@ All notable changes to this project will be documented in this file.
- Start Changelog
[unreleased]: https://gitlab.open-xchange.com/frontend/vite-plugin-ox-manifests/compare/0.6.0...main
[unreleased]: https://gitlab.open-xchange.com/frontend/vite-plugin-ox-manifests/compare/0.6.1...main
[0.6.1]: https://gitlab.open-xchange.com/frontend/vite-plugin-ox-manifests/compare/0.6.0...0.6.1
[0.6.0]: https://gitlab.open-xchange.com/frontend/vite-plugin-ox-manifests/compare/0.5.4...0.6.0
[0.5.4]: https://gitlab.open-xchange.com/frontend/vite-plugin-ox-manifests/compare/0.5.3...0.5.4
[0.5.3]: https://gitlab.open-xchange.com/frontend/vite-plugin-ox-manifests/compare/0.5.2...0.5.3
export default {
collectCoverage: false,
coverageDirectory: 'output/coverage',
......@@ -13,6 +12,7 @@ export default {
'default',
['jest-junit', { outputDirectory: 'output/' }]
],
testTimeout: 15000,
transform: {
'^.+\\.ts$': ['ts-jest', { useESM: true }]
}
......
{
"name": "@open-xchange/vite-plugin-ox-manifests",
"version": "0.6.0",
"version": "0.6.1",
"description": "A vite plugin to concat and serve ox manifests",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -12,7 +12,7 @@
"prepare": "husky install",
"lint": "tsc --noEmit && eslint . --ext .js,.cjs,.mjs,.ts",
"build": "npx --yes rimraf dist && tsc",
"test": "cross-env NODE_OPTIONS=\"--experimental-vm-modules --max_old_space_size=1792\" jest --testTimeout=15000 --runInBand"
"test": "yarn build && cross-env NODE_OPTIONS=\"--experimental-vm-modules --max_old_space_size=1792\" jest --runInBand"
},
"dependencies": {
"@open-xchange/rollup-plugin-po2json": "^0.8.0",
......
import type { Plugin, ResolvedConfig, Rollup } from 'vite'
import type { VitePluginOxManifestsPlugin } from './plugins/plugin'
import { deepMergeObject, mergeManifests } from './util'
import manifestsPlugin from './plugins/manifests'
import relativePathsPlugin from './plugins/relative-paths'
import settingsPlugin from './plugins/settings'
import servePlugin from './plugins/serve'
import gettextPlugin from './plugins/gettext'
import metaPlugin from './plugins/meta'
export { mergeManifests }
export interface OxManifest {
namespace: string
path: string
requires?: string
raw?: string
generator?: string
}
import type { VitePluginOxManifestsPlugin } from './plugins/plugin.js'
import type { OxManifest } from './util.js'
import { PROJECT_NAME, deepMergeObject, mergeManifests } from './util.js'
import manifestsPlugin from './plugins/manifests.js'
import relativePathsPlugin from './plugins/relative-paths.js'
import settingsPlugin from './plugins/settings.js'
import servePlugin from './plugins/serve.js'
import gettextPlugin from './plugins/gettext.js'
import metaPlugin from './plugins/meta.js'
export type { OxManifest }
export { PROJECT_NAME, mergeManifests }
/**
* Configuration options for the Vite plugin "vite-plugin-ox-manifests".
......@@ -68,8 +62,6 @@ export interface VitePluginOxManifests extends Plugin {
getManifests(): Promise<OxManifest[]>
}
export const PROJECT_NAME = '@open-xchange/vite-plugin-ox-manifests'
/**
* Creates a vite-plugin to include manifests in dev and production mode
*/
......
......@@ -4,9 +4,9 @@ import { type ResolvedConfig, normalizePath } from 'vite'
import type { GettextPlugin } from '@open-xchange/rollup-plugin-po2json'
import { PROJECT_NAME as GETTEXT_PROJECT_NAME, parsePoFile, namespacesFrom } from '@open-xchange/rollup-plugin-po2json'
import { type VitePluginOxManifestsModuleMeta, definePlugin } from './plugin'
import { type Dict, applyInputToOptions } from '../util'
import { type OxManifest, PROJECT_NAME } from '../index'
import { type VitePluginOxManifestsModuleMeta, definePlugin } from './plugin.js'
import type { Dict, OxManifest } from '../util.js'
import { PROJECT_NAME, applyInputToOptions } from '../util.js'
export default definePlugin(() => {
const manifests: OxManifest[] = []
......
......@@ -3,9 +3,9 @@ import fs from 'node:fs'
import fastGlob from 'fast-glob'
import type { ResolvedConfig, Plugin, ManifestChunk, Rollup } from 'vite'
import { definePlugin } from './plugin'
import { type Dict, applyInputToOptions, basepath, joinUrlPaths, stringifyJSON } from '../util'
import { type OxManifest, PROJECT_NAME } from '../index'
import { definePlugin } from './plugin.js'
import type { Dict, OxManifest } from '../util.js'
import { PROJECT_NAME, applyInputToOptions, basepath, joinUrlPaths, stringifyJSON } from '../util.js'
interface ExtManifestChunk extends ManifestChunk {
meta?: Rollup.CustomPluginOptions
......
import type { ResolvedConfig } from 'vite'
import { definePlugin } from './plugin'
import { stringifyJSON } from '../util'
import { PROJECT_NAME } from '../index'
import { definePlugin } from './plugin.js'
import { PROJECT_NAME, stringifyJSON } from '../util.js'
export default definePlugin(({ meta }) => {
let resolvedConfig: ResolvedConfig
......
import type { Plugin } from 'vite'
import type { GettextPluginModuleMeta } from '@open-xchange/rollup-plugin-po2json'
import type { OxManifest, VitePluginOxManifests, VitePluginOxManifestsOptions } from '../index'
import type { OxManifest } from '../util.js'
import type { VitePluginOxManifests, VitePluginOxManifestsOptions } from '../index.js'
/**
* Type shape of an internal manifests implementation plugin.
......
import { definePlugin } from './plugin'
import { PROJECT_NAME } from '../index'
import { definePlugin } from './plugin.js'
import { PROJECT_NAME } from '../util.js'
export default definePlugin(options => {
if ('transformAbsolutePaths' in options) console.warn("transformAbsolutePaths is no longer used. Use `base: './'` with vite 3")
......
......@@ -4,9 +4,9 @@ import parseurl from 'parseurl'
import chokidar from 'chokidar'
import type { ResolvedConfig } from 'vite'
import { definePlugin } from './plugin'
import type { OxManifest, VitePluginOxManifests } from '../index'
import { PROJECT_NAME } from '../index'
import { definePlugin } from './plugin.js'
import { type OxManifest, PROJECT_NAME } from '../util.js'
import type { VitePluginOxManifests } from '../index.js'
function sendJSON (res: ServerResponse, data: unknown): ServerResponse {
res.statusCode = 200
......
......@@ -4,9 +4,9 @@ import fastGlob from 'fast-glob'
import type { ResolvedConfig, ModuleGraph, Rollup } from 'vite'
import { type VitePluginOxExternals, PROJECT_NAME as EXTERNALS_PROJECT_NAME } from '@open-xchange/vite-plugin-ox-externals'
import { type VitePluginOxManifestsModuleMeta, definePlugin } from './plugin'
import { type Dict, applyInputToOptions, basepath } from '../util'
import { type OxManifest, PROJECT_NAME } from '../index'
import { type VitePluginOxManifestsModuleMeta, definePlugin } from './plugin.js'
import type { Dict, OxManifest } from '../util.js'
import { PROJECT_NAME, applyInputToOptions, basepath } from '../util.js'
function shiftSet<T> (set: Set<T>): T | undefined {
const result = set.values().next()
......
......@@ -2,10 +2,18 @@ import path from 'node:path'
import type { ResolvedConfig, ViteDevServer, HMRPayload, Rollup } from 'vite'
import { normalizePath } from 'vite'
import type { OxManifest } from './index'
export type Dict<T = unknown> = Record<string, T>
export interface OxManifest {
namespace: string
path: string
requires?: string
raw?: string
generator?: string
}
export const PROJECT_NAME = '@open-xchange/vite-plugin-ox-manifests'
export function applyInputToOptions (input: Dict<string>, options: Rollup.InputOptions): void {
// apply changes to input
if (Object.keys(input).length > 0) {
......
import { describe, it, expect, afterEach } from '@jest/globals'
import { createServer } from 'vite'
import vitePluginOxManifests from '../../src/index'
import vitePluginOxManifests from '../../dist/index'
import { getPort, getDirname } from '../util'
const PORT = getPort()
......
......@@ -2,7 +2,7 @@ import { describe, it, expect, afterEach } from '@jest/globals'
import { build, createServer } from 'vite'
import rollupPluginPo2Json from '@open-xchange/rollup-plugin-po2json'
import vitePluginOxManifests from '../../src/index'
import vitePluginOxManifests from '../../dist/index'
import { getFileFromBundle, getPort, getDirname } from '../util'
const PORT = getPort()
......
......@@ -2,7 +2,7 @@ import { describe, it, expect, afterEach } from '@jest/globals'
import { build, createServer } from 'vite'
import rollupPluginPo2Json from '@open-xchange/rollup-plugin-po2json'
import vitePluginOxManifests from '../../src/index'
import vitePluginOxManifests from '../../dist/index'
import { getFileFromBundle, getPort, getDirname } from '../util'
const PORT = getPort()
......
......@@ -2,7 +2,7 @@ import { describe, it, expect, afterEach } from '@jest/globals'
import { build, createServer } from 'vite'
import rollupPluginPo2Json from '@open-xchange/rollup-plugin-po2json'
import vitePluginOxManifests from '../../src/index'
import vitePluginOxManifests from '../../dist/index'
import { getFileFromBundle, getPort, getDirname } from '../util'
const PORT = getPort()
......
......@@ -4,8 +4,8 @@ import { describe, it, expect, beforeEach, afterEach } from '@jest/globals'
import { createServer } from 'vite'
import vitePluginOxExternals from '@open-xchange/vite-plugin-ox-externals'
import vitePluginOxManifests from '../../src/index'
import { waitForReload } from '../../src/util'
import vitePluginOxManifests from '../../dist/index'
import { waitForReload } from '../../dist/util'
import { getPort, getDirname } from '../util'
const __dirname = getDirname(import.meta.url)
......
import { describe, it, expect } from '@jest/globals'
import { build } from 'vite'
import vitePluginOxManifests from '../../src/index'
import vitePluginOxManifests from '../../dist/index'
import { getFileFromBundle, getDirname } from '../util'
const __dirname = getDirname(import.meta.url)
......
import { describe, it, expect } from '@jest/globals'
import { build } from 'vite'
import vitePluginOxManifests from '../../src/index'
import vitePluginOxManifests from '../../dist/index'
import { getFileFromBundle, getDirname } from '../util'
const __dirname = getDirname(import.meta.url)
......
......@@ -2,7 +2,7 @@ import { describe, it, expect, afterEach } from '@jest/globals'
import { build, createServer } from 'vite'
import vitePluginOxExternals from '@open-xchange/vite-plugin-ox-externals'
import vitePluginOxManifests from '../../src/index'
import vitePluginOxManifests from '../../dist/index'
import { getFileFromBundle, getPort, getDirname } from '../util'
const PORT = getPort()
......