-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: change semicolon format config (#5)
- Loading branch information
1 parent
9a9c238
commit c24f23c
Showing
18 changed files
with
73 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Ignore artifacts | ||
dist | ||
compiled | ||
doc_build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
{ | ||
"singleQuote": true, | ||
"semi": false | ||
"singleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { expect, test } from '@playwright/test' | ||
import { expect, test } from '@playwright/test'; | ||
|
||
test('todo', async () => { | ||
expect(1).toBe(1) | ||
}) | ||
expect(1).toBe(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
import { build } from '@rslib/core' | ||
import { expect, test } from 'vitest' | ||
import { globContentJSON } from '#helper' | ||
import { build } from '@rslib/core'; | ||
import { expect, test } from 'vitest'; | ||
import { globContentJSON } from '#helper'; | ||
|
||
test.fails('define', async () => { | ||
// @ts-expect-error follow conventional | ||
delete process.env.NODE_ENV | ||
delete process.env.NODE_ENV; | ||
|
||
const rslibConfig = { | ||
root: __dirname, | ||
entry: './js/src/index.js', | ||
outDir: 'dist', | ||
} | ||
}; | ||
|
||
const instance = await build(rslibConfig) | ||
const instance = await build(rslibConfig); | ||
const results = await globContentJSON(instance.context.distPath, { | ||
absolute: true, | ||
ignore: ['/**/*.map'], | ||
}) | ||
}); | ||
|
||
const entryJs = Object.keys(results).find((file) => file.endsWith('.js')) | ||
expect(results[entryJs!]).not.toContain('console.info(VERSION)') | ||
}) | ||
const entryJs = Object.keys(results).find((file) => file.endsWith('.js')); | ||
expect(results[entryJs!]).not.toContain('console.info(VERSION)'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
console.info(VERSION) | ||
console.info(VERSION); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { defineConfig } from '@playwright/test' | ||
import { defineConfig } from '@playwright/test'; | ||
|
||
export default defineConfig({ | ||
// Playwright test files with `.pw.` to distinguish from Vitest test files | ||
testMatch: /.*pw.(test|spec).(js|ts|mjs)/, | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
import { platform } from 'node:os' | ||
import { join } from 'node:path' | ||
import { platform } from 'node:os'; | ||
import { join } from 'node:path'; | ||
import fg, { | ||
type Options as GlobOptions, | ||
convertPathToPattern, | ||
} from 'fast-glob' | ||
import fse from 'fs-extra' | ||
} from 'fast-glob'; | ||
import fse from 'fs-extra'; | ||
|
||
export const getFiles = async (pattern: string) => {} | ||
export const getFiles = async (pattern: string) => {}; | ||
|
||
// fast-glob only accepts posix path | ||
// https://github.com/mrmlnc/fast-glob#convertpathtopatternpath | ||
const convertPath = (path: string) => { | ||
if (platform() === 'win32') { | ||
return convertPathToPattern(path) | ||
return convertPathToPattern(path); | ||
} | ||
return path | ||
} | ||
return path; | ||
}; | ||
|
||
export const globContentJSON = async (path: string, options?: GlobOptions) => { | ||
const files = await fg(convertPath(join(path, '**/*')), options) | ||
const ret: Record<string, string> = {} | ||
const files = await fg(convertPath(join(path, '**/*')), options); | ||
const ret: Record<string, string> = {}; | ||
|
||
await Promise.all( | ||
files.map((file) => | ||
fse.readFile(file, 'utf-8').then((content) => { | ||
ret[file] = content | ||
ret[file] = content; | ||
}), | ||
), | ||
) | ||
); | ||
|
||
return ret | ||
} | ||
return ret; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
import {} from '@rslib/core' | ||
import {} from '@rslib/core'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
#!/usr/bin/env node | ||
|
||
async function main() { | ||
const { runCli } = require('../dist/cli') | ||
runCli() | ||
const { runCli } = require('../dist/cli'); | ||
runCli(); | ||
} | ||
|
||
main() | ||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { createRsbuild } from '@rsbuild/core' | ||
import { composeCreateRsbuildConfig } from './config' | ||
import type { RslibConfig } from './types' | ||
import { createRsbuild } from '@rsbuild/core'; | ||
import { composeCreateRsbuildConfig } from './config'; | ||
import type { RslibConfig } from './types'; | ||
|
||
export async function build(config: RslibConfig) { | ||
const createRsbuildConfig = composeCreateRsbuildConfig(config) | ||
const rsbuildInstance = await createRsbuild(createRsbuildConfig) | ||
const createRsbuildConfig = composeCreateRsbuildConfig(config); | ||
const rsbuildInstance = await createRsbuild(createRsbuildConfig); | ||
await rsbuildInstance.build({ | ||
mode: 'production', | ||
}) | ||
return rsbuildInstance | ||
}); | ||
return rsbuildInstance; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export interface RslibConfig { | ||
entry: string | ||
root?: string | ||
outDir?: string | ||
entry: string; | ||
root?: string; | ||
outDir?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { describe, expect, it } from 'vitest' | ||
import { describe, expect, it } from 'vitest'; | ||
|
||
describe('core', () => { | ||
it('should work', () => { | ||
expect(1).toBe(1) | ||
}) | ||
}) | ||
expect(1).toBe(1); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters