Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Notable changes: - Lerna 2 → 3 - TypeScript 2 → 3 - babel-* 6 → 7
- Loading branch information
Showing
16 changed files
with
121 additions
and
123 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
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
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 |
---|---|---|
|
@@ -12,6 +12,6 @@ | |
"jsxstyle" | ||
], | ||
"dependencies": { | ||
"csstype": "^2.2.0" | ||
"csstype": "^2.5.7" | ||
} | ||
} |
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,43 +1,36 @@ | ||
import * as PackageUtilities from 'lerna/lib/PackageUtilities'; | ||
import * as Repository from 'lerna/lib/Repository'; | ||
import * as packlist from 'npm-packlist'; | ||
import { getPackages } from '@lerna/project'; | ||
import packlist from 'npm-packlist'; | ||
import * as path from 'path'; | ||
import { Dict } from '../packages/jsxstyle-utils'; | ||
|
||
// NOTE: this interface is incomplete | ||
// See: @lerna/package | ||
interface Package { | ||
/** parsed contents of the package's package.json file */ | ||
_package: { | ||
name: string; | ||
private?: true; | ||
version?: string; | ||
main?: string; | ||
scripts?: Dict<string>; | ||
devDependencies?: Dict<string>; | ||
dependencies?: Dict<string>; | ||
}; | ||
/** absolute path to the package */ | ||
_location: string; | ||
name: string; | ||
location: string; | ||
private: boolean; | ||
toJSON: () => string; | ||
} | ||
|
||
// get all packages from Lerna | ||
const JSXSTYLE_ROOT = path.resolve(__dirname, '..'); | ||
const repo = new Repository(JSXSTYLE_ROOT); | ||
const packages: Package[] = PackageUtilities.getPackages(repo); | ||
packages.sort((a, b) => a._package.name.localeCompare(b._package.name)); | ||
|
||
describe('npm publish', () => { | ||
it('only publishes the intended files', async () => { | ||
const pkgPromises = Promise.all( | ||
packages.map(async pkg => { | ||
const fileList = await packlist({ path: pkg._location }); | ||
return ` | ||
${pkg._package.name} | ||
${pkg._package.name.replace(/./g, '=')} | ||
const packages: Package[] = await getPackages(JSXSTYLE_ROOT); | ||
const packagePromises = packages | ||
// exclude private packages | ||
.filter(pkg => !pkg.private) | ||
.sort((a, b) => a.name.localeCompare(b.name)) | ||
.map(pkg => | ||
// fetch file list and format it into something | ||
packlist({ path: pkg.location }).then( | ||
fileList => ` | ||
${pkg.name} | ||
${pkg.name.replace(/./g, '=')} | ||
${fileList.map(f => `- ${f}`).join('\n')} | ||
`; | ||
}) | ||
); | ||
` | ||
) | ||
); | ||
|
||
await expect(pkgPromises).resolves.toMatchSnapshot(); | ||
await expect(Promise.all(packagePromises)).resolves.toMatchSnapshot(); | ||
}); | ||
}); |
Oops, something went wrong.