fixing gitignore, and bumping stacks to major so semver ranges are fully working (#199)

* fixing gitignore issues by actually renaming things

* making init only install devdeps for the stack - should make this faster

* upgrading to major 1.0.0

* Change files

* fixing some versioning for plop-helper
This commit is contained in:
Kenneth Chau 2019-08-05 10:30:21 -07:00 коммит произвёл GitHub
Родитель 09fe65a0af
Коммит 3bc41881c4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
32 изменённых файлов: 167 добавлений и 36 удалений

2
.gitignore поставляемый
Просмотреть файл

@ -18,3 +18,5 @@ temp
*.tgz
*.tar
*.gz
package-lock.json

Просмотреть файл

@ -0,0 +1,8 @@
{
"type": "minor",
"comment": "making init only install devdeps for the stack - should make this faster",
"packageName": "create-just",
"email": "kchau@microsoft.com",
"commit": "04c3adea4ad2f76411ada5da61e384b63462a8aa",
"date": "2019-08-05T16:44:19.895Z"
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"type": "minor",
"comment": "initial commit",
"packageName": "just-plop-helpers",
"email": "kchau@microsoft.com",
"commit": "04c3adea4ad2f76411ada5da61e384b63462a8aa",
"date": "2019-08-05T16:44:28.007Z"
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"type": "major",
"comment": "upgrading to major 1.0.0",
"packageName": "just-stack-monorepo",
"email": "kchau@microsoft.com",
"commit": "04c3adea4ad2f76411ada5da61e384b63462a8aa",
"date": "2019-08-05T16:44:32.108Z"
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"type": "major",
"comment": "upgrading to major 1.0.0",
"packageName": "just-stack-react",
"email": "kchau@microsoft.com",
"commit": "04c3adea4ad2f76411ada5da61e384b63462a8aa",
"date": "2019-08-05T16:44:34.548Z"
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"type": "major",
"comment": "upgrading to major 1.0.0",
"packageName": "just-stack-single-lib",
"email": "kchau@microsoft.com",
"commit": "04c3adea4ad2f76411ada5da61e384b63462a8aa",
"date": "2019-08-05T16:44:37.236Z"
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"type": "major",
"comment": "upgrading to major 1.0.0",
"packageName": "just-stack-uifabric",
"email": "kchau@microsoft.com",
"commit": "04c3adea4ad2f76411ada5da61e384b63462a8aa",
"date": "2019-08-05T16:44:39.555Z"
}

Просмотреть файл

@ -76,16 +76,14 @@ export async function initCommand(argv: yargs.Arguments) {
argv.name = name;
const stackPath = await getStackPath(argv.stack, argv.registry);
pkg.install(argv.registry, stackPath!);
const stackName = getStackName(stackPath!);
logger.info(`Installing dev dependencies for the stack "${stackName}`);
pkg.installDevOnly(argv.registry, stackPath!);
const generator = getPlopGenerator(stackPath!, paths.projectPath, stackName);
logger.info(`Code Generation Information:
project path: ${paths.projectPath}
stack: ${stackName}
`);
logger.info(`Running "${stackName}" code generation actions inside: ${paths.projectPath}`);
await runGenerator(generator, argv);
@ -108,6 +106,7 @@ Please make sure you have git installed and then issue the following:
git commit -m "initial commit"
`);
process.exit(1);
}
logger.info('All Set!');

Просмотреть файл

@ -20,3 +20,8 @@ export function install(registry: string, cwd: string) {
return spawnSync(getNpm(), ['install', ...registryArgs], { stdio: 'inherit', cwd });
}
}
export function installDevOnly(registry: string, cwd: string) {
const registryArgs = registry ? ['--registry', registry] : [];
return spawnSync(getNpm(), ['install', '--only=dev', ...registryArgs], { stdio: 'inherit', cwd });
}

Просмотреть файл

@ -0,0 +1,35 @@
const fs = require('fs');
const path = require('path');
module.exports = (answers, config, plop) => {
const { src, dest, force } = config;
if (!src || !dest) {
throw new Error('both the "src" and "dest" configuration are needed for this action');
}
let destFileName = '';
if (typeof dest === 'string') {
destFileName = dest;
} else if (typeof dest === 'function') {
destFileName = dest(src);
} else {
throw new Error('"dest" can only be a string or function');
}
const srcFilePath = path.join(plop.getDestBasePath(), src);
const destFilePath = path.join(plop.getDestBasePath(), destFileName);
if (!fs.existsSync(srcFilePath)) {
throw new Error(`${srcFilePath} does not exist`);
}
if (fs.existsSync(destFilePath) && !force) {
throw new Error(`${destFilePath} already exists!`);
}
fs.renameSync(srcFilePath, destFilePath);
return `successfully renamed ${srcFilePath} to ${destFilePath}`;
};

Просмотреть файл

@ -0,0 +1,5 @@
const renameAction = require('./actions/renameAction');
module.exports = plop => {
plop.setActionType('rename', renameAction);
};

Просмотреть файл

@ -0,0 +1,6 @@
{
"name": "just-plop-helpers",
"version": "1.0.0",
"main": "index.js",
"license": "MIT"
}

Просмотреть файл

@ -1,4 +1,3 @@
CHANGELOG.*
*.log
ndoe_modules
!plop-templates/.gitignore
node_modules

Просмотреть файл

@ -1,16 +1,22 @@
{
"name": "just-stack-monorepo",
"version": "0.7.1",
"just-stack": true,
"description": "Just stack for monorepo using Rush",
"keywords": [
"just-stack"
],
"repository": {
"type": "git",
"url": "https://github.com/microsoft/just"
},
"main": "index.js",
"keywords": [
"just-stack"
],
"license": "MIT",
"author": "",
"license": "MIT"
"main": "index.js",
"dependencies": {
"just-plop-helpers": "^1.0.0"
},
"devDependencies": {
"just-plop-helpers": "^1.0.0"
},
"commentAboutDependencies": "devDependencies are used in create-just when bootstrapping a repo, they might contain duplicate dependencies and is expected"
}

Просмотреть файл

@ -17,7 +17,7 @@
"react-dom": "^16.8.6"
},
"devDependencies": {
"just-stack-react": "^0.2.0",
"just-stack-react": "^1.0.0",
"{{repoName}}-scripts": "^0.26.0"
}
}

Просмотреть файл

@ -6,7 +6,7 @@
"license": "MIT",
"workspaces": ["packages/*", "scripts"],
"devDependencies": {
"just-stack-monorepo": "^0.6.2",
"just-stack-monorepo": "^1.0.0",
"lerna": "^3.13.2",
"beachball": "^1.11.5",
"plop": "^2.4.0"

Просмотреть файл

@ -1,4 +1,5 @@
module.exports = function(plop) {
plop.load('just-plop-helpers');
plop.setGenerator('repo:just-stack-monorepo', {
actions: [
{
@ -7,6 +8,11 @@ module.exports = function(plop) {
base: 'plop-templates/repo',
destination: '.',
force: true
},
{
type: 'rename',
src: 'gitignore',
dest: '.gitignore'
}
]
});

Просмотреть файл

@ -1,6 +1,8 @@
const fs = require('fs');
module.exports = function(plop) {
plop.load('just-plop-helpers');
const packageJson = JSON.parse(fs.readFileSync(require.resolve('package.json', { paths: [process.cwd()] })));
plop.setGenerator('react-package', {
@ -21,6 +23,11 @@ module.exports = function(plop) {
data: {
repoName: packageJson.name
}
},
{
type: 'rename',
src: 'gitignore',
dest: '.gitignore'
}
]
});

Просмотреть файл

@ -1,4 +1,3 @@
CHANGELOG.*
*.log
node_modules
!**/plop-templates/.gitignore

Просмотреть файл

@ -22,6 +22,7 @@
"html-webpack-plugin": "^3.2.0",
"jest": "^24.8.0",
"jest-expect-message": "^1.0.2",
"just-plop-helpers": "^1.0.0",
"node-sass": "^4.11.0",
"plop": "^2.4.0",
"postcss": "^7.0.13",
@ -33,5 +34,9 @@
"webpack": "~4.29.5",
"webpack-cli": "^3.2.1",
"webpack-dev-server": "^3.1.14"
}
},
"devDependencies": {
"just-plop-helpers": "^1.0.0"
},
"commentAboutDependencies": "devDependencies are used in create-just when bootstrapping a repo, they might contain duplicate dependencies and is expected"
}

Просмотреть файл

@ -17,7 +17,7 @@
"react-dom": "^16.8.6"
},
"devDependencies": {
"just-stack-react": "^0.1.0",
"just-stack-react": "^1.0.0",
"just-scripts": "^0.27.0"
}
}

Просмотреть файл

@ -1,4 +1,5 @@
module.exports = function(plop) {
plop.load('just-plop-helpers');
plop.setGenerator('repo:just-stack-react', {
actions: [
{
@ -6,6 +7,11 @@ module.exports = function(plop) {
templateFiles: ['plop-templates/**/*.*', 'plop-templates/**/.*'],
destination: '.',
force: true
},
{
type: 'rename',
src: 'gitignore',
dest: '.gitignore'
}
]
});

Просмотреть файл

@ -1,4 +1,3 @@
CHANGELOG.*
*.log
node_modules
!**/plop-templates/.gitignore

Просмотреть файл

@ -4,14 +4,7 @@
"license": "MIT",
"main": "lib-commonjs/index.js",
"module": "lib/index.js",
"scripts": {
"build": "just-scripts build",
"just": "just-scripts",
"start": "just-scripts start",
"test": "just-scripts test",
"change": "beachball change"
},
"devDependencies": {
"dependencies": {
"@babel/core": "^7.5.5",
"@babel/preset-env": "^7.5.5",
"@babel/preset-react": "^7.0.0",
@ -19,7 +12,12 @@
"@types/jest": "^24.0.16",
"beachball": "^1.11.5",
"jest": "^24.8.0",
"just-plop-helpers": "^1.0.0",
"just-scripts": "^0.27.0",
"typescript": "^3.5.3"
}
},
"devDependencies": {
"just-plop-helpers": "^1.0.0"
},
"commentAboutDependencies": "devDependencies are used in create-just when bootstrapping a repo, they might contain duplicate dependencies and is expected"
}

Просмотреть файл

@ -13,7 +13,7 @@
"gen": "plop"
},
"devDependencies": {
"just-stack-single-lib": "^0.1.0",
"just-stack-single-lib": "^1.0.0",
"just-scripts": "^0.27.0",
"beachball": "^1.11.5"
}

Просмотреть файл

@ -1,10 +1,16 @@
module.exports = function(plop) {
plop.load('just-plop-helpers');
plop.setGenerator('repo', {
actions: [
{
type: 'addMany',
templateFiles: ['plop-templates/**/*', 'plop-templates/**/.*'],
destination: '.'
},
{
type: 'rename',
src: 'gitignore',
dest: '.gitignore'
}
]
});

Просмотреть файл

@ -1,4 +1,3 @@
CHANGELOG.*
*.log
node_modules
!**/plop-templates/.gitignore

Просмотреть файл

@ -11,8 +11,9 @@
},
"license": "MIT",
"author": "kchau@microsoft.com",
"dependencies": {
"just-stack-react": "^0.3.2",
"node-plop": "^0.19.0"
}
"devDependencies": {
"node-plop": "^0.19.0",
"just-stack-react": "^0.3.2"
},
"commentAboutDependencies": "devDependencies are used in create-just when bootstrapping a repo, they might contain duplicate dependencies and is expected"
}