-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
154 additions
and
3,338 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,10 +1,12 @@ | ||
import { test, it, expect } from 'vitest' | ||
import { execSync } from 'child_process' | ||
import { join } from 'node:path' | ||
import { readFileSync } from 'node:fs' | ||
import { rm } from '@master/css-shared/utils/fs' | ||
|
||
it('init cjs', () => { | ||
it('init cjs', async () => { | ||
rm(join(__dirname, 'master.css.js')) | ||
execSync('tsx ../../src/bin', { cwd: __dirname }) | ||
expect(readFileSync(join(__dirname, 'master.css.js'), 'utf-8')).toEqual(require('../../src/master.css.js.js').default) | ||
const config = (await import('../../src/master.css.js.js')).default | ||
expect(readFileSync(join(__dirname, 'master.css.js'), 'utf-8')).toEqual(config) | ||
}) |
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,10 +1,12 @@ | ||
import { test, it, expect } from 'vitest' | ||
import { execSync } from 'child_process' | ||
import { join } from 'node:path' | ||
import { readFileSync } from 'node:fs' | ||
import { rm } from '@master/css-shared/utils/fs' | ||
|
||
it('init (type="module")', () => { | ||
it('init (type="module")', async () => { | ||
rm(join(__dirname, 'master.css.mjs')) | ||
execSync('tsx ../../src/bin', { cwd: __dirname }) | ||
expect(readFileSync(join(__dirname, 'master.css.mjs'), 'utf-8')).toEqual(require('../../src/master.css.mjs.js').default) | ||
const config = (await import('../../src/master.css.mjs.js')).default | ||
expect(readFileSync(join(__dirname, 'master.css.mjs'), 'utf-8')).toEqual(config) | ||
}) |
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,14 +1,15 @@ | ||
import { test, it, expect } from 'vitest' | ||
import { execSync } from 'child_process' | ||
import { rm } from '@master/css-shared/utils/fs' | ||
import { join } from 'node:path' | ||
import { existsSync, readFileSync } from 'node:fs' | ||
|
||
it('creates a new app', () => { | ||
rm(join(__dirname, 'my-app')) | ||
execSync('tsx ../../src/bin my-app', { cwd: __dirname }) | ||
expect(existsSync(join(__dirname, 'my-app/package.json'))).toBe(true) | ||
rm(join(__dirname, 'dist')) | ||
execSync('tsx ../../src/bin dist', { cwd: __dirname }) | ||
expect(existsSync(join(__dirname, 'dist/package.json'))).toBe(true) | ||
}) | ||
|
||
it('should install the remote dependencies', () => { | ||
expect(readFileSync(join(__dirname, 'my-app/package.json')).toString()).not.toContain('workspace:^') | ||
expect(readFileSync(join(__dirname, 'dist/package.json')).toString()).not.toContain('workspace:^') | ||
}) |
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,10 +1,12 @@ | ||
import { test, it, expect } from 'vitest' | ||
import { execSync } from 'child_process' | ||
import { join } from 'node:path' | ||
import { readFileSync } from 'node:fs' | ||
import { rm } from '@master/css-shared/utils/fs' | ||
|
||
it('init by tsconfig.json', () => { | ||
it('init by tsconfig.json', async () => { | ||
rm(join(__dirname, 'master.css.ts')) | ||
execSync('tsx ../../src/bin', { cwd: __dirname }) | ||
expect(readFileSync(join(__dirname, 'master.css.ts'), 'utf-8')).toEqual(require('../../src/master.css.ts.js').default) | ||
const config = (await import('../../src/master.css.ts.js')).default | ||
expect(readFileSync(join(__dirname, 'master.css.ts'), 'utf-8')).toEqual(config) | ||
}) |
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,16 +1,22 @@ | ||
import { test, it, expect, beforeAll } from 'vitest' | ||
import { execSync } from 'child_process' | ||
import { join } from 'node:path' | ||
import { existsSync, writeFileSync } from 'node:fs' | ||
import { rm, mkdir } from 'shared/utils/fs' | ||
|
||
writeFileSync(join(__dirname, 'package.json'), JSON.stringify({ | ||
'name': 'with-package-json.test', | ||
'private': true, | ||
'dependencies': { | ||
'@master/css': 'latest' | ||
} | ||
})) | ||
beforeAll(() => { | ||
rm(join(__dirname, 'dist')) | ||
mkdir(join(__dirname, 'dist')) | ||
writeFileSync(join(__dirname, './dist/package.json'), JSON.stringify({ | ||
'name': 'with-package-json.test', | ||
'private': true, | ||
'dependencies': { | ||
'@master/css': 'latest' | ||
} | ||
})) | ||
}) | ||
|
||
it('init', () => { | ||
execSync('tsx ../../src/bin', { cwd: __dirname }) | ||
expect(existsSync(join(__dirname, 'node_modules'))).toBeFalsy() | ||
execSync('tsx ../../../src/bin', { cwd: join(__dirname, 'dist')}) | ||
expect(existsSync(join(__dirname, './dist/node_modules'))).toBeFalsy() | ||
}) |
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,16 +1,22 @@ | ||
import { test, it, expect, beforeAll } from 'vitest' | ||
import { execSync } from 'child_process' | ||
import { join } from 'node:path' | ||
import { readFileSync, writeFileSync } from 'node:fs' | ||
import { rm, mkdir } from 'shared/utils/fs' | ||
|
||
writeFileSync(join(__dirname, 'package.json'), JSON.stringify({ | ||
'name': 'with-package-json.test', | ||
'private': true | ||
})) | ||
beforeAll(() => { | ||
rm(join(__dirname, 'dist')) | ||
mkdir(join(__dirname, 'dist')) | ||
writeFileSync(join(__dirname, './dist/package.json'), JSON.stringify({ | ||
'name': 'with-package-json.test', | ||
'private': true | ||
})) | ||
}) | ||
|
||
it('init', () => { | ||
// MacOS and Windows -> error https://registry.yarnpkg.com/@master/css/-/css-2.0.0-rc.21.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOENT: no such file or directory, chmod '/Users/runner/Library/Caches/Yarn/v6/npm-@master-css-2.0.0-rc.21-95d553b31c3370f41a9c60815841f3c359f95bcc-integrity/node_modules/@master/css/README.md'" | ||
if (!process.env.CI || process.env.RUNNER_OS === 'Linux') { | ||
execSync('tsx ../../src/bin', { cwd: __dirname }) | ||
expect(JSON.parse(readFileSync(join(__dirname, 'package.json'), 'utf-8')).dependencies['@master/css']).toBeDefined() | ||
execSync('tsx ../../../src/bin', { cwd: join(__dirname, 'dist')}) | ||
expect(JSON.parse(readFileSync(join(__dirname, './dist/package.json'), 'utf-8')).dependencies['@master/css']).toBeDefined() | ||
} | ||
}) |
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 @@ | ||
import { defineConfig } from 'vitest/config' | ||
import config from '../../shared/vitest.config' | ||
|
||
export default defineConfig(config) |
This file was deleted.
Oops, something went wrong.
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,3 +1,4 @@ | ||
import { test, it, expect } from 'vitest' | ||
import validateCSS from '../src/validate-css' | ||
|
||
it('selector', () => { | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { defineConfig } from 'vitest/config' | ||
import config from '../../shared/vitest.config' | ||
|
||
export default defineConfig(config) |
Oops, something went wrong.