Compare commits

...

15 Commits

Author SHA1 Message Date
Fabio Berger
87fb9a76ce Updated CHANGELOGS 2018-07-26 16:26:57 +02:00
Fabio Berger
0187e0c47d Still test unrunnable packages for compilation issues 2018-07-26 16:20:20 +02:00
Fabio Berger
8732d8ece8 Add changelog entries for next RC publish 2018-07-26 16:02:49 +02:00
Fabio Berger
2e7c130f62 Expose lerna dep 2018-07-26 16:00:46 +02:00
Fabio Berger
a90f434df5 Split running packages that cannot be run in a node.js script 2018-07-26 15:58:35 +02:00
Fabio Berger
3b005ad47c Fix accidental import from test folder 2018-07-26 15:34:00 +02:00
Fabio Berger
735bc2f178 Re-enable deleted the dir after test runs 2018-07-26 15:32:53 +02:00
Fabio Berger
e3cfa6363d Change test:installation so it also causes run-time errors to appear 2018-07-26 15:32:30 +02:00
Fabio Berger
331b1cb9a0 Fix lint issue 2018-07-26 15:27:50 +02:00
Fabio Berger
55dbb0ece0 Always append monorepo root path so script can be called from anywhere 2018-07-26 14:42:07 +02:00
Fabio Berger
af4071e119 Delete any remenants of test-env dir before creating a new one 2018-07-26 14:23:45 +02:00
Fabio Berger
9947e643d0 Print version that will be tested 2018-07-26 14:23:07 +02:00
Fabio Berger
d3be4f2852 Add ending slash 2018-07-26 14:22:51 +02:00
Fabio Berger
e320f343f8 Add support for testing installations post-publish as well 2018-07-26 14:14:14 +02:00
Fabio Berger
f6cc7d9c3c Fix asset path 2018-07-26 14:04:47 +02:00
57 changed files with 371 additions and 13 deletions

View File

@@ -13,13 +13,14 @@
"prettier:ci": "prettier --list-different '**/*.{ts,tsx,json,md}' --config .prettierrc",
"report_coverage": "lcov-result-merger 'packages/*/coverage/lcov.info' | coveralls",
"test:installation": "node ./packages/monorepo-scripts/lib/test_installation.js",
"test:installation:local": "IS_LOCAL_PUBLISH=true node ./packages/monorepo-scripts/lib/test_installation.js",
"run:publish": "run-s install:all build:monorepo_scripts script:prepublish_checks rebuild:no_website script:publish",
"run:publish:local": "IS_LOCAL_PUBLISH=true yarn run:publish",
"script:prepublish_checks": "node ./packages/monorepo-scripts/lib/prepublish_checks.js",
"script:publish": "node ./packages/monorepo-scripts/lib/publish.js",
"install:all": "yarn install",
"wsrun": "wsrun",
"lerna:run": "lerna run",
"lerna": "lerna",
"watch": "wsrun watch_without_deps $PKG --fast-exit -r --stages --done-criteria='complete|successfully'",
"build": "wsrun build $PKG --fast-exit -r --stages",
"build:no_website": "wsrun build $PKG --fast-exit -r --stages --exclude @0xproject/website",

View File

@@ -1,4 +1,13 @@
[
{
"version": "1.0.1-rc.2",
"changes": [
{
"note": "Fixed bug caused by importing non-existent dep"
}
],
"timestamp": 1532614997
},
{
"version": "1.0.1-rc.1",
"changes": [

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.1-rc.2 - _July 26, 2018_
* Fixed bug caused by importing non-existent dep
## v1.0.1-rc.1 - _July 26, 2018_
* Dependencies updated

View File

@@ -41,8 +41,8 @@
"contracts": "ZRXToken",
"postpublish": {
"assets": [
"_bundles/index.js",
"_bundles/index.min.js"
"packages/0x.js/_bundles/index.js",
"packages/0x.js/_bundles/index.min.js"
],
"docPublishConfigs": {
"extraFileIncludes": [

View File

@@ -1,4 +1,13 @@
[
{
"timestamp": 1532614997,
"version": "1.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532605697,
"version": "1.0.2",

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.3 - _July 26, 2018_
* Dependencies updated
## v1.0.2 - _July 26, 2018_
* Dependencies updated

View File

@@ -1,4 +1,13 @@
[
{
"timestamp": 1532614997,
"version": "1.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532605697,
"version": "1.0.2",

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.3 - _July 26, 2018_
* Dependencies updated
## v1.0.2 - _July 26, 2018_
* Dependencies updated

View File

@@ -1,4 +1,13 @@
[
{
"timestamp": 1532614997,
"version": "1.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532605697,
"version": "1.0.2",

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.3 - _July 26, 2018_
* Dependencies updated
## v1.0.2 - _July 26, 2018_
* Dependencies updated

View File

@@ -1,4 +1,13 @@
[
{
"timestamp": 1532614997,
"version": "1.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532605697,
"version": "1.0.2",

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.3 - _July 26, 2018_
* Dependencies updated
## v1.0.2 - _July 26, 2018_
* Dependencies updated

View File

@@ -1,4 +1,13 @@
[
{
"version": "1.0.1-rc.2",
"changes": [
{
"note": "Fixed bug caused by importing non-existent dep"
}
],
"timestamp": 1532614997
},
{
"version": "1.0.1-rc.1",
"changes": [

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.1-rc.2 - _July 26, 2018_
* Fixed bug caused by importing non-existent dep
## v1.0.1-rc.1 - _July 26, 2018_
* Dependencies updated

View File

@@ -4,7 +4,6 @@ import { Web3Wrapper } from '@0xproject/web3-wrapper';
import { ContractAbi, LogWithDecodedArgs } from 'ethereum-types';
import * as _ from 'lodash';
import { constants } from '../../test/utils/constants';
import { artifacts } from '../artifacts';
import { methodOptsSchema } from '../schemas/method_opts_schema';
import { txOptsSchema } from '../schemas/tx_opts_schema';
@@ -17,6 +16,7 @@ import {
TransactionOpts,
} from '../types';
import { assert } from '../utils/assert';
import { constants } from '../utils/constants';
import { ContractWrapper } from './contract_wrapper';
import { ERC721ProxyWrapper } from './erc721_proxy_wrapper';

View File

@@ -1,4 +1,13 @@
[
{
"timestamp": 1532614997,
"version": "1.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532605697,
"version": "1.0.2",

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.3 - _July 26, 2018_
* Dependencies updated
## v1.0.2 - _July 26, 2018_
* Dependencies updated

View File

@@ -1,4 +1,13 @@
[
{
"timestamp": 1532614997,
"version": "1.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532605697,
"version": "1.0.2",

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.3 - _July 26, 2018_
* Dependencies updated
## v1.0.2 - _July 26, 2018_
* Dependencies updated

View File

@@ -1,4 +1,13 @@
[
{
"version": "1.0.1-rc.2",
"changes": [
{
"note": "Dependencies updated"
}
],
"timestamp": 1532614997
},
{
"version": "1.0.1-rc.1",
"changes": [

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.1-rc.2 - _July 26, 2018_
* Dependencies updated
## v1.0.1-rc.1 - _July 26, 2018_
* Dependencies updated

View File

@@ -1,4 +1,13 @@
[
{
"version": "1.0.1-rc.2",
"changes": [
{
"note": "Dependencies updated"
}
],
"timestamp": 1532614997
},
{
"version": "1.0.1-rc.1",
"changes": [

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.1-rc.2 - _July 26, 2018_
* Dependencies updated
## v1.0.1-rc.1 - _July 26, 2018_
* Dependencies updated

View File

@@ -1,4 +1,13 @@
[
{
"timestamp": 1532614997,
"version": "1.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532605697,
"version": "1.0.2",

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.3 - _July 26, 2018_
* Dependencies updated
## v1.0.2 - _July 26, 2018_
* Dependencies updated

View File

@@ -1,4 +1,13 @@
[
{
"timestamp": 1532614997,
"version": "1.0.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532605697,
"version": "1.0.3",

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.4 - _July 26, 2018_
* Dependencies updated
## v1.0.3 - _July 26, 2018_
* Dependencies updated

View File

@@ -57,7 +57,6 @@ export const postpublishUtils = {
}
const postpublishConfigs = postpublishUtils.generateConfig(packageJSON, tsConfigJSON, cwd);
await postpublishUtils.publishReleaseNotesAsync(
postpublishConfigs.cwd,
postpublishConfigs.packageName,
postpublishConfigs.version,
postpublishConfigs.assets,
@@ -92,11 +91,11 @@ export const postpublishUtils = {
postpublishConfigs.docPublishConfigs.s3StagingBucketPath,
);
},
async publishReleaseNotesAsync(cwd: string, packageName: string, version: string, assets: string[]): Promise<void> {
async publishReleaseNotesAsync(packageName: string, version: string, assets: string[]): Promise<void> {
const notes = postpublishUtils.getReleaseNotes(packageName, version);
const releaseName = postpublishUtils.getReleaseName(packageName, version);
const tag = postpublishUtils.getTag(packageName, version);
postpublishUtils.adjustAssetPaths(cwd, assets);
postpublishUtils.adjustAssetPaths(assets);
utils.log('POSTPUBLISH: Releasing ', releaseName, '...');
await publishReleaseAsync({
token: constants.githubPersonalAccessToken,
@@ -145,10 +144,12 @@ export const postpublishUtils = {
const releaseName = `${subPackageName} v${version}`;
return releaseName;
},
adjustAssetPaths(cwd: string, assets: string[]): string[] {
// Asset paths should described from the monorepo root. This method prefixes
// the supplied path with the absolute path to the monorepo root.
adjustAssetPaths(assets: string[]): string[] {
const finalAssets: string[] = [];
_.each(assets, (asset: string) => {
finalAssets.push(`${cwd}/${asset}`);
finalAssets.push(`${constants.monorepoRootPath}/${asset}`);
});
return finalAssets;
},

View File

@@ -8,7 +8,17 @@ import * as rimraf from 'rimraf';
import { utils } from './utils/utils';
// Packages might not be runnable if they are command-line tools or only run in browsers.
const UNRUNNABLE_PACKAGES = [
'@0xproject/abi-gen',
'@0xproject/sra-report',
'@0xproject/react-shared',
'@0xproject/react-docs',
];
(async () => {
const IS_LOCAL_PUBLISH = process.env.IS_LOCAL_PUBLISH === 'true';
const registry = IS_LOCAL_PUBLISH ? 'http://localhost:4873/' : 'https://registry.npmjs.org/';
const monorepoRootPath = path.join(__dirname, '../../..');
const packages = utils.getTopologicallySortedPackages(monorepoRootPath);
const installablePackages = _.filter(
@@ -21,18 +31,19 @@ import { utils } from './utils/utils';
const changelogPath = path.join(installablePackage.location, 'CHANGELOG.json');
const lastChangelogVersion = JSON.parse(fs.readFileSync(changelogPath).toString())[0].version;
const packageName = installablePackage.packageJson.name;
utils.log(`Testing ${packageName}`);
utils.log(`Testing ${packageName}@${lastChangelogVersion}`);
const testDirectory = path.join(monorepoRootPath, '../test-env');
rimraf.sync(testDirectory);
fs.mkdirSync(testDirectory);
await execAsync('yarn init --yes', { cwd: testDirectory });
const npmrcFilePath = path.join(testDirectory, '.npmrc');
fs.writeFileSync(npmrcFilePath, `registry=http://localhost:4873`);
fs.writeFileSync(npmrcFilePath, `registry=${registry}`);
utils.log(`Installing ${packageName}@${lastChangelogVersion}`);
await execAsync(`npm install --save ${packageName}@${lastChangelogVersion} --registry=http://localhost:4873`, {
await execAsync(`npm install --save ${packageName}@${lastChangelogVersion} --registry=${registry}`, {
cwd: testDirectory,
});
const indexFilePath = path.join(testDirectory, 'index.ts');
fs.writeFileSync(indexFilePath, `import * as Package from '${packageName}';\n`);
fs.writeFileSync(indexFilePath, `import * as Package from '${packageName}';\nconsole.log(Package);\n`);
const tsConfig = {
compilerOptions: {
typeRoots: ['node_modules/@0xproject/typescript-typings/types', 'node_modules/@types'],
@@ -52,6 +63,13 @@ import { utils } from './utils/utils';
const tscBinaryPath = path.join(monorepoRootPath, './node_modules/typescript/bin/tsc');
await execAsync(tscBinaryPath, { cwd: testDirectory });
utils.log(`Successfully compiled with ${packageName} as a dependency`);
const isUnrunnablePkg = _.includes(UNRUNNABLE_PACKAGES, packageName);
if (!isUnrunnablePkg) {
const transpiledIndexFilePath = path.join(testDirectory, 'index.js');
utils.log(`Running test script with ${packageName} imported`);
await execAsync(`node ${transpiledIndexFilePath}`);
utils.log(`Successfilly ran test script with ${packageName} imported`);
}
rimraf.sync(testDirectory);
}
})().catch(err => {

View File

@@ -1,4 +1,13 @@
[
{
"version": "1.0.1-rc.2",
"changes": [
{
"note": "Dependencies updated"
}
],
"timestamp": 1532614997
},
{
"version": "1.0.1-rc.1",
"changes": [

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.1-rc.2 - _July 26, 2018_
* Dependencies updated
## v1.0.1-rc.1 - _July 26, 2018_
* Dependencies updated

View File

@@ -1,4 +1,13 @@
[
{
"version": "1.0.1-rc.2",
"changes": [
{
"note": "Fixed bug caused by importing non-existent dep"
}
],
"timestamp": 1532614997
},
{
"version": "1.0.1-rc.1",
"changes": [

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.1-rc.2 - _July 26, 2018_
* Fixed bug caused by importing non-existent dep
## v1.0.1-rc.1 - _July 26, 2018_
* Dependencies updated

View File

@@ -1,4 +1,13 @@
[
{
"timestamp": 1532614997,
"version": "1.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532605697,
"version": "1.0.2",

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.3 - _July 26, 2018_
* Dependencies updated
## v1.0.2 - _July 26, 2018_
* Dependencies updated

View File

@@ -1,4 +1,13 @@
[
{
"timestamp": 1532614997,
"version": "1.0.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532605697,
"version": "1.0.3",

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.4 - _July 26, 2018_
* Dependencies updated
## v1.0.3 - _July 26, 2018_
* Dependencies updated

View File

@@ -1,4 +1,13 @@
[
{
"timestamp": 1532614997,
"version": "1.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532605697,
"version": "1.0.2",

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.3 - _July 26, 2018_
* Dependencies updated
## v1.0.2 - _July 26, 2018_
* Dependencies updated

View File

@@ -1,4 +1,13 @@
[
{
"timestamp": 1532614997,
"version": "1.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532605697,
"version": "1.0.2",

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.3 - _July 26, 2018_
* Dependencies updated
## v1.0.2 - _July 26, 2018_
* Dependencies updated

View File

@@ -1,4 +1,13 @@
[
{
"timestamp": 1532614997,
"version": "1.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532605697,
"version": "1.0.2",

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.3 - _July 26, 2018_
* Dependencies updated
## v1.0.2 - _July 26, 2018_
* Dependencies updated

View File

@@ -1,4 +1,13 @@
[
{
"timestamp": 1532614997,
"version": "1.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532605697,
"version": "1.0.2",

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.3 - _July 26, 2018_
* Dependencies updated
## v1.0.2 - _July 26, 2018_
* Dependencies updated

View File

@@ -1,4 +1,13 @@
[
{
"timestamp": 1532614997,
"version": "1.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532605697,
"version": "1.0.2",

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.3 - _July 26, 2018_
* Dependencies updated
## v1.0.2 - _July 26, 2018_
* Dependencies updated

View File

@@ -1,4 +1,13 @@
[
{
"timestamp": 1532614997,
"version": "1.0.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532605697,
"version": "1.0.3",

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.4 - _July 26, 2018_
* Dependencies updated
## v1.0.3 - _July 26, 2018_
* Dependencies updated

View File

@@ -1,4 +1,13 @@
[
{
"version": "1.0.1-rc.2",
"changes": [
{
"note": "Dependencies updated"
}
],
"timestamp": 1532614997
},
{
"version": "1.0.1-rc.1",
"changes": [

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.1-rc.2 - _July 26, 2018_
* Dependencies updated
## v1.0.1-rc.1 - _July 26, 2018_
* Remove `ECSignatureBuffer`

View File

@@ -1,4 +1,13 @@
[
{
"timestamp": 1532614997,
"version": "1.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532605697,
"version": "1.0.2",

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.3 - _July 26, 2018_
* Dependencies updated
## v1.0.2 - _July 26, 2018_
* Dependencies updated

View File

@@ -1,4 +1,13 @@
[
{
"timestamp": 1532614997,
"version": "1.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532605697,
"version": "1.0.2",

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.3 - _July 26, 2018_
* Dependencies updated
## v1.0.2 - _July 26, 2018_
* Dependencies updated

View File

@@ -1,4 +1,13 @@
[
{
"timestamp": 1532614997,
"version": "1.1.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "1.1.0",
"changes": [

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.1.1 - _July 26, 2018_
* Dependencies updated
## v1.1.0 - _July 26, 2018_
* Add `getTransactionByHashAsync` method (#847)