From 555a2cd339d421aa1ea11085d40eb415c8b28d2d Mon Sep 17 00:00:00 2001 From: Garrett Serack Date: Fri, 22 Sep 2017 17:57:21 -0700 Subject: [PATCH] Publish With Yarn (#6) * Publish With Yarn * test a theory --- .gitignore | 9 ++++++++- .gulp/publishing.iced | 22 ++++++++-------------- .gulp/regeneration.iced | 4 ++-- .npmignore | 14 +++++++++++++- package.json | 3 ++- 5 files changed, 33 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index ec4bf1a..ad4ca6c 100644 --- a/.gitignore +++ b/.gitignore @@ -288,4 +288,11 @@ __pycache__/ *.xsd.cs package-lock.json -*.tgz \ No newline at end of file +*.tgz +yarn.lock + +package/ +*.tar +*.tgz +src/obj/ +*.log \ No newline at end of file diff --git a/.gulp/publishing.iced b/.gulp/publishing.iced index 4502955..2c5f00e 100644 --- a/.gulp/publishing.iced +++ b/.gulp/publishing.iced @@ -1,15 +1,9 @@ -task 'publish-preview', '', ['version-number'] , (done) -> - package_path = "#{basefolder}/package.json" - package_folder = "#{basefolder}" +task 'publish-preview', '', ['version-number','build'] , (done) -> + package_json = require "#{basefolder}/package.json" - # 1. update the patch number - package_json = require package_path - package_json.version = version - JSON.stringify(package_json,null,' ').to package_path - - # 2. call npm publish --tag preview - # Note : this will call the npm prepare task, which will call - execute "npm publish --tag preview",{cwd:package_folder, silent:false }, (c,o,e) -> - echo "\n\nPublished: #{package_json.name}@#{info package_json.version} (tagged as @preview)\n\n" - done() - \ No newline at end of file + # move .gitignore out of the way - yarn bug + rm "-f", "#{basefolder}/.gitignore" + execute "#{basefolder}/node_modules/.bin/yarn publish --tag preview --new-version #{version} --access public ",{cwd:basefolder, silent:false }, (c,o,e) -> + echo "\n\nPublished: #{package_json.name}@#{info version} (tagged as @preview)\n\n" + # bring back .gitignore! + execute "git checkout #{basefolder}/.gitignore",{cwd:basefolder, silent:true }, done \ No newline at end of file diff --git a/.gulp/regeneration.iced b/.gulp/regeneration.iced index 2a24dbc..b539a17 100644 --- a/.gulp/regeneration.iced +++ b/.gulp/regeneration.iced @@ -15,7 +15,7 @@ regenExpected = (opts,done) -> swaggerFiles = (if optsMappingsValue instanceof Array then optsMappingsValue[0] else optsMappingsValue).split(";") args = [ "--#{opts.language}", - "--clear-output-folder", + # "--clear-output-folder", # run multiple times on same folders (API version nests) "--output-folder=#{outputDir}/#{key}", "--license-header=#{if !!opts.header then opts.header else 'MICROSOFT_MIT_NO_VERSION'}" ] @@ -74,4 +74,4 @@ task 'regenerate', '', (done) -> 'outputDir': 'Resource/Expected', 'language': 'azureresourceschema' },done - return null \ No newline at end of file + return null diff --git a/.npmignore b/.npmignore index f8a119c..97e3643 100644 --- a/.npmignore +++ b/.npmignore @@ -1,7 +1,19 @@ .gulp/ .vscode/ +src/Model/ +src/Properties/ test/ +src/obj/ +package/ +*.tar +*.tgz + gulpfile.js *.sln +*.cs +*.resx +src/obj/ +yarn.lock -src/obj/ \ No newline at end of file +*.log +*.csproj \ No newline at end of file diff --git a/package.json b/package.json index 6c35f09..b6a59b6 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,8 @@ "run-sequence": "*", "shx": "^0.2.2", "through2-parallel": "^0.1.3", - "yargs": "^8.0.2" + "yargs": "^8.0.2", + "yarn": "^1.0.2" }, "dependencies": { "dotnet-2.0.0": "^1.1.0"